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 + | /* ConstrainedStringGenerator.kt:82 */
|
32 48 | #[allow(missing_docs)] // documentation missing in model
|
33 - | ///
|
49 + | /// /* ConstrainedStringGenerator.kt:83 */
|
34 50 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
35 51 | /// [constraint traits]. Use [`SensitivePatternString::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 SensitivePatternString(pub(crate) ::std::string::String);
|
59 + | pub /* ConstrainedStringGenerator.kt:86 */ struct SensitivePatternString(
|
60 + | pub(crate) ::std::string::String,
|
61 + | );
|
62 + | /* ConstrainedStringGenerator.kt:90 */
|
43 63 | impl SensitivePatternString {
|
44 64 | /// Extracts a string slice containing the entire underlying `String`.
|
45 65 | pub fn as_str(&self) -> &str {
|
46 66 | &self.0
|
47 67 | }
|
48 68 |
|
49 69 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
50 70 | pub fn inner(&self) -> &::std::string::String {
|
51 71 | &self.0
|
52 72 | }
|
53 73 |
|
54 74 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
55 75 | pub fn into_inner(self) -> ::std::string::String {
|
56 76 | self.0
|
57 77 | }
|
58 78 | }
|
79 + | /* TraitInfo.kt:41 */
|
59 80 | impl SensitivePatternString {
|
60 81 | fn check_pattern(
|
61 82 | string: ::std::string::String,
|
62 83 | ) -> ::std::result::Result<
|
63 84 | ::std::string::String,
|
64 85 | crate::model::sensitive_pattern_string::ConstraintViolation,
|
65 86 | > {
|
66 87 | let regex = Self::compile_regex();
|
67 88 |
|
68 89 | if regex.is_match(&string) {
|
69 90 | Ok(string)
|
70 91 | } else {
|
71 92 | Err(crate::model::sensitive_pattern_string::ConstraintViolation::Pattern(string))
|
72 93 | }
|
73 94 | }
|
74 95 |
|
75 96 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
76 97 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
77 98 | pub fn compile_regex() -> &'static ::regex::Regex {
|
78 99 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
79 100 | ::regex::Regex::new(r#"^[a-m]+$"#).expect(r#"The regular expression ^[a-m]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
80 101 | });
|
81 102 |
|
82 103 | ®EX
|
83 104 | }
|
84 105 | }
|
106 + | /* TraitInfo.kt:57 */
|
85 107 | impl ::std::convert::TryFrom<::std::string::String> for SensitivePatternString {
|
86 108 | type Error = crate::model::sensitive_pattern_string::ConstraintViolation;
|
87 109 |
|
88 110 | /// Constructs a `SensitivePatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
89 111 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
90 112 | let value = Self::check_pattern(value)?;
|
91 113 |
|
92 114 | Ok(Self(value))
|
93 115 | }
|
94 116 | }
|
117 + | /* ConstrainedStringGenerator.kt:112 */
|
95 118 | impl crate::constrained::Constrained for SensitivePatternString {
|
96 119 | type Unconstrained = ::std::string::String;
|
97 120 | }
|
98 121 |
|
99 122 | impl ::std::convert::From<::std::string::String>
|
100 123 | for crate::constrained::MaybeConstrained<crate::model::SensitivePatternString>
|
101 124 | {
|
102 125 | fn from(value: ::std::string::String) -> Self {
|
103 126 | Self::Unconstrained(value)
|
104 127 | }
|
105 128 | }
|
106 129 |
|
107 130 | impl ::std::fmt::Display for SensitivePatternString {
|
108 131 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
109 132 | "*** Sensitive Data Redacted ***".fmt(f)
|
110 133 | }
|
111 134 | }
|
112 135 |
|
113 136 | impl ::std::convert::From<SensitivePatternString> for ::std::string::String {
|
114 137 | fn from(value: SensitivePatternString) -> Self {
|
115 138 | value.into_inner()
|
116 139 | }
|
117 140 | }
|
118 141 |
|
142 + | /* RustType.kt:516 */
|
119 143 | #[cfg(test)]
|
144 + | /* ConstrainedStringGenerator.kt:205 */
|
120 145 | mod test_sensitive_pattern_string {
|
121 146 | #[test]
|
122 147 | fn regex_compiles() {
|
123 148 | crate::model::SensitivePatternString::compile_regex();
|
124 149 | }
|
150 + |
|
151 + | /* ConstrainedStringGenerator.kt:205 */
|
125 152 | }
|
126 153 |
|
154 + | /* UnionGenerator.kt:67 */
|
127 155 | #[allow(missing_docs)] // documentation missing in model
|
156 + | /* RustType.kt:516 */
|
128 157 | #[derive(
|
129 158 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
130 159 | )]
|
131 - | pub enum RecursiveUnionOne {
|
160 + | pub /* UnionGenerator.kt:85 */ enum RecursiveUnionOne {
|
161 + | /* UnionGenerator.kt:90 */
|
132 162 | #[allow(missing_docs)] // documentation missing in model
|
163 + | /* UnionGenerator.kt:190 */
|
133 164 | String(crate::model::RecursiveEnumString),
|
165 + | /* UnionGenerator.kt:90 */
|
134 166 | #[allow(missing_docs)] // documentation missing in model
|
167 + | /* UnionGenerator.kt:190 */
|
135 168 | Union(::std::boxed::Box<crate::model::RecursiveUnionTwo>),
|
169 + | /* UnionGenerator.kt:85 */
|
136 170 | }
|
171 + | /* UnionGenerator.kt:111 */
|
137 172 | impl RecursiveUnionOne {
|
173 + | /* UnionGenerator.kt:217 */
|
138 174 | /// Tries to convert the enum instance into [`String`](crate::model::RecursiveUnionOne::String), extracting the inner [`RecursiveEnumString`](crate::model::RecursiveEnumString).
|
175 + | /* UnionGenerator.kt:222 */
|
139 176 | /// Returns `Err(&Self)` if it can't be converted.
|
177 + | /* UnionGenerator.kt:223 */
|
140 178 | pub fn as_string(&self) -> ::std::result::Result<&crate::model::RecursiveEnumString, &Self> {
|
179 + | /* UnionGenerator.kt:227 */
|
141 180 | if let RecursiveUnionOne::String(val) = &self {
|
142 181 | ::std::result::Result::Ok(val)
|
143 182 | } else {
|
144 183 | ::std::result::Result::Err(self)
|
145 184 | }
|
185 + | /* UnionGenerator.kt:223 */
|
146 186 | }
|
187 + | /* UnionGenerator.kt:121 */
|
147 188 | /// Returns true if this is a [`String`](crate::model::RecursiveUnionOne::String).
|
189 + | /* UnionGenerator.kt:122 */
|
148 190 | pub fn is_string(&self) -> bool {
|
191 + | /* UnionGenerator.kt:123 */
|
149 192 | self.as_string().is_ok()
|
193 + | /* UnionGenerator.kt:122 */
|
150 194 | }
|
195 + | /* UnionGenerator.kt:217 */
|
151 196 | /// Tries to convert the enum instance into [`Union`](crate::model::RecursiveUnionOne::Union), extracting the inner [`RecursiveUnionTwo`](crate::model::RecursiveUnionTwo).
|
197 + | /* UnionGenerator.kt:222 */
|
152 198 | /// Returns `Err(&Self)` if it can't be converted.
|
199 + | /* UnionGenerator.kt:223 */
|
153 200 | pub fn as_union(
|
154 201 | &self,
|
155 202 | ) -> ::std::result::Result<&::std::boxed::Box<crate::model::RecursiveUnionTwo>, &Self> {
|
203 + | /* UnionGenerator.kt:227 */
|
156 204 | if let RecursiveUnionOne::Union(val) = &self {
|
157 205 | ::std::result::Result::Ok(val)
|
158 206 | } else {
|
159 207 | ::std::result::Result::Err(self)
|
160 208 | }
|
209 + | /* UnionGenerator.kt:223 */
|
161 210 | }
|
211 + | /* UnionGenerator.kt:121 */
|
162 212 | /// Returns true if this is a [`Union`](crate::model::RecursiveUnionOne::Union).
|
213 + | /* UnionGenerator.kt:122 */
|
163 214 | pub fn is_union(&self) -> bool {
|
215 + | /* UnionGenerator.kt:123 */
|
164 216 | self.as_union().is_ok()
|
217 + | /* UnionGenerator.kt:122 */
|
165 218 | }
|
219 + | /* UnionGenerator.kt:111 */
|
166 220 | }
|
167 221 |
|
222 + | /* UnionGenerator.kt:67 */
|
168 223 | #[allow(missing_docs)] // documentation missing in model
|
224 + | /* RustType.kt:516 */
|
169 225 | #[derive(
|
170 226 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
171 227 | )]
|
172 - | pub enum RecursiveUnionTwo {
|
228 + | pub /* UnionGenerator.kt:85 */ enum RecursiveUnionTwo {
|
229 + | /* UnionGenerator.kt:90 */
|
173 230 | #[allow(missing_docs)] // documentation missing in model
|
231 + | /* UnionGenerator.kt:190 */
|
174 232 | String(crate::model::RecursiveEnumString),
|
233 + | /* UnionGenerator.kt:90 */
|
175 234 | #[allow(missing_docs)] // documentation missing in model
|
235 + | /* UnionGenerator.kt:190 */
|
176 236 | Union(crate::model::RecursiveUnionOne),
|
237 + | /* UnionGenerator.kt:85 */
|
177 238 | }
|
239 + | /* UnionGenerator.kt:111 */
|
178 240 | impl RecursiveUnionTwo {
|
241 + | /* UnionGenerator.kt:217 */
|
179 242 | /// Tries to convert the enum instance into [`String`](crate::model::RecursiveUnionTwo::String), extracting the inner [`RecursiveEnumString`](crate::model::RecursiveEnumString).
|
243 + | /* UnionGenerator.kt:222 */
|
180 244 | /// Returns `Err(&Self)` if it can't be converted.
|
245 + | /* UnionGenerator.kt:223 */
|
181 246 | pub fn as_string(&self) -> ::std::result::Result<&crate::model::RecursiveEnumString, &Self> {
|
247 + | /* UnionGenerator.kt:227 */
|
182 248 | if let RecursiveUnionTwo::String(val) = &self {
|
183 249 | ::std::result::Result::Ok(val)
|
184 250 | } else {
|
185 251 | ::std::result::Result::Err(self)
|
186 252 | }
|
253 + | /* UnionGenerator.kt:223 */
|
187 254 | }
|
255 + | /* UnionGenerator.kt:121 */
|
188 256 | /// Returns true if this is a [`String`](crate::model::RecursiveUnionTwo::String).
|
257 + | /* UnionGenerator.kt:122 */
|
189 258 | pub fn is_string(&self) -> bool {
|
259 + | /* UnionGenerator.kt:123 */
|
190 260 | self.as_string().is_ok()
|
261 + | /* UnionGenerator.kt:122 */
|
191 262 | }
|
263 + | /* UnionGenerator.kt:217 */
|
192 264 | /// Tries to convert the enum instance into [`Union`](crate::model::RecursiveUnionTwo::Union), extracting the inner [`RecursiveUnionOne`](crate::model::RecursiveUnionOne).
|
265 + | /* UnionGenerator.kt:222 */
|
193 266 | /// Returns `Err(&Self)` if it can't be converted.
|
267 + | /* UnionGenerator.kt:223 */
|
194 268 | pub fn as_union(&self) -> ::std::result::Result<&crate::model::RecursiveUnionOne, &Self> {
|
269 + | /* UnionGenerator.kt:227 */
|
195 270 | if let RecursiveUnionTwo::Union(val) = &self {
|
196 271 | ::std::result::Result::Ok(val)
|
197 272 | } else {
|
198 273 | ::std::result::Result::Err(self)
|
199 274 | }
|
275 + | /* UnionGenerator.kt:223 */
|
200 276 | }
|
277 + | /* UnionGenerator.kt:121 */
|
201 278 | /// Returns true if this is a [`Union`](crate::model::RecursiveUnionTwo::Union).
|
279 + | /* UnionGenerator.kt:122 */
|
202 280 | pub fn is_union(&self) -> bool {
|
281 + | /* UnionGenerator.kt:123 */
|
203 282 | self.as_union().is_ok()
|
283 + | /* UnionGenerator.kt:122 */
|
204 284 | }
|
285 + | /* UnionGenerator.kt:111 */
|
205 286 | }
|
206 287 |
|
288 + | /* EnumGenerator.kt:154 */
|
207 289 | #[allow(missing_docs)] // documentation missing in model
|
290 + | /* RustType.kt:516 */
|
208 291 | #[derive(
|
209 292 | ::std::clone::Clone,
|
210 293 | ::std::cmp::Eq,
|
211 294 | ::std::cmp::Ord,
|
212 295 | ::std::cmp::PartialEq,
|
213 296 | ::std::cmp::PartialOrd,
|
214 297 | ::std::fmt::Debug,
|
215 298 | ::std::hash::Hash,
|
216 299 | )]
|
217 - | pub enum RecursiveEnumString {
|
300 + | pub /* EnumGenerator.kt:267 */ enum RecursiveEnumString {
|
301 + | /* EnumGenerator.kt:154 */
|
218 302 | #[allow(missing_docs)] // documentation missing in model
|
303 + | /* EnumGenerator.kt:143 */
|
219 304 | Abc,
|
305 + | /* EnumGenerator.kt:154 */
|
220 306 | #[allow(missing_docs)] // documentation missing in model
|
307 + | /* EnumGenerator.kt:143 */
|
221 308 | Def,
|
309 + | /* EnumGenerator.kt:267 */
|
222 310 | }
|
223 - | /// See [`RecursiveEnumString`](crate::model::RecursiveEnumString).
|
311 + | /// /* CodegenDelegator.kt:51 */See [`RecursiveEnumString`](crate::model::RecursiveEnumString).
|
224 312 | pub mod recursive_enum_string {
|
225 313 | #[derive(Debug, PartialEq)]
|
226 314 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
227 315 |
|
228 316 | impl ::std::fmt::Display for ConstraintViolation {
|
229 317 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
230 318 | write!(
|
231 319 | f,
|
232 320 | r#"Value provided for 'aws.protocoltests.restjson.validation#RecursiveEnumString' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]"#
|
233 321 | )
|
234 322 | }
|
235 323 | }
|
236 324 |
|
237 325 | impl ::std::error::Error for ConstraintViolation {}
|
238 326 | impl ConstraintViolation {
|
239 327 | pub(crate) fn as_validation_exception_field(
|
240 328 | self,
|
241 329 | path: ::std::string::String,
|
242 330 | ) -> crate::model::ValidationExceptionField {
|
243 331 | crate::model::ValidationExceptionField {
|
244 332 | message: format!(
|
245 333 | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]"#,
|
246 334 | &path
|
247 335 | ),
|
248 336 | path,
|
249 337 | }
|
250 338 | }
|
251 339 | }
|
340 + |
|
341 + | /* ServerEnumGenerator.kt:46 */
|
252 342 | }
|
343 + | /* ServerEnumGenerator.kt:85 */
|
253 344 | impl ::std::convert::TryFrom<&str> for RecursiveEnumString {
|
254 345 | type Error = crate::model::recursive_enum_string::ConstraintViolation;
|
255 346 | fn try_from(
|
256 347 | s: &str,
|
257 348 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
258 349 | match s {
|
259 350 | "abc" => Ok(RecursiveEnumString::Abc),
|
260 351 | "def" => Ok(RecursiveEnumString::Def),
|
261 352 | _ => Err(crate::model::recursive_enum_string::ConstraintViolation(
|
262 353 | s.to_owned(),
|
263 354 | )),
|
264 355 | }
|
265 356 | }
|
266 357 | }
|
267 358 | impl ::std::convert::TryFrom<::std::string::String> for RecursiveEnumString {
|
268 359 | type Error = crate::model::recursive_enum_string::ConstraintViolation;
|
269 360 | fn try_from(
|
270 361 | s: ::std::string::String,
|
271 362 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
272 363 | {
|
273 364 | s.as_str().try_into()
|
274 365 | }
|
275 366 | }
|
367 + | /* ServerEnumGenerator.kt:145 */
|
276 368 | impl std::str::FromStr for RecursiveEnumString {
|
277 369 | type Err = crate::model::recursive_enum_string::ConstraintViolation;
|
278 370 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
279 371 | Self::try_from(s)
|
280 372 | }
|
281 373 | }
|
374 + | /* EnumGenerator.kt:274 */
|
282 375 | impl RecursiveEnumString {
|
283 376 | /// Returns the `&str` value of the enum member.
|
284 377 | pub fn as_str(&self) -> &str {
|
285 378 | match self {
|
286 379 | RecursiveEnumString::Abc => "abc",
|
287 380 | RecursiveEnumString::Def => "def",
|
288 381 | }
|
289 382 | }
|
290 383 | /// Returns all the `&str` representations of the enum members.
|
291 384 | pub const fn values() -> &'static [&'static str] {
|
292 385 | &["abc", "def"]
|
293 386 | }
|
294 387 | }
|
388 + | /* EnumGenerator.kt:223 */
|
295 389 | impl ::std::convert::AsRef<str> for RecursiveEnumString {
|
296 390 | fn as_ref(&self) -> &str {
|
297 391 | self.as_str()
|
298 392 | }
|
299 393 | }
|
394 + | /* ConstrainedTraitForEnumGenerator.kt:36 */
|
300 395 | impl crate::constrained::Constrained for RecursiveEnumString {
|
301 396 | type Unconstrained = ::std::string::String;
|
302 397 | }
|
303 398 |
|
304 399 | impl ::std::convert::From<::std::string::String>
|
305 400 | for crate::constrained::MaybeConstrained<crate::model::RecursiveEnumString>
|
306 401 | {
|
307 402 | fn from(value: ::std::string::String) -> Self {
|
308 403 | Self::Unconstrained(value)
|
309 404 | }
|
310 405 | }
|
311 406 |
|
407 + | /* ConstrainedCollectionGenerator.kt:93 */
|
312 408 | #[allow(missing_docs)] // documentation missing in model
|
313 - | ///
|
409 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
314 410 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
315 411 | /// [constraint traits]. Use [`UnionSet::try_from`] to construct values of this type.
|
316 412 | ///
|
317 413 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
318 414 | ///
|
415 + | /* RustType.kt:516 */
|
319 416 | #[derive(
|
320 417 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
321 418 | )]
|
322 - | pub struct UnionSet(pub(crate) ::std::vec::Vec<crate::model::FooUnion>);
|
419 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct UnionSet(
|
420 + | pub(crate) ::std::vec::Vec<crate::model::FooUnion>,
|
421 + | );
|
422 + | /* ConstrainedCollectionGenerator.kt:104 */
|
323 423 | impl UnionSet {
|
424 + | /* ConstrainedCollectionGenerator.kt:106 */
|
324 425 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::FooUnion>`].
|
325 426 | pub fn inner(&self) -> &::std::vec::Vec<crate::model::FooUnion> {
|
326 427 | &self.0
|
327 428 | }
|
429 + | /* ConstrainedCollectionGenerator.kt:116 */
|
328 430 | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::FooUnion>`].
|
329 431 | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::FooUnion> {
|
330 432 | self.0
|
331 433 | }
|
332 434 |
|
333 435 | fn check_unique_items(
|
334 436 | items: ::std::vec::Vec<crate::model::FooUnion>,
|
335 437 | ) -> ::std::result::Result<
|
336 438 | ::std::vec::Vec<crate::model::FooUnion>,
|
337 439 | crate::model::union_set::ConstraintViolation,
|
338 440 | > {
|
339 441 | let mut seen = ::std::collections::HashMap::new();
|
340 442 | let mut duplicate_indices = ::std::vec::Vec::new();
|
341 443 | for (idx, item) in items.iter().enumerate() {
|
342 444 | if let Some(prev_idx) = seen.insert(item, idx) {
|
343 445 | duplicate_indices.push(prev_idx);
|
344 446 | }
|
345 447 | }
|
346 448 |
|
347 449 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
348 450 | for idx in &duplicate_indices {
|
349 451 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
350 452 | last_duplicate_indices.push(prev_idx);
|
351 453 | }
|
352 454 | }
|
353 455 | duplicate_indices.extend(last_duplicate_indices);
|
354 456 |
|
355 457 | if !duplicate_indices.is_empty() {
|
356 458 | debug_assert!(duplicate_indices.len() >= 2);
|
357 459 | Err(crate::model::union_set::ConstraintViolation::UniqueItems {
|
358 460 | duplicate_indices,
|
359 461 | original: items,
|
360 462 | })
|
361 463 | } else {
|
362 464 | Ok(items)
|
363 465 | }
|
364 466 | }
|
467 + | /* ConstrainedCollectionGenerator.kt:104 */
|
365 468 | }
|
469 + | /* ConstrainedCollectionGenerator.kt:133 */
|
366 470 | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::FooUnion>> for UnionSet {
|
367 471 | type Error = crate::model::union_set::ConstraintViolation;
|
368 472 |
|
369 473 | /// Constructs a `UnionSet` from an [`::std::vec::Vec<crate::model::FooUnion>`], failing when the provided value does not satisfy the modeled constraints.
|
370 474 | fn try_from(
|
371 475 | value: ::std::vec::Vec<crate::model::FooUnion>,
|
372 476 | ) -> ::std::result::Result<Self, Self::Error> {
|
373 477 | let value = Self::check_unique_items(value)?;
|
374 478 |
|
375 479 | Ok(Self(value))
|
376 480 | }
|
377 481 | }
|
378 482 |
|
379 483 | impl ::std::convert::From<UnionSet> for ::std::vec::Vec<crate::model::FooUnion> {
|
380 484 | fn from(value: UnionSet) -> Self {
|
381 485 | value.into_inner()
|
382 486 | }
|
383 487 | }
|
488 + | /* ConstrainedCollectionGenerator.kt:181 */
|
384 489 | impl crate::constrained::Constrained for UnionSet {
|
385 490 | type Unconstrained = crate::unconstrained::union_set_unconstrained::UnionSetUnconstrained;
|
386 491 | }
|
387 492 |
|
493 + | /* UnionGenerator.kt:67 */
|
388 494 | #[allow(missing_docs)] // documentation missing in model
|
495 + | /* RustType.kt:516 */
|
389 496 | #[derive(
|
390 497 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
391 498 | )]
|
392 - | pub enum FooUnion {
|
499 + | pub /* UnionGenerator.kt:85 */ enum FooUnion {
|
500 + | /* UnionGenerator.kt:90 */
|
393 501 | #[allow(missing_docs)] // documentation missing in model
|
502 + | /* UnionGenerator.kt:190 */
|
394 503 | Integer(i32),
|
504 + | /* UnionGenerator.kt:90 */
|
395 505 | #[allow(missing_docs)] // documentation missing in model
|
506 + | /* UnionGenerator.kt:190 */
|
396 507 | String(::std::string::String),
|
508 + | /* UnionGenerator.kt:85 */
|
397 509 | }
|
510 + | /* UnionGenerator.kt:111 */
|
398 511 | impl FooUnion {
|
512 + | /* UnionGenerator.kt:217 */
|
399 513 | /// Tries to convert the enum instance into [`Integer`](crate::model::FooUnion::Integer), extracting the inner [`i32`](i32).
|
514 + | /* UnionGenerator.kt:222 */
|
400 515 | /// Returns `Err(&Self)` if it can't be converted.
|
516 + | /* UnionGenerator.kt:223 */
|
401 517 | pub fn as_integer(&self) -> ::std::result::Result<&i32, &Self> {
|
518 + | /* UnionGenerator.kt:227 */
|
402 519 | if let FooUnion::Integer(val) = &self {
|
403 520 | ::std::result::Result::Ok(val)
|
404 521 | } else {
|
405 522 | ::std::result::Result::Err(self)
|
406 523 | }
|
524 + | /* UnionGenerator.kt:223 */
|
407 525 | }
|
526 + | /* UnionGenerator.kt:121 */
|
408 527 | /// Returns true if this is a [`Integer`](crate::model::FooUnion::Integer).
|
528 + | /* UnionGenerator.kt:122 */
|
409 529 | pub fn is_integer(&self) -> bool {
|
530 + | /* UnionGenerator.kt:123 */
|
410 531 | self.as_integer().is_ok()
|
532 + | /* UnionGenerator.kt:122 */
|
411 533 | }
|
534 + | /* UnionGenerator.kt:217 */
|
412 535 | /// Tries to convert the enum instance into [`String`](crate::model::FooUnion::String), extracting the inner [`String`](::std::string::String).
|
536 + | /* UnionGenerator.kt:222 */
|
413 537 | /// Returns `Err(&Self)` if it can't be converted.
|
538 + | /* UnionGenerator.kt:223 */
|
414 539 | pub fn as_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
540 + | /* UnionGenerator.kt:227 */
|
415 541 | if let FooUnion::String(val) = &self {
|
416 542 | ::std::result::Result::Ok(val)
|
417 543 | } else {
|
418 544 | ::std::result::Result::Err(self)
|
419 545 | }
|
546 + | /* UnionGenerator.kt:223 */
|
420 547 | }
|
548 + | /* UnionGenerator.kt:121 */
|
421 549 | /// Returns true if this is a [`String`](crate::model::FooUnion::String).
|
550 + | /* UnionGenerator.kt:122 */
|
422 551 | pub fn is_string(&self) -> bool {
|
552 + | /* UnionGenerator.kt:123 */
|
423 553 | self.as_string().is_ok()
|
554 + | /* UnionGenerator.kt:122 */
|
424 555 | }
|
556 + | /* UnionGenerator.kt:111 */
|
425 557 | }
|
426 558 |
|
559 + | /* ConstrainedCollectionGenerator.kt:93 */
|
427 560 | #[allow(missing_docs)] // documentation missing in model
|
428 - | ///
|
561 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
429 562 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
430 563 | /// [constraint traits]. Use [`StructureSetWithNoKey::try_from`] to construct values of this type.
|
431 564 | ///
|
432 565 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
433 566 | ///
|
567 + | /* RustType.kt:516 */
|
434 568 | #[derive(
|
435 569 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
436 570 | )]
|
437 - | pub struct StructureSetWithNoKey(pub(crate) ::std::vec::Vec<crate::model::MissingKeyStructure>);
|
571 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct StructureSetWithNoKey(
|
572 + | pub(crate) ::std::vec::Vec<crate::model::MissingKeyStructure>,
|
573 + | );
|
574 + | /* ConstrainedCollectionGenerator.kt:104 */
|
438 575 | impl StructureSetWithNoKey {
|
576 + | /* ConstrainedCollectionGenerator.kt:106 */
|
439 577 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::MissingKeyStructure>`].
|
440 578 | pub fn inner(&self) -> &::std::vec::Vec<crate::model::MissingKeyStructure> {
|
441 579 | &self.0
|
442 580 | }
|
581 + | /* ConstrainedCollectionGenerator.kt:116 */
|
443 582 | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::MissingKeyStructure>`].
|
444 583 | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::MissingKeyStructure> {
|
445 584 | self.0
|
446 585 | }
|
447 586 |
|
448 587 | fn check_unique_items(
|
449 588 | items: ::std::vec::Vec<crate::model::MissingKeyStructure>,
|
450 589 | ) -> ::std::result::Result<
|
451 590 | ::std::vec::Vec<crate::model::MissingKeyStructure>,
|
452 591 | crate::model::structure_set_with_no_key::ConstraintViolation,
|
453 592 | > {
|
454 593 | let mut seen = ::std::collections::HashMap::new();
|
455 594 | let mut duplicate_indices = ::std::vec::Vec::new();
|
456 595 | for (idx, item) in items.iter().enumerate() {
|
457 596 | if let Some(prev_idx) = seen.insert(item, idx) {
|
458 597 | duplicate_indices.push(prev_idx);
|
459 598 | }
|
460 599 | }
|
461 600 |
|
462 601 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
463 602 | for idx in &duplicate_indices {
|
464 603 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
465 604 | last_duplicate_indices.push(prev_idx);
|
466 605 | }
|
467 606 | }
|
468 607 | duplicate_indices.extend(last_duplicate_indices);
|
469 608 |
|
470 609 | if !duplicate_indices.is_empty() {
|
471 610 | debug_assert!(duplicate_indices.len() >= 2);
|
472 611 | Err(
|
473 612 | crate::model::structure_set_with_no_key::ConstraintViolation::UniqueItems {
|
474 613 | duplicate_indices,
|
475 614 | original: items,
|
476 615 | },
|
477 616 | )
|
478 617 | } else {
|
479 618 | Ok(items)
|
480 619 | }
|
481 620 | }
|
621 + | /* ConstrainedCollectionGenerator.kt:104 */
|
482 622 | }
|
623 + | /* ConstrainedCollectionGenerator.kt:133 */
|
483 624 | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::MissingKeyStructure>>
|
484 625 | for StructureSetWithNoKey
|
485 626 | {
|
486 627 | type Error = crate::model::structure_set_with_no_key::ConstraintViolation;
|
487 628 |
|
488 629 | /// Constructs a `StructureSetWithNoKey` from an [`::std::vec::Vec<crate::model::MissingKeyStructure>`], failing when the provided value does not satisfy the modeled constraints.
|
489 630 | fn try_from(
|
490 631 | value: ::std::vec::Vec<crate::model::MissingKeyStructure>,
|
491 632 | ) -> ::std::result::Result<Self, Self::Error> {
|
492 633 | let value = Self::check_unique_items(value)?;
|
493 634 |
|
494 635 | Ok(Self(value))
|
495 636 | }
|
496 637 | }
|
497 638 |
|
498 639 | impl ::std::convert::From<StructureSetWithNoKey>
|
499 640 | for ::std::vec::Vec<crate::model::MissingKeyStructure>
|
500 641 | {
|
501 642 | fn from(value: StructureSetWithNoKey) -> Self {
|
502 643 | value.into_inner()
|
503 644 | }
|
504 645 | }
|
646 + | /* ConstrainedCollectionGenerator.kt:181 */
|
505 647 | impl crate::constrained::Constrained for StructureSetWithNoKey {
|
506 648 | type Unconstrained = crate::unconstrained::structure_set_with_no_key_unconstrained::StructureSetWithNoKeyUnconstrained;
|
507 649 | }
|
508 650 |
|
651 + | /* StructureGenerator.kt:197 */
|
509 652 | #[allow(missing_docs)] // documentation missing in model
|
653 + | /* RustType.kt:516 */
|
510 654 | #[derive(
|
511 655 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
512 656 | )]
|
513 - | pub struct MissingKeyStructure {
|
657 + | pub /* StructureGenerator.kt:201 */ struct MissingKeyStructure {
|
658 + | /* StructureGenerator.kt:231 */
|
514 659 | #[allow(missing_docs)] // documentation missing in model
|
515 660 | pub hi: ::std::string::String,
|
661 + | /* StructureGenerator.kt:201 */
|
516 662 | }
|
663 + | /* StructureGenerator.kt:135 */
|
517 664 | impl MissingKeyStructure {
|
665 + | /* StructureGenerator.kt:231 */
|
518 666 | #[allow(missing_docs)] // documentation missing in model
|
667 + | /* StructureGenerator.kt:166 */
|
519 668 | pub fn hi(&self) -> &str {
|
669 + | /* StructureGenerator.kt:171 */
|
520 670 | use std::ops::Deref;
|
521 671 | self.hi.deref()
|
672 + | /* StructureGenerator.kt:166 */
|
522 673 | }
|
674 + | /* StructureGenerator.kt:135 */
|
523 675 | }
|
676 + | /* ServerCodegenVisitor.kt:345 */
|
524 677 | impl MissingKeyStructure {
|
525 - | /// Creates a new builder-style object to manufacture [`MissingKeyStructure`](crate::model::MissingKeyStructure).
|
678 + | /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MissingKeyStructure`](crate::model::MissingKeyStructure).
|
679 + | /* ServerBuilderGenerator.kt:295 */
|
526 680 | pub fn builder() -> crate::model::missing_key_structure::Builder {
|
681 + | /* ServerBuilderGenerator.kt:296 */
|
527 682 | crate::model::missing_key_structure::Builder::default()
|
683 + | /* ServerBuilderGenerator.kt:295 */
|
528 684 | }
|
685 + | /* ServerCodegenVisitor.kt:345 */
|
529 686 | }
|
687 + | /* ServerStructureConstrainedTraitImpl.kt:21 */
|
530 688 | impl crate::constrained::Constrained for crate::model::MissingKeyStructure {
|
531 689 | type Unconstrained = crate::model::missing_key_structure::Builder;
|
532 690 | }
|
533 691 |
|
692 + | /* ConstrainedCollectionGenerator.kt:93 */
|
534 693 | #[allow(missing_docs)] // documentation missing in model
|
535 - | ///
|
694 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
536 695 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
537 696 | /// [constraint traits]. Use [`StructureSet::try_from`] to construct values of this type.
|
538 697 | ///
|
539 698 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
540 699 | ///
|
700 + | /* RustType.kt:516 */
|
541 701 | #[derive(
|
542 702 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
543 703 | )]
|
544 - | pub struct StructureSet(pub(crate) ::std::vec::Vec<crate::model::GreetingStruct>);
|
704 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct StructureSet(
|
705 + | pub(crate) ::std::vec::Vec<crate::model::GreetingStruct>,
|
706 + | );
|
707 + | /* ConstrainedCollectionGenerator.kt:104 */
|
545 708 | impl StructureSet {
|
709 + | /* ConstrainedCollectionGenerator.kt:106 */
|
546 710 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::GreetingStruct>`].
|
547 711 | pub fn inner(&self) -> &::std::vec::Vec<crate::model::GreetingStruct> {
|
548 712 | &self.0
|
549 713 | }
|
714 + | /* ConstrainedCollectionGenerator.kt:116 */
|
550 715 | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::GreetingStruct>`].
|
551 716 | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::GreetingStruct> {
|
552 717 | self.0
|
553 718 | }
|
554 719 |
|
555 720 | fn check_unique_items(
|
556 721 | items: ::std::vec::Vec<crate::model::GreetingStruct>,
|
557 722 | ) -> ::std::result::Result<
|
558 723 | ::std::vec::Vec<crate::model::GreetingStruct>,
|
559 724 | crate::model::structure_set::ConstraintViolation,
|
560 725 | > {
|
561 726 | let mut seen = ::std::collections::HashMap::new();
|
562 727 | let mut duplicate_indices = ::std::vec::Vec::new();
|
563 728 | for (idx, item) in items.iter().enumerate() {
|
564 729 | if let Some(prev_idx) = seen.insert(item, idx) {
|
565 730 | duplicate_indices.push(prev_idx);
|
566 731 | }
|
567 732 | }
|
568 733 |
|
569 734 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
570 735 | for idx in &duplicate_indices {
|
571 736 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
572 737 | last_duplicate_indices.push(prev_idx);
|
573 738 | }
|
574 739 | }
|
575 740 | duplicate_indices.extend(last_duplicate_indices);
|
576 741 |
|
577 742 | if !duplicate_indices.is_empty() {
|
578 743 | debug_assert!(duplicate_indices.len() >= 2);
|
579 744 | Err(
|
580 745 | crate::model::structure_set::ConstraintViolation::UniqueItems {
|
581 746 | duplicate_indices,
|
582 747 | original: items,
|
583 748 | },
|
584 749 | )
|
585 750 | } else {
|
586 751 | Ok(items)
|
587 752 | }
|
588 753 | }
|
754 + | /* ConstrainedCollectionGenerator.kt:104 */
|
589 755 | }
|
756 + | /* ConstrainedCollectionGenerator.kt:133 */
|
590 757 | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::GreetingStruct>> for StructureSet {
|
591 758 | type Error = crate::model::structure_set::ConstraintViolation;
|
592 759 |
|
593 760 | /// Constructs a `StructureSet` from an [`::std::vec::Vec<crate::model::GreetingStruct>`], failing when the provided value does not satisfy the modeled constraints.
|
594 761 | fn try_from(
|
595 762 | value: ::std::vec::Vec<crate::model::GreetingStruct>,
|
596 763 | ) -> ::std::result::Result<Self, Self::Error> {
|
597 764 | let value = Self::check_unique_items(value)?;
|
598 765 |
|
599 766 | Ok(Self(value))
|
600 767 | }
|
601 768 | }
|
602 769 |
|
603 770 | impl ::std::convert::From<StructureSet> for ::std::vec::Vec<crate::model::GreetingStruct> {
|
604 771 | fn from(value: StructureSet) -> Self {
|
605 772 | value.into_inner()
|
606 773 | }
|
607 774 | }
|
775 + | /* ConstrainedCollectionGenerator.kt:181 */
|
608 776 | impl crate::constrained::Constrained for StructureSet {
|
609 777 | type Unconstrained =
|
610 778 | crate::unconstrained::structure_set_unconstrained::StructureSetUnconstrained;
|
611 779 | }
|
612 780 |
|
781 + | /* StructureGenerator.kt:197 */
|
613 782 | #[allow(missing_docs)] // documentation missing in model
|
783 + | /* RustType.kt:516 */
|
614 784 | #[derive(
|
615 785 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
616 786 | )]
|
617 - | pub struct GreetingStruct {
|
787 + | pub /* StructureGenerator.kt:201 */ struct GreetingStruct {
|
788 + | /* StructureGenerator.kt:231 */
|
618 789 | #[allow(missing_docs)] // documentation missing in model
|
619 790 | pub hi: ::std::option::Option<::std::string::String>,
|
791 + | /* StructureGenerator.kt:201 */
|
620 792 | }
|
793 + | /* StructureGenerator.kt:135 */
|
621 794 | impl GreetingStruct {
|
795 + | /* StructureGenerator.kt:231 */
|
622 796 | #[allow(missing_docs)] // documentation missing in model
|
797 + | /* StructureGenerator.kt:166 */
|
623 798 | pub fn hi(&self) -> ::std::option::Option<&str> {
|
799 + | /* StructureGenerator.kt:169 */
|
624 800 | self.hi.as_deref()
|
801 + | /* StructureGenerator.kt:166 */
|
625 802 | }
|
803 + | /* StructureGenerator.kt:135 */
|
626 804 | }
|
805 + | /* ServerCodegenVisitor.kt:345 */
|
627 806 | impl GreetingStruct {
|
628 - | /// Creates a new builder-style object to manufacture [`GreetingStruct`](crate::model::GreetingStruct).
|
807 + | /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`GreetingStruct`](crate::model::GreetingStruct).
|
808 + | /* ServerBuilderGenerator.kt:295 */
|
629 809 | pub fn builder() -> crate::model::greeting_struct::Builder {
|
810 + | /* ServerBuilderGenerator.kt:296 */
|
630 811 | crate::model::greeting_struct::Builder::default()
|
812 + | /* ServerBuilderGenerator.kt:295 */
|
631 813 | }
|
814 + | /* ServerCodegenVisitor.kt:345 */
|
632 815 | }
|
816 + | /* ServerStructureConstrainedTraitImpl.kt:21 */
|
633 817 | impl crate::constrained::Constrained for crate::model::GreetingStruct {
|
634 818 | type Unconstrained = crate::model::greeting_struct::Builder;
|
635 819 | }
|
636 820 |
|
821 + | /* ConstrainedCollectionGenerator.kt:93 */
|
637 822 | #[allow(missing_docs)] // documentation missing in model
|
638 - | ///
|
823 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
639 824 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
640 825 | /// [constraint traits]. Use [`ListSet::try_from`] to construct values of this type.
|
641 826 | ///
|
642 827 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
643 828 | ///
|
829 + | /* RustType.kt:516 */
|
644 830 | #[derive(
|
645 831 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
646 832 | )]
|
647 - | pub struct ListSet(pub(crate) ::std::vec::Vec<::std::vec::Vec<::std::string::String>>);
|
833 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct ListSet(
|
834 + | pub(crate) ::std::vec::Vec<::std::vec::Vec<::std::string::String>>,
|
835 + | );
|
836 + | /* ConstrainedCollectionGenerator.kt:104 */
|
648 837 | impl ListSet {
|
838 + | /* ConstrainedCollectionGenerator.kt:106 */
|
649 839 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::vec::Vec::<::std::string::String>>`].
|
650 840 | pub fn inner(&self) -> &::std::vec::Vec<::std::vec::Vec<::std::string::String>> {
|
651 841 | &self.0
|
652 842 | }
|
843 + | /* ConstrainedCollectionGenerator.kt:116 */
|
653 844 | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::vec::Vec::<::std::string::String>>`].
|
654 845 | pub fn into_inner(self) -> ::std::vec::Vec<::std::vec::Vec<::std::string::String>> {
|
655 846 | self.0
|
656 847 | }
|
657 848 |
|
658 849 | fn check_unique_items(
|
659 850 | items: ::std::vec::Vec<::std::vec::Vec<::std::string::String>>,
|
660 851 | ) -> ::std::result::Result<
|
661 852 | ::std::vec::Vec<::std::vec::Vec<::std::string::String>>,
|
662 853 | crate::model::list_set::ConstraintViolation,
|
663 854 | > {
|
664 855 | let mut seen = ::std::collections::HashMap::new();
|
665 856 | let mut duplicate_indices = ::std::vec::Vec::new();
|
666 857 | for (idx, item) in items.iter().enumerate() {
|
667 858 | if let Some(prev_idx) = seen.insert(item, idx) {
|
668 859 | duplicate_indices.push(prev_idx);
|
669 860 | }
|
670 861 | }
|
671 862 |
|
672 863 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
673 864 | for idx in &duplicate_indices {
|
674 865 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
675 866 | last_duplicate_indices.push(prev_idx);
|
676 867 | }
|
677 868 | }
|
678 869 | duplicate_indices.extend(last_duplicate_indices);
|
679 870 |
|
680 871 | if !duplicate_indices.is_empty() {
|
681 872 | debug_assert!(duplicate_indices.len() >= 2);
|
682 873 | Err(crate::model::list_set::ConstraintViolation::UniqueItems {
|
683 874 | duplicate_indices,
|
684 875 | original: items,
|
685 876 | })
|
686 877 | } else {
|
687 878 | Ok(items)
|
688 879 | }
|
689 880 | }
|
881 + | /* ConstrainedCollectionGenerator.kt:104 */
|
690 882 | }
|
883 + | /* ConstrainedCollectionGenerator.kt:133 */
|
691 884 | impl ::std::convert::TryFrom<::std::vec::Vec<::std::vec::Vec<::std::string::String>>> for ListSet {
|
692 885 | type Error = crate::model::list_set::ConstraintViolation;
|
693 886 |
|
694 887 | /// Constructs a `ListSet` from an [`::std::vec::Vec<::std::vec::Vec::<::std::string::String>>`], failing when the provided value does not satisfy the modeled constraints.
|
695 888 | fn try_from(
|
696 889 | value: ::std::vec::Vec<::std::vec::Vec<::std::string::String>>,
|
697 890 | ) -> ::std::result::Result<Self, Self::Error> {
|
698 891 | let value = Self::check_unique_items(value)?;
|
699 892 |
|
700 893 | Ok(Self(value))
|
701 894 | }
|
702 895 | }
|
703 896 |
|
704 897 | impl ::std::convert::From<ListSet> for ::std::vec::Vec<::std::vec::Vec<::std::string::String>> {
|
705 898 | fn from(value: ListSet) -> Self {
|
706 899 | value.into_inner()
|
707 900 | }
|
708 901 | }
|
902 + | /* ConstrainedCollectionGenerator.kt:181 */
|
709 903 | impl crate::constrained::Constrained for ListSet {
|
710 904 | type Unconstrained = crate::unconstrained::list_set_unconstrained::ListSetUnconstrained;
|
711 905 | }
|
712 906 |
|
907 + | /* ConstrainedCollectionGenerator.kt:93 */
|
713 908 | #[allow(missing_docs)] // documentation missing in model
|
714 - | ///
|
909 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
715 910 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
716 911 | /// [constraint traits]. Use [`IntegerEnumSet::try_from`] to construct values of this type.
|
717 912 | ///
|
718 913 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
719 914 | ///
|
915 + | /* RustType.kt:516 */
|
720 916 | #[derive(
|
721 917 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
722 918 | )]
|
723 - | pub struct IntegerEnumSet(pub(crate) ::std::vec::Vec<i32>);
|
919 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct IntegerEnumSet(
|
920 + | pub(crate) ::std::vec::Vec<i32>,
|
921 + | );
|
922 + | /* ConstrainedCollectionGenerator.kt:104 */
|
724 923 | impl IntegerEnumSet {
|
924 + | /* ConstrainedCollectionGenerator.kt:106 */
|
725 925 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<i32>`].
|
726 926 | pub fn inner(&self) -> &::std::vec::Vec<i32> {
|
727 927 | &self.0
|
728 928 | }
|
929 + | /* ConstrainedCollectionGenerator.kt:116 */
|
729 930 | /// Consumes the value, returning the underlying [`::std::vec::Vec<i32>`].
|
730 931 | pub fn into_inner(self) -> ::std::vec::Vec<i32> {
|
731 932 | self.0
|
732 933 | }
|
733 934 |
|
734 935 | fn check_unique_items(
|
735 936 | items: ::std::vec::Vec<i32>,
|
736 937 | ) -> ::std::result::Result<
|
737 938 | ::std::vec::Vec<i32>,
|
738 939 | crate::model::integer_enum_set::ConstraintViolation,
|
739 940 | > {
|
740 941 | let mut seen = ::std::collections::HashMap::new();
|
741 942 | let mut duplicate_indices = ::std::vec::Vec::new();
|
742 943 | for (idx, item) in items.iter().enumerate() {
|
743 944 | if let Some(prev_idx) = seen.insert(item, idx) {
|
744 945 | duplicate_indices.push(prev_idx);
|
745 946 | }
|
746 947 | }
|
747 948 |
|
748 949 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
749 950 | for idx in &duplicate_indices {
|
750 951 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
751 952 | last_duplicate_indices.push(prev_idx);
|
752 953 | }
|
753 954 | }
|
754 955 | duplicate_indices.extend(last_duplicate_indices);
|
755 956 |
|
756 957 | if !duplicate_indices.is_empty() {
|
757 958 | debug_assert!(duplicate_indices.len() >= 2);
|
758 959 | Err(
|
759 960 | crate::model::integer_enum_set::ConstraintViolation::UniqueItems {
|
760 961 | duplicate_indices,
|
761 962 | original: items,
|
762 963 | },
|
763 964 | )
|
764 965 | } else {
|
765 966 | Ok(items)
|
766 967 | }
|
767 968 | }
|
969 + | /* ConstrainedCollectionGenerator.kt:104 */
|
768 970 | }
|
971 + | /* ConstrainedCollectionGenerator.kt:133 */
|
769 972 | impl ::std::convert::TryFrom<::std::vec::Vec<i32>> for IntegerEnumSet {
|
770 973 | type Error = crate::model::integer_enum_set::ConstraintViolation;
|
771 974 |
|
772 975 | /// Constructs a `IntegerEnumSet` from an [`::std::vec::Vec<i32>`], failing when the provided value does not satisfy the modeled constraints.
|
773 976 | fn try_from(value: ::std::vec::Vec<i32>) -> ::std::result::Result<Self, Self::Error> {
|
774 977 | let value = Self::check_unique_items(value)?;
|
775 978 |
|
776 979 | Ok(Self(value))
|
777 980 | }
|
778 981 | }
|
779 982 |
|
780 983 | impl ::std::convert::From<IntegerEnumSet> for ::std::vec::Vec<i32> {
|
781 984 | fn from(value: IntegerEnumSet) -> Self {
|
782 985 | value.into_inner()
|
783 986 | }
|
784 987 | }
|
988 + | /* ConstrainedCollectionGenerator.kt:181 */
|
785 989 | impl crate::constrained::Constrained for IntegerEnumSet {
|
786 990 | type Unconstrained =
|
787 991 | crate::unconstrained::integer_enum_set_unconstrained::IntegerEnumSetUnconstrained;
|
788 992 | }
|
789 993 |
|
994 + | /* ConstrainedCollectionGenerator.kt:93 */
|
790 995 | #[allow(missing_docs)] // documentation missing in model
|
791 - | ///
|
996 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
792 997 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
793 998 | /// [constraint traits]. Use [`FooEnumSet::try_from`] to construct values of this type.
|
794 999 | ///
|
795 1000 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
796 1001 | ///
|
1002 + | /* RustType.kt:516 */
|
797 1003 | #[derive(
|
798 1004 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
799 1005 | )]
|
800 - | pub struct FooEnumSet(pub(crate) ::std::vec::Vec<crate::model::FooEnum>);
|
1006 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct FooEnumSet(
|
1007 + | pub(crate) ::std::vec::Vec<crate::model::FooEnum>,
|
1008 + | );
|
1009 + | /* ConstrainedCollectionGenerator.kt:104 */
|
801 1010 | impl FooEnumSet {
|
1011 + | /* ConstrainedCollectionGenerator.kt:106 */
|
802 1012 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::FooEnum>`].
|
803 1013 | pub fn inner(&self) -> &::std::vec::Vec<crate::model::FooEnum> {
|
804 1014 | &self.0
|
805 1015 | }
|
1016 + | /* ConstrainedCollectionGenerator.kt:116 */
|
806 1017 | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::FooEnum>`].
|
807 1018 | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::FooEnum> {
|
808 1019 | self.0
|
809 1020 | }
|
810 1021 |
|
811 1022 | fn check_unique_items(
|
812 1023 | items: ::std::vec::Vec<crate::model::FooEnum>,
|
813 1024 | ) -> ::std::result::Result<
|
814 1025 | ::std::vec::Vec<crate::model::FooEnum>,
|
815 1026 | crate::model::foo_enum_set::ConstraintViolation,
|
816 1027 | > {
|
817 1028 | let mut seen = ::std::collections::HashMap::new();
|
818 1029 | let mut duplicate_indices = ::std::vec::Vec::new();
|
819 1030 | for (idx, item) in items.iter().enumerate() {
|
820 1031 | if let Some(prev_idx) = seen.insert(item, idx) {
|
821 1032 | duplicate_indices.push(prev_idx);
|
822 1033 | }
|
823 1034 | }
|
824 1035 |
|
825 1036 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
826 1037 | for idx in &duplicate_indices {
|
827 1038 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
828 1039 | last_duplicate_indices.push(prev_idx);
|
829 1040 | }
|
830 1041 | }
|
831 1042 | duplicate_indices.extend(last_duplicate_indices);
|
832 1043 |
|
833 1044 | if !duplicate_indices.is_empty() {
|
834 1045 | debug_assert!(duplicate_indices.len() >= 2);
|
835 1046 | Err(
|
836 1047 | crate::model::foo_enum_set::ConstraintViolation::UniqueItems {
|
837 1048 | duplicate_indices,
|
838 1049 | original: items,
|
839 1050 | },
|
840 1051 | )
|
841 1052 | } else {
|
842 1053 | Ok(items)
|
843 1054 | }
|
844 1055 | }
|
1056 + | /* ConstrainedCollectionGenerator.kt:104 */
|
845 1057 | }
|
1058 + | /* ConstrainedCollectionGenerator.kt:133 */
|
846 1059 | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::FooEnum>> for FooEnumSet {
|
847 1060 | type Error = crate::model::foo_enum_set::ConstraintViolation;
|
848 1061 |
|
849 1062 | /// Constructs a `FooEnumSet` from an [`::std::vec::Vec<crate::model::FooEnum>`], failing when the provided value does not satisfy the modeled constraints.
|
850 1063 | fn try_from(
|
851 1064 | value: ::std::vec::Vec<crate::model::FooEnum>,
|
852 1065 | ) -> ::std::result::Result<Self, Self::Error> {
|
853 1066 | let value = Self::check_unique_items(value)?;
|
854 1067 |
|
855 1068 | Ok(Self(value))
|
856 1069 | }
|
857 1070 | }
|
858 1071 |
|
859 1072 | impl ::std::convert::From<FooEnumSet> for ::std::vec::Vec<crate::model::FooEnum> {
|
860 1073 | fn from(value: FooEnumSet) -> Self {
|
861 1074 | value.into_inner()
|
862 1075 | }
|
863 1076 | }
|
1077 + | /* ConstrainedCollectionGenerator.kt:181 */
|
864 1078 | impl crate::constrained::Constrained for FooEnumSet {
|
865 1079 | type Unconstrained = crate::unconstrained::foo_enum_set_unconstrained::FooEnumSetUnconstrained;
|
866 1080 | }
|
867 1081 |
|
1082 + | /* EnumGenerator.kt:154 */
|
868 1083 | #[allow(missing_docs)] // documentation missing in model
|
1084 + | /* RustType.kt:516 */
|
869 1085 | #[derive(
|
870 1086 | ::std::clone::Clone,
|
871 1087 | ::std::cmp::Eq,
|
872 1088 | ::std::cmp::Ord,
|
873 1089 | ::std::cmp::PartialEq,
|
874 1090 | ::std::cmp::PartialOrd,
|
875 1091 | ::std::fmt::Debug,
|
876 1092 | ::std::hash::Hash,
|
877 1093 | )]
|
878 - | pub enum FooEnum {
|
1094 + | pub /* EnumGenerator.kt:267 */ enum FooEnum {
|
1095 + | /* EnumGenerator.kt:154 */
|
879 1096 | #[allow(missing_docs)] // documentation missing in model
|
1097 + | /* EnumGenerator.kt:143 */
|
880 1098 | Zero,
|
1099 + | /* EnumGenerator.kt:154 */
|
881 1100 | #[allow(missing_docs)] // documentation missing in model
|
1101 + | /* EnumGenerator.kt:143 */
|
882 1102 | One,
|
1103 + | /* EnumGenerator.kt:154 */
|
883 1104 | #[allow(missing_docs)] // documentation missing in model
|
1105 + | /* EnumGenerator.kt:143 */
|
884 1106 | Bar,
|
1107 + | /* EnumGenerator.kt:154 */
|
885 1108 | #[allow(missing_docs)] // documentation missing in model
|
1109 + | /* EnumGenerator.kt:143 */
|
886 1110 | Baz,
|
1111 + | /* EnumGenerator.kt:154 */
|
887 1112 | #[allow(missing_docs)] // documentation missing in model
|
1113 + | /* EnumGenerator.kt:143 */
|
888 1114 | Foo,
|
1115 + | /* EnumGenerator.kt:267 */
|
889 1116 | }
|
890 - | /// See [`FooEnum`](crate::model::FooEnum).
|
1117 + | /// /* CodegenDelegator.kt:51 */See [`FooEnum`](crate::model::FooEnum).
|
891 1118 | pub mod foo_enum {
|
892 1119 | #[derive(Debug, PartialEq)]
|
893 1120 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
894 1121 |
|
895 1122 | impl ::std::fmt::Display for ConstraintViolation {
|
896 1123 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
897 1124 | write!(
|
898 1125 | f,
|
899 1126 | r#"Value provided for 'aws.protocoltests.shared#FooEnum' failed to satisfy constraint: Member must satisfy enum value set: [Foo, Baz, Bar, 1, 0]"#
|
900 1127 | )
|
901 1128 | }
|
902 1129 | }
|
903 1130 |
|
904 1131 | impl ::std::error::Error for ConstraintViolation {}
|
905 1132 | impl ConstraintViolation {
|
906 1133 | pub(crate) fn as_validation_exception_field(
|
907 1134 | self,
|
908 1135 | path: ::std::string::String,
|
909 1136 | ) -> crate::model::ValidationExceptionField {
|
910 1137 | crate::model::ValidationExceptionField {
|
911 1138 | message: format!(
|
912 1139 | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [Foo, Baz, Bar, 1, 0]"#,
|
913 1140 | &path
|
914 1141 | ),
|
915 1142 | path,
|
916 1143 | }
|
917 1144 | }
|
918 1145 | }
|
1146 + |
|
1147 + | /* ServerEnumGenerator.kt:46 */
|
919 1148 | }
|
1149 + | /* ServerEnumGenerator.kt:85 */
|
920 1150 | impl ::std::convert::TryFrom<&str> for FooEnum {
|
921 1151 | type Error = crate::model::foo_enum::ConstraintViolation;
|
922 1152 | fn try_from(
|
923 1153 | s: &str,
|
924 1154 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
925 1155 | match s {
|
926 1156 | "0" => Ok(FooEnum::Zero),
|
927 1157 | "1" => Ok(FooEnum::One),
|
928 1158 | "Bar" => Ok(FooEnum::Bar),
|
929 1159 | "Baz" => Ok(FooEnum::Baz),
|
930 1160 | "Foo" => Ok(FooEnum::Foo),
|
931 1161 | _ => Err(crate::model::foo_enum::ConstraintViolation(s.to_owned())),
|
932 1162 | }
|
933 1163 | }
|
934 1164 | }
|
935 1165 | impl ::std::convert::TryFrom<::std::string::String> for FooEnum {
|
936 1166 | type Error = crate::model::foo_enum::ConstraintViolation;
|
937 1167 | fn try_from(
|
938 1168 | s: ::std::string::String,
|
939 1169 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
940 1170 | {
|
941 1171 | s.as_str().try_into()
|
942 1172 | }
|
943 1173 | }
|
1174 + | /* ServerEnumGenerator.kt:145 */
|
944 1175 | impl std::str::FromStr for FooEnum {
|
945 1176 | type Err = crate::model::foo_enum::ConstraintViolation;
|
946 1177 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
947 1178 | Self::try_from(s)
|
948 1179 | }
|
949 1180 | }
|
1181 + | /* EnumGenerator.kt:274 */
|
950 1182 | impl FooEnum {
|
951 1183 | /// Returns the `&str` value of the enum member.
|
952 1184 | pub fn as_str(&self) -> &str {
|
953 1185 | match self {
|
954 1186 | FooEnum::Zero => "0",
|
955 1187 | FooEnum::One => "1",
|
956 1188 | FooEnum::Bar => "Bar",
|
957 1189 | FooEnum::Baz => "Baz",
|
958 1190 | FooEnum::Foo => "Foo",
|
959 1191 | }
|
960 1192 | }
|
961 1193 | /// Returns all the `&str` representations of the enum members.
|
962 1194 | pub const fn values() -> &'static [&'static str] {
|
963 1195 | &["0", "1", "Bar", "Baz", "Foo"]
|
964 1196 | }
|
965 1197 | }
|
1198 + | /* EnumGenerator.kt:223 */
|
966 1199 | impl ::std::convert::AsRef<str> for FooEnum {
|
967 1200 | fn as_ref(&self) -> &str {
|
968 1201 | self.as_str()
|
969 1202 | }
|
970 1203 | }
|
1204 + | /* ConstrainedTraitForEnumGenerator.kt:36 */
|
971 1205 | impl crate::constrained::Constrained for FooEnum {
|
972 1206 | type Unconstrained = ::std::string::String;
|
973 1207 | }
|
974 1208 |
|
975 1209 | impl ::std::convert::From<::std::string::String>
|
976 1210 | for crate::constrained::MaybeConstrained<crate::model::FooEnum>
|
977 1211 | {
|
978 1212 | fn from(value: ::std::string::String) -> Self {
|
979 1213 | Self::Unconstrained(value)
|
980 1214 | }
|
981 1215 | }
|
982 1216 |
|
1217 + | /* ConstrainedCollectionGenerator.kt:93 */
|
983 1218 | #[allow(missing_docs)] // documentation missing in model
|
984 - | ///
|
1219 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
985 1220 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
986 1221 | /// [constraint traits]. Use [`HttpDateSet::try_from`] to construct values of this type.
|
987 1222 | ///
|
988 1223 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
989 1224 | ///
|
1225 + | /* RustType.kt:516 */
|
990 1226 | #[derive(
|
991 1227 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
992 1228 | )]
|
993 - | pub struct HttpDateSet(pub(crate) ::std::vec::Vec<::aws_smithy_types::DateTime>);
|
1229 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct HttpDateSet(
|
1230 + | pub(crate) ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
1231 + | );
|
1232 + | /* ConstrainedCollectionGenerator.kt:104 */
|
994 1233 | impl HttpDateSet {
|
1234 + | /* ConstrainedCollectionGenerator.kt:106 */
|
995 1235 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::aws_smithy_types::DateTime>`].
|
996 1236 | pub fn inner(&self) -> &::std::vec::Vec<::aws_smithy_types::DateTime> {
|
997 1237 | &self.0
|
998 1238 | }
|
1239 + | /* ConstrainedCollectionGenerator.kt:116 */
|
999 1240 | /// Consumes the value, returning the underlying [`::std::vec::Vec<::aws_smithy_types::DateTime>`].
|
1000 1241 | pub fn into_inner(self) -> ::std::vec::Vec<::aws_smithy_types::DateTime> {
|
1001 1242 | self.0
|
1002 1243 | }
|
1003 1244 |
|
1004 1245 | fn check_unique_items(
|
1005 1246 | items: ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
1006 1247 | ) -> ::std::result::Result<
|
1007 1248 | ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
1008 1249 | crate::model::http_date_set::ConstraintViolation,
|
1009 1250 | > {
|
1010 1251 | let mut seen = ::std::collections::HashMap::new();
|
1011 1252 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1012 1253 | for (idx, item) in items.iter().enumerate() {
|
1013 1254 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1014 1255 | duplicate_indices.push(prev_idx);
|
1015 1256 | }
|
1016 1257 | }
|
1017 1258 |
|
1018 1259 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1019 1260 | for idx in &duplicate_indices {
|
1020 1261 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1021 1262 | last_duplicate_indices.push(prev_idx);
|
1022 1263 | }
|
1023 1264 | }
|
1024 1265 | duplicate_indices.extend(last_duplicate_indices);
|
1025 1266 |
|
1026 1267 | if !duplicate_indices.is_empty() {
|
1027 1268 | debug_assert!(duplicate_indices.len() >= 2);
|
1028 1269 | Err(
|
1029 1270 | crate::model::http_date_set::ConstraintViolation::UniqueItems {
|
1030 1271 | duplicate_indices,
|
1031 1272 | original: items,
|
1032 1273 | },
|
1033 1274 | )
|
1034 1275 | } else {
|
1035 1276 | Ok(items)
|
1036 1277 | }
|
1037 1278 | }
|
1279 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1038 1280 | }
|
1281 + | /* ConstrainedCollectionGenerator.kt:133 */
|
1039 1282 | impl ::std::convert::TryFrom<::std::vec::Vec<::aws_smithy_types::DateTime>> for HttpDateSet {
|
1040 1283 | type Error = crate::model::http_date_set::ConstraintViolation;
|
1041 1284 |
|
1042 1285 | /// Constructs a `HttpDateSet` from an [`::std::vec::Vec<::aws_smithy_types::DateTime>`], failing when the provided value does not satisfy the modeled constraints.
|
1043 1286 | fn try_from(
|
1044 1287 | value: ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
1045 1288 | ) -> ::std::result::Result<Self, Self::Error> {
|
1046 1289 | let value = Self::check_unique_items(value)?;
|
1047 1290 |
|
1048 1291 | Ok(Self(value))
|
1049 1292 | }
|
1050 1293 | }
|
1051 1294 |
|
1052 1295 | impl ::std::convert::From<HttpDateSet> for ::std::vec::Vec<::aws_smithy_types::DateTime> {
|
1053 1296 | fn from(value: HttpDateSet) -> Self {
|
1054 1297 | value.into_inner()
|
1055 1298 | }
|
1056 1299 | }
|
1300 + | /* ConstrainedCollectionGenerator.kt:181 */
|
1057 1301 | impl crate::constrained::Constrained for HttpDateSet {
|
1058 1302 | type Unconstrained =
|
1059 1303 | crate::unconstrained::http_date_set_unconstrained::HttpDateSetUnconstrained;
|
1060 1304 | }
|
1061 1305 |
|
1306 + | /* ConstrainedCollectionGenerator.kt:93 */
|
1062 1307 | #[allow(missing_docs)] // documentation missing in model
|
1063 - | ///
|
1308 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
1064 1309 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1065 1310 | /// [constraint traits]. Use [`DateTimeSet::try_from`] to construct values of this type.
|
1066 1311 | ///
|
1067 1312 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1068 1313 | ///
|
1314 + | /* RustType.kt:516 */
|
1069 1315 | #[derive(
|
1070 1316 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1071 1317 | )]
|
1072 - | pub struct DateTimeSet(pub(crate) ::std::vec::Vec<::aws_smithy_types::DateTime>);
|
1318 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct DateTimeSet(
|
1319 + | pub(crate) ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
1320 + | );
|
1321 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1073 1322 | impl DateTimeSet {
|
1323 + | /* ConstrainedCollectionGenerator.kt:106 */
|
1074 1324 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::aws_smithy_types::DateTime>`].
|
1075 1325 | pub fn inner(&self) -> &::std::vec::Vec<::aws_smithy_types::DateTime> {
|
1076 1326 | &self.0
|
1077 1327 | }
|
1328 + | /* ConstrainedCollectionGenerator.kt:116 */
|
1078 1329 | /// Consumes the value, returning the underlying [`::std::vec::Vec<::aws_smithy_types::DateTime>`].
|
1079 1330 | pub fn into_inner(self) -> ::std::vec::Vec<::aws_smithy_types::DateTime> {
|
1080 1331 | self.0
|
1081 1332 | }
|
1082 1333 |
|
1083 1334 | fn check_unique_items(
|
1084 1335 | items: ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
1085 1336 | ) -> ::std::result::Result<
|
1086 1337 | ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
1087 1338 | crate::model::date_time_set::ConstraintViolation,
|
1088 1339 | > {
|
1089 1340 | let mut seen = ::std::collections::HashMap::new();
|
1090 1341 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1091 1342 | for (idx, item) in items.iter().enumerate() {
|
1092 1343 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1093 1344 | duplicate_indices.push(prev_idx);
|
1094 1345 | }
|
1095 1346 | }
|
1096 1347 |
|
1097 1348 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1098 1349 | for idx in &duplicate_indices {
|
1099 1350 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1100 1351 | last_duplicate_indices.push(prev_idx);
|
1101 1352 | }
|
1102 1353 | }
|
1103 1354 | duplicate_indices.extend(last_duplicate_indices);
|
1104 1355 |
|
1105 1356 | if !duplicate_indices.is_empty() {
|
1106 1357 | debug_assert!(duplicate_indices.len() >= 2);
|
1107 1358 | Err(
|
1108 1359 | crate::model::date_time_set::ConstraintViolation::UniqueItems {
|
1109 1360 | duplicate_indices,
|
1110 1361 | original: items,
|
1111 1362 | },
|
1112 1363 | )
|
1113 1364 | } else {
|
1114 1365 | Ok(items)
|
1115 1366 | }
|
1116 1367 | }
|
1368 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1117 1369 | }
|
1370 + | /* ConstrainedCollectionGenerator.kt:133 */
|
1118 1371 | impl ::std::convert::TryFrom<::std::vec::Vec<::aws_smithy_types::DateTime>> for DateTimeSet {
|
1119 1372 | type Error = crate::model::date_time_set::ConstraintViolation;
|
1120 1373 |
|
1121 1374 | /// Constructs a `DateTimeSet` from an [`::std::vec::Vec<::aws_smithy_types::DateTime>`], failing when the provided value does not satisfy the modeled constraints.
|
1122 1375 | fn try_from(
|
1123 1376 | value: ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
1124 1377 | ) -> ::std::result::Result<Self, Self::Error> {
|
1125 1378 | let value = Self::check_unique_items(value)?;
|
1126 1379 |
|
1127 1380 | Ok(Self(value))
|
1128 1381 | }
|
1129 1382 | }
|
1130 1383 |
|
1131 1384 | impl ::std::convert::From<DateTimeSet> for ::std::vec::Vec<::aws_smithy_types::DateTime> {
|
1132 1385 | fn from(value: DateTimeSet) -> Self {
|
1133 1386 | value.into_inner()
|
1134 1387 | }
|
1135 1388 | }
|
1389 + | /* ConstrainedCollectionGenerator.kt:181 */
|
1136 1390 | impl crate::constrained::Constrained for DateTimeSet {
|
1137 1391 | type Unconstrained =
|
1138 1392 | crate::unconstrained::date_time_set_unconstrained::DateTimeSetUnconstrained;
|
1139 1393 | }
|
1140 1394 |
|
1395 + | /* ConstrainedCollectionGenerator.kt:93 */
|
1141 1396 | #[allow(missing_docs)] // documentation missing in model
|
1142 - | ///
|
1397 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
1143 1398 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1144 1399 | /// [constraint traits]. Use [`TimestampSet::try_from`] to construct values of this type.
|
1145 1400 | ///
|
1146 1401 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1147 1402 | ///
|
1403 + | /* RustType.kt:516 */
|
1148 1404 | #[derive(
|
1149 1405 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1150 1406 | )]
|
1151 - | pub struct TimestampSet(pub(crate) ::std::vec::Vec<::aws_smithy_types::DateTime>);
|
1407 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct TimestampSet(
|
1408 + | pub(crate) ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
1409 + | );
|
1410 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1152 1411 | impl TimestampSet {
|
1412 + | /* ConstrainedCollectionGenerator.kt:106 */
|
1153 1413 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::aws_smithy_types::DateTime>`].
|
1154 1414 | pub fn inner(&self) -> &::std::vec::Vec<::aws_smithy_types::DateTime> {
|
1155 1415 | &self.0
|
1156 1416 | }
|
1417 + | /* ConstrainedCollectionGenerator.kt:116 */
|
1157 1418 | /// Consumes the value, returning the underlying [`::std::vec::Vec<::aws_smithy_types::DateTime>`].
|
1158 1419 | pub fn into_inner(self) -> ::std::vec::Vec<::aws_smithy_types::DateTime> {
|
1159 1420 | self.0
|
1160 1421 | }
|
1161 1422 |
|
1162 1423 | fn check_unique_items(
|
1163 1424 | items: ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
1164 1425 | ) -> ::std::result::Result<
|
1165 1426 | ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
1166 1427 | crate::model::timestamp_set::ConstraintViolation,
|
1167 1428 | > {
|
1168 1429 | let mut seen = ::std::collections::HashMap::new();
|
1169 1430 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1170 1431 | for (idx, item) in items.iter().enumerate() {
|
1171 1432 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1172 1433 | duplicate_indices.push(prev_idx);
|
1173 1434 | }
|
1174 1435 | }
|
1175 1436 |
|
1176 1437 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1177 1438 | for idx in &duplicate_indices {
|
1178 1439 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1179 1440 | last_duplicate_indices.push(prev_idx);
|
1180 1441 | }
|
1181 1442 | }
|
1182 1443 | duplicate_indices.extend(last_duplicate_indices);
|
1183 1444 |
|
1184 1445 | if !duplicate_indices.is_empty() {
|
1185 1446 | debug_assert!(duplicate_indices.len() >= 2);
|
1186 1447 | Err(
|
1187 1448 | crate::model::timestamp_set::ConstraintViolation::UniqueItems {
|
1188 1449 | duplicate_indices,
|
1189 1450 | original: items,
|
1190 1451 | },
|
1191 1452 | )
|
1192 1453 | } else {
|
1193 1454 | Ok(items)
|
1194 1455 | }
|
1195 1456 | }
|
1457 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1196 1458 | }
|
1459 + | /* ConstrainedCollectionGenerator.kt:133 */
|
1197 1460 | impl ::std::convert::TryFrom<::std::vec::Vec<::aws_smithy_types::DateTime>> for TimestampSet {
|
1198 1461 | type Error = crate::model::timestamp_set::ConstraintViolation;
|
1199 1462 |
|
1200 1463 | /// Constructs a `TimestampSet` from an [`::std::vec::Vec<::aws_smithy_types::DateTime>`], failing when the provided value does not satisfy the modeled constraints.
|
1201 1464 | fn try_from(
|
1202 1465 | value: ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
1203 1466 | ) -> ::std::result::Result<Self, Self::Error> {
|
1204 1467 | let value = Self::check_unique_items(value)?;
|
1205 1468 |
|
1206 1469 | Ok(Self(value))
|
1207 1470 | }
|
1208 1471 | }
|
1209 1472 |
|
1210 1473 | impl ::std::convert::From<TimestampSet> for ::std::vec::Vec<::aws_smithy_types::DateTime> {
|
1211 1474 | fn from(value: TimestampSet) -> Self {
|
1212 1475 | value.into_inner()
|
1213 1476 | }
|
1214 1477 | }
|
1478 + | /* ConstrainedCollectionGenerator.kt:181 */
|
1215 1479 | impl crate::constrained::Constrained for TimestampSet {
|
1216 1480 | type Unconstrained =
|
1217 1481 | crate::unconstrained::timestamp_set_unconstrained::TimestampSetUnconstrained;
|
1218 1482 | }
|
1219 1483 |
|
1484 + | /* ConstrainedCollectionGenerator.kt:93 */
|
1220 1485 | #[allow(missing_docs)] // documentation missing in model
|
1221 - | ///
|
1486 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
1222 1487 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1223 1488 | /// [constraint traits]. Use [`LongSet::try_from`] to construct values of this type.
|
1224 1489 | ///
|
1225 1490 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1226 1491 | ///
|
1492 + | /* RustType.kt:516 */
|
1227 1493 | #[derive(
|
1228 1494 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1229 1495 | )]
|
1230 - | pub struct LongSet(pub(crate) ::std::vec::Vec<i64>);
|
1496 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct LongSet(pub(crate) ::std::vec::Vec<i64>);
|
1497 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1231 1498 | impl LongSet {
|
1499 + | /* ConstrainedCollectionGenerator.kt:106 */
|
1232 1500 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<i64>`].
|
1233 1501 | pub fn inner(&self) -> &::std::vec::Vec<i64> {
|
1234 1502 | &self.0
|
1235 1503 | }
|
1504 + | /* ConstrainedCollectionGenerator.kt:116 */
|
1236 1505 | /// Consumes the value, returning the underlying [`::std::vec::Vec<i64>`].
|
1237 1506 | pub fn into_inner(self) -> ::std::vec::Vec<i64> {
|
1238 1507 | self.0
|
1239 1508 | }
|
1240 1509 |
|
1241 1510 | fn check_unique_items(
|
1242 1511 | items: ::std::vec::Vec<i64>,
|
1243 1512 | ) -> ::std::result::Result<::std::vec::Vec<i64>, crate::model::long_set::ConstraintViolation>
|
1244 1513 | {
|
1245 1514 | let mut seen = ::std::collections::HashMap::new();
|
1246 1515 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1247 1516 | for (idx, item) in items.iter().enumerate() {
|
1248 1517 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1249 1518 | duplicate_indices.push(prev_idx);
|
1250 1519 | }
|
1251 1520 | }
|
1252 1521 |
|
1253 1522 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1254 1523 | for idx in &duplicate_indices {
|
1255 1524 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1256 1525 | last_duplicate_indices.push(prev_idx);
|
1257 1526 | }
|
1258 1527 | }
|
1259 1528 | duplicate_indices.extend(last_duplicate_indices);
|
1260 1529 |
|
1261 1530 | if !duplicate_indices.is_empty() {
|
1262 1531 | debug_assert!(duplicate_indices.len() >= 2);
|
1263 1532 | Err(crate::model::long_set::ConstraintViolation::UniqueItems {
|
1264 1533 | duplicate_indices,
|
1265 1534 | original: items,
|
1266 1535 | })
|
1267 1536 | } else {
|
1268 1537 | Ok(items)
|
1269 1538 | }
|
1270 1539 | }
|
1540 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1271 1541 | }
|
1542 + | /* ConstrainedCollectionGenerator.kt:133 */
|
1272 1543 | impl ::std::convert::TryFrom<::std::vec::Vec<i64>> for LongSet {
|
1273 1544 | type Error = crate::model::long_set::ConstraintViolation;
|
1274 1545 |
|
1275 1546 | /// Constructs a `LongSet` from an [`::std::vec::Vec<i64>`], failing when the provided value does not satisfy the modeled constraints.
|
1276 1547 | fn try_from(value: ::std::vec::Vec<i64>) -> ::std::result::Result<Self, Self::Error> {
|
1277 1548 | let value = Self::check_unique_items(value)?;
|
1278 1549 |
|
1279 1550 | Ok(Self(value))
|
1280 1551 | }
|
1281 1552 | }
|
1282 1553 |
|
1283 1554 | impl ::std::convert::From<LongSet> for ::std::vec::Vec<i64> {
|
1284 1555 | fn from(value: LongSet) -> Self {
|
1285 1556 | value.into_inner()
|
1286 1557 | }
|
1287 1558 | }
|
1559 + | /* ConstrainedCollectionGenerator.kt:181 */
|
1288 1560 | impl crate::constrained::Constrained for LongSet {
|
1289 1561 | type Unconstrained = crate::unconstrained::long_set_unconstrained::LongSetUnconstrained;
|
1290 1562 | }
|
1291 1563 |
|
1564 + | /* ConstrainedCollectionGenerator.kt:93 */
|
1292 1565 | #[allow(missing_docs)] // documentation missing in model
|
1293 - | ///
|
1566 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
1294 1567 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1295 1568 | /// [constraint traits]. Use [`IntegerSet::try_from`] to construct values of this type.
|
1296 1569 | ///
|
1297 1570 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1298 1571 | ///
|
1572 + | /* RustType.kt:516 */
|
1299 1573 | #[derive(
|
1300 1574 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1301 1575 | )]
|
1302 - | pub struct IntegerSet(pub(crate) ::std::vec::Vec<i32>);
|
1576 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct IntegerSet(pub(crate) ::std::vec::Vec<i32>);
|
1577 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1303 1578 | impl IntegerSet {
|
1579 + | /* ConstrainedCollectionGenerator.kt:106 */
|
1304 1580 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<i32>`].
|
1305 1581 | pub fn inner(&self) -> &::std::vec::Vec<i32> {
|
1306 1582 | &self.0
|
1307 1583 | }
|
1584 + | /* ConstrainedCollectionGenerator.kt:116 */
|
1308 1585 | /// Consumes the value, returning the underlying [`::std::vec::Vec<i32>`].
|
1309 1586 | pub fn into_inner(self) -> ::std::vec::Vec<i32> {
|
1310 1587 | self.0
|
1311 1588 | }
|
1312 1589 |
|
1313 1590 | fn check_unique_items(
|
1314 1591 | items: ::std::vec::Vec<i32>,
|
1315 1592 | ) -> ::std::result::Result<::std::vec::Vec<i32>, crate::model::integer_set::ConstraintViolation>
|
1316 1593 | {
|
1317 1594 | let mut seen = ::std::collections::HashMap::new();
|
1318 1595 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1319 1596 | for (idx, item) in items.iter().enumerate() {
|
1320 1597 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1321 1598 | duplicate_indices.push(prev_idx);
|
1322 1599 | }
|
1323 1600 | }
|
1324 1601 |
|
1325 1602 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1326 1603 | for idx in &duplicate_indices {
|
1327 1604 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1328 1605 | last_duplicate_indices.push(prev_idx);
|
1329 1606 | }
|
1330 1607 | }
|
1331 1608 | duplicate_indices.extend(last_duplicate_indices);
|
1332 1609 |
|
1333 1610 | if !duplicate_indices.is_empty() {
|
1334 1611 | debug_assert!(duplicate_indices.len() >= 2);
|
1335 1612 | Err(
|
1336 1613 | crate::model::integer_set::ConstraintViolation::UniqueItems {
|
1337 1614 | duplicate_indices,
|
1338 1615 | original: items,
|
1339 1616 | },
|
1340 1617 | )
|
1341 1618 | } else {
|
1342 1619 | Ok(items)
|
1343 1620 | }
|
1344 1621 | }
|
1622 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1345 1623 | }
|
1624 + | /* ConstrainedCollectionGenerator.kt:133 */
|
1346 1625 | impl ::std::convert::TryFrom<::std::vec::Vec<i32>> for IntegerSet {
|
1347 1626 | type Error = crate::model::integer_set::ConstraintViolation;
|
1348 1627 |
|
1349 1628 | /// Constructs a `IntegerSet` from an [`::std::vec::Vec<i32>`], failing when the provided value does not satisfy the modeled constraints.
|
1350 1629 | fn try_from(value: ::std::vec::Vec<i32>) -> ::std::result::Result<Self, Self::Error> {
|
1351 1630 | let value = Self::check_unique_items(value)?;
|
1352 1631 |
|
1353 1632 | Ok(Self(value))
|
1354 1633 | }
|
1355 1634 | }
|
1356 1635 |
|
1357 1636 | impl ::std::convert::From<IntegerSet> for ::std::vec::Vec<i32> {
|
1358 1637 | fn from(value: IntegerSet) -> Self {
|
1359 1638 | value.into_inner()
|
1360 1639 | }
|
1361 1640 | }
|
1641 + | /* ConstrainedCollectionGenerator.kt:181 */
|
1362 1642 | impl crate::constrained::Constrained for IntegerSet {
|
1363 1643 | type Unconstrained = crate::unconstrained::integer_set_unconstrained::IntegerSetUnconstrained;
|
1364 1644 | }
|
1365 1645 |
|
1646 + | /* ConstrainedCollectionGenerator.kt:93 */
|
1366 1647 | #[allow(missing_docs)] // documentation missing in model
|
1367 - | ///
|
1648 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
1368 1649 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1369 1650 | /// [constraint traits]. Use [`ShortSet::try_from`] to construct values of this type.
|
1370 1651 | ///
|
1371 1652 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1372 1653 | ///
|
1654 + | /* RustType.kt:516 */
|
1373 1655 | #[derive(
|
1374 1656 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1375 1657 | )]
|
1376 - | pub struct ShortSet(pub(crate) ::std::vec::Vec<i16>);
|
1658 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct ShortSet(pub(crate) ::std::vec::Vec<i16>);
|
1659 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1377 1660 | impl ShortSet {
|
1661 + | /* ConstrainedCollectionGenerator.kt:106 */
|
1378 1662 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<i16>`].
|
1379 1663 | pub fn inner(&self) -> &::std::vec::Vec<i16> {
|
1380 1664 | &self.0
|
1381 1665 | }
|
1666 + | /* ConstrainedCollectionGenerator.kt:116 */
|
1382 1667 | /// Consumes the value, returning the underlying [`::std::vec::Vec<i16>`].
|
1383 1668 | pub fn into_inner(self) -> ::std::vec::Vec<i16> {
|
1384 1669 | self.0
|
1385 1670 | }
|
1386 1671 |
|
1387 1672 | fn check_unique_items(
|
1388 1673 | items: ::std::vec::Vec<i16>,
|
1389 1674 | ) -> ::std::result::Result<::std::vec::Vec<i16>, crate::model::short_set::ConstraintViolation>
|
1390 1675 | {
|
1391 1676 | let mut seen = ::std::collections::HashMap::new();
|
1392 1677 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1393 1678 | for (idx, item) in items.iter().enumerate() {
|
1394 1679 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1395 1680 | duplicate_indices.push(prev_idx);
|
1396 1681 | }
|
1397 1682 | }
|
1398 1683 |
|
1399 1684 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1400 1685 | for idx in &duplicate_indices {
|
1401 1686 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1402 1687 | last_duplicate_indices.push(prev_idx);
|
1403 1688 | }
|
1404 1689 | }
|
1405 1690 | duplicate_indices.extend(last_duplicate_indices);
|
1406 1691 |
|
1407 1692 | if !duplicate_indices.is_empty() {
|
1408 1693 | debug_assert!(duplicate_indices.len() >= 2);
|
1409 1694 | Err(crate::model::short_set::ConstraintViolation::UniqueItems {
|
1410 1695 | duplicate_indices,
|
1411 1696 | original: items,
|
1412 1697 | })
|
1413 1698 | } else {
|
1414 1699 | Ok(items)
|
1415 1700 | }
|
1416 1701 | }
|
1702 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1417 1703 | }
|
1704 + | /* ConstrainedCollectionGenerator.kt:133 */
|
1418 1705 | impl ::std::convert::TryFrom<::std::vec::Vec<i16>> for ShortSet {
|
1419 1706 | type Error = crate::model::short_set::ConstraintViolation;
|
1420 1707 |
|
1421 1708 | /// Constructs a `ShortSet` from an [`::std::vec::Vec<i16>`], failing when the provided value does not satisfy the modeled constraints.
|
1422 1709 | fn try_from(value: ::std::vec::Vec<i16>) -> ::std::result::Result<Self, Self::Error> {
|
1423 1710 | let value = Self::check_unique_items(value)?;
|
1424 1711 |
|
1425 1712 | Ok(Self(value))
|
1426 1713 | }
|
1427 1714 | }
|
1428 1715 |
|
1429 1716 | impl ::std::convert::From<ShortSet> for ::std::vec::Vec<i16> {
|
1430 1717 | fn from(value: ShortSet) -> Self {
|
1431 1718 | value.into_inner()
|
1432 1719 | }
|
1433 1720 | }
|
1721 + | /* ConstrainedCollectionGenerator.kt:181 */
|
1434 1722 | impl crate::constrained::Constrained for ShortSet {
|
1435 1723 | type Unconstrained = crate::unconstrained::short_set_unconstrained::ShortSetUnconstrained;
|
1436 1724 | }
|
1437 1725 |
|
1726 + | /* ConstrainedCollectionGenerator.kt:93 */
|
1438 1727 | #[allow(missing_docs)] // documentation missing in model
|
1439 - | ///
|
1728 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
1440 1729 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1441 1730 | /// [constraint traits]. Use [`ByteSet::try_from`] to construct values of this type.
|
1442 1731 | ///
|
1443 1732 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1444 1733 | ///
|
1734 + | /* RustType.kt:516 */
|
1445 1735 | #[derive(
|
1446 1736 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1447 1737 | )]
|
1448 - | pub struct ByteSet(pub(crate) ::std::vec::Vec<i8>);
|
1738 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct ByteSet(pub(crate) ::std::vec::Vec<i8>);
|
1739 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1449 1740 | impl ByteSet {
|
1741 + | /* ConstrainedCollectionGenerator.kt:106 */
|
1450 1742 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<i8>`].
|
1451 1743 | pub fn inner(&self) -> &::std::vec::Vec<i8> {
|
1452 1744 | &self.0
|
1453 1745 | }
|
1746 + | /* ConstrainedCollectionGenerator.kt:116 */
|
1454 1747 | /// Consumes the value, returning the underlying [`::std::vec::Vec<i8>`].
|
1455 1748 | pub fn into_inner(self) -> ::std::vec::Vec<i8> {
|
1456 1749 | self.0
|
1457 1750 | }
|
1458 1751 |
|
1459 1752 | fn check_unique_items(
|
1460 1753 | items: ::std::vec::Vec<i8>,
|
1461 1754 | ) -> ::std::result::Result<::std::vec::Vec<i8>, crate::model::byte_set::ConstraintViolation>
|
1462 1755 | {
|
1463 1756 | let mut seen = ::std::collections::HashMap::new();
|
1464 1757 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1465 1758 | for (idx, item) in items.iter().enumerate() {
|
1466 1759 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1467 1760 | duplicate_indices.push(prev_idx);
|
1468 1761 | }
|
1469 1762 | }
|
1470 1763 |
|
1471 1764 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1472 1765 | for idx in &duplicate_indices {
|
1473 1766 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1474 1767 | last_duplicate_indices.push(prev_idx);
|
1475 1768 | }
|
1476 1769 | }
|
1477 1770 | duplicate_indices.extend(last_duplicate_indices);
|
1478 1771 |
|
1479 1772 | if !duplicate_indices.is_empty() {
|
1480 1773 | debug_assert!(duplicate_indices.len() >= 2);
|
1481 1774 | Err(crate::model::byte_set::ConstraintViolation::UniqueItems {
|
1482 1775 | duplicate_indices,
|
1483 1776 | original: items,
|
1484 1777 | })
|
1485 1778 | } else {
|
1486 1779 | Ok(items)
|
1487 1780 | }
|
1488 1781 | }
|
1782 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1489 1783 | }
|
1784 + | /* ConstrainedCollectionGenerator.kt:133 */
|
1490 1785 | impl ::std::convert::TryFrom<::std::vec::Vec<i8>> for ByteSet {
|
1491 1786 | type Error = crate::model::byte_set::ConstraintViolation;
|
1492 1787 |
|
1493 1788 | /// Constructs a `ByteSet` from an [`::std::vec::Vec<i8>`], failing when the provided value does not satisfy the modeled constraints.
|
1494 1789 | fn try_from(value: ::std::vec::Vec<i8>) -> ::std::result::Result<Self, Self::Error> {
|
1495 1790 | let value = Self::check_unique_items(value)?;
|
1496 1791 |
|
1497 1792 | Ok(Self(value))
|
1498 1793 | }
|
1499 1794 | }
|
1500 1795 |
|
1501 1796 | impl ::std::convert::From<ByteSet> for ::std::vec::Vec<i8> {
|
1502 1797 | fn from(value: ByteSet) -> Self {
|
1503 1798 | value.into_inner()
|
1504 1799 | }
|
1505 1800 | }
|
1801 + | /* ConstrainedCollectionGenerator.kt:181 */
|
1506 1802 | impl crate::constrained::Constrained for ByteSet {
|
1507 1803 | type Unconstrained = crate::unconstrained::byte_set_unconstrained::ByteSetUnconstrained;
|
1508 1804 | }
|
1509 1805 |
|
1806 + | /* ConstrainedCollectionGenerator.kt:93 */
|
1510 1807 | #[allow(missing_docs)] // documentation missing in model
|
1511 - | ///
|
1808 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
1512 1809 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1513 1810 | /// [constraint traits]. Use [`StringSet::try_from`] to construct values of this type.
|
1514 1811 | ///
|
1515 1812 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1516 1813 | ///
|
1814 + | /* RustType.kt:516 */
|
1517 1815 | #[derive(
|
1518 1816 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1519 1817 | )]
|
1520 - | pub struct StringSet(pub(crate) ::std::vec::Vec<::std::string::String>);
|
1818 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct StringSet(
|
1819 + | pub(crate) ::std::vec::Vec<::std::string::String>,
|
1820 + | );
|
1821 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1521 1822 | impl StringSet {
|
1823 + | /* ConstrainedCollectionGenerator.kt:106 */
|
1522 1824 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
|
1523 1825 | pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
|
1524 1826 | &self.0
|
1525 1827 | }
|
1828 + | /* ConstrainedCollectionGenerator.kt:116 */
|
1526 1829 | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
1527 1830 | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
1528 1831 | self.0
|
1529 1832 | }
|
1530 1833 |
|
1531 1834 | fn check_unique_items(
|
1532 1835 | items: ::std::vec::Vec<::std::string::String>,
|
1533 1836 | ) -> ::std::result::Result<
|
1534 1837 | ::std::vec::Vec<::std::string::String>,
|
1535 1838 | crate::model::string_set::ConstraintViolation,
|
1536 1839 | > {
|
1537 1840 | let mut seen = ::std::collections::HashMap::new();
|
1538 1841 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1539 1842 | for (idx, item) in items.iter().enumerate() {
|
1540 1843 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1541 1844 | duplicate_indices.push(prev_idx);
|
1542 1845 | }
|
1543 1846 | }
|
1544 1847 |
|
1545 1848 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1546 1849 | for idx in &duplicate_indices {
|
1547 1850 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1548 1851 | last_duplicate_indices.push(prev_idx);
|
1549 1852 | }
|
1550 1853 | }
|
1551 1854 | duplicate_indices.extend(last_duplicate_indices);
|
1552 1855 |
|
1553 1856 | if !duplicate_indices.is_empty() {
|
1554 1857 | debug_assert!(duplicate_indices.len() >= 2);
|
1555 1858 | Err(crate::model::string_set::ConstraintViolation::UniqueItems {
|
1556 1859 | duplicate_indices,
|
1557 1860 | original: items,
|
1558 1861 | })
|
1559 1862 | } else {
|
1560 1863 | Ok(items)
|
1561 1864 | }
|
1562 1865 | }
|
1866 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1563 1867 | }
|
1868 + | /* ConstrainedCollectionGenerator.kt:133 */
|
1564 1869 | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for StringSet {
|
1565 1870 | type Error = crate::model::string_set::ConstraintViolation;
|
1566 1871 |
|
1567 1872 | /// Constructs a `StringSet` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
1568 1873 | fn try_from(
|
1569 1874 | value: ::std::vec::Vec<::std::string::String>,
|
1570 1875 | ) -> ::std::result::Result<Self, Self::Error> {
|
1571 1876 | let value = Self::check_unique_items(value)?;
|
1572 1877 |
|
1573 1878 | Ok(Self(value))
|
1574 1879 | }
|
1575 1880 | }
|
1576 1881 |
|
1577 1882 | impl ::std::convert::From<StringSet> for ::std::vec::Vec<::std::string::String> {
|
1578 1883 | fn from(value: StringSet) -> Self {
|
1579 1884 | value.into_inner()
|
1580 1885 | }
|
1581 1886 | }
|
1887 + | /* ConstrainedCollectionGenerator.kt:181 */
|
1582 1888 | impl crate::constrained::Constrained for StringSet {
|
1583 1889 | type Unconstrained = crate::unconstrained::string_set_unconstrained::StringSetUnconstrained;
|
1584 1890 | }
|
1585 1891 |
|
1892 + | /* ConstrainedCollectionGenerator.kt:93 */
|
1586 1893 | #[allow(missing_docs)] // documentation missing in model
|
1587 - | ///
|
1894 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
1588 1895 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1589 1896 | /// [constraint traits]. Use [`BooleanSet::try_from`] to construct values of this type.
|
1590 1897 | ///
|
1591 1898 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1592 1899 | ///
|
1900 + | /* RustType.kt:516 */
|
1593 1901 | #[derive(
|
1594 1902 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1595 1903 | )]
|
1596 - | pub struct BooleanSet(pub(crate) ::std::vec::Vec<bool>);
|
1904 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct BooleanSet(pub(crate) ::std::vec::Vec<bool>);
|
1905 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1597 1906 | impl BooleanSet {
|
1907 + | /* ConstrainedCollectionGenerator.kt:106 */
|
1598 1908 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<bool>`].
|
1599 1909 | pub fn inner(&self) -> &::std::vec::Vec<bool> {
|
1600 1910 | &self.0
|
1601 1911 | }
|
1912 + | /* ConstrainedCollectionGenerator.kt:116 */
|
1602 1913 | /// Consumes the value, returning the underlying [`::std::vec::Vec<bool>`].
|
1603 1914 | pub fn into_inner(self) -> ::std::vec::Vec<bool> {
|
1604 1915 | self.0
|
1605 1916 | }
|
1606 1917 |
|
1607 1918 | fn check_unique_items(
|
1608 1919 | items: ::std::vec::Vec<bool>,
|
1609 1920 | ) -> ::std::result::Result<::std::vec::Vec<bool>, crate::model::boolean_set::ConstraintViolation>
|
1610 1921 | {
|
1611 1922 | let mut seen = ::std::collections::HashMap::new();
|
1612 1923 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1613 1924 | for (idx, item) in items.iter().enumerate() {
|
1614 1925 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1615 1926 | duplicate_indices.push(prev_idx);
|
1616 1927 | }
|
1617 1928 | }
|
1618 1929 |
|
1619 1930 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1620 1931 | for idx in &duplicate_indices {
|
1621 1932 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1622 1933 | last_duplicate_indices.push(prev_idx);
|
1623 1934 | }
|
1624 1935 | }
|
1625 1936 | duplicate_indices.extend(last_duplicate_indices);
|
1626 1937 |
|
1627 1938 | if !duplicate_indices.is_empty() {
|
1628 1939 | debug_assert!(duplicate_indices.len() >= 2);
|
1629 1940 | Err(
|
1630 1941 | crate::model::boolean_set::ConstraintViolation::UniqueItems {
|
1631 1942 | duplicate_indices,
|
1632 1943 | original: items,
|
1633 1944 | },
|
1634 1945 | )
|
1635 1946 | } else {
|
1636 1947 | Ok(items)
|
1637 1948 | }
|
1638 1949 | }
|
1950 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1639 1951 | }
|
1952 + | /* ConstrainedCollectionGenerator.kt:133 */
|
1640 1953 | impl ::std::convert::TryFrom<::std::vec::Vec<bool>> for BooleanSet {
|
1641 1954 | type Error = crate::model::boolean_set::ConstraintViolation;
|
1642 1955 |
|
1643 1956 | /// Constructs a `BooleanSet` from an [`::std::vec::Vec<bool>`], failing when the provided value does not satisfy the modeled constraints.
|
1644 1957 | fn try_from(value: ::std::vec::Vec<bool>) -> ::std::result::Result<Self, Self::Error> {
|
1645 1958 | let value = Self::check_unique_items(value)?;
|
1646 1959 |
|
1647 1960 | Ok(Self(value))
|
1648 1961 | }
|
1649 1962 | }
|
1650 1963 |
|
1651 1964 | impl ::std::convert::From<BooleanSet> for ::std::vec::Vec<bool> {
|
1652 1965 | fn from(value: BooleanSet) -> Self {
|
1653 1966 | value.into_inner()
|
1654 1967 | }
|
1655 1968 | }
|
1969 + | /* ConstrainedCollectionGenerator.kt:181 */
|
1656 1970 | impl crate::constrained::Constrained for BooleanSet {
|
1657 1971 | type Unconstrained = crate::unconstrained::boolean_set_unconstrained::BooleanSetUnconstrained;
|
1658 1972 | }
|
1659 1973 |
|
1974 + | /* ConstrainedCollectionGenerator.kt:93 */
|
1660 1975 | #[allow(missing_docs)] // documentation missing in model
|
1661 - | ///
|
1976 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
1662 1977 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1663 1978 | /// [constraint traits]. Use [`BlobSet::try_from`] to construct values of this type.
|
1664 1979 | ///
|
1665 1980 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1666 1981 | ///
|
1982 + | /* RustType.kt:516 */
|
1667 1983 | #[derive(
|
1668 1984 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1669 1985 | )]
|
1670 - | pub struct BlobSet(pub(crate) ::std::vec::Vec<::aws_smithy_types::Blob>);
|
1986 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct BlobSet(
|
1987 + | pub(crate) ::std::vec::Vec<::aws_smithy_types::Blob>,
|
1988 + | );
|
1989 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1671 1990 | impl BlobSet {
|
1991 + | /* ConstrainedCollectionGenerator.kt:106 */
|
1672 1992 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::aws_smithy_types::Blob>`].
|
1673 1993 | pub fn inner(&self) -> &::std::vec::Vec<::aws_smithy_types::Blob> {
|
1674 1994 | &self.0
|
1675 1995 | }
|
1996 + | /* ConstrainedCollectionGenerator.kt:116 */
|
1676 1997 | /// Consumes the value, returning the underlying [`::std::vec::Vec<::aws_smithy_types::Blob>`].
|
1677 1998 | pub fn into_inner(self) -> ::std::vec::Vec<::aws_smithy_types::Blob> {
|
1678 1999 | self.0
|
1679 2000 | }
|
1680 2001 |
|
1681 2002 | fn check_unique_items(
|
1682 2003 | items: ::std::vec::Vec<::aws_smithy_types::Blob>,
|
1683 2004 | ) -> ::std::result::Result<
|
1684 2005 | ::std::vec::Vec<::aws_smithy_types::Blob>,
|
1685 2006 | crate::model::blob_set::ConstraintViolation,
|
1686 2007 | > {
|
1687 2008 | let mut seen = ::std::collections::HashMap::new();
|
1688 2009 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1689 2010 | for (idx, item) in items.iter().enumerate() {
|
1690 2011 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1691 2012 | duplicate_indices.push(prev_idx);
|
1692 2013 | }
|
1693 2014 | }
|
1694 2015 |
|
1695 2016 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1696 2017 | for idx in &duplicate_indices {
|
1697 2018 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1698 2019 | last_duplicate_indices.push(prev_idx);
|
1699 2020 | }
|
1700 2021 | }
|
1701 2022 | duplicate_indices.extend(last_duplicate_indices);
|
1702 2023 |
|
1703 2024 | if !duplicate_indices.is_empty() {
|
1704 2025 | debug_assert!(duplicate_indices.len() >= 2);
|
1705 2026 | Err(crate::model::blob_set::ConstraintViolation::UniqueItems {
|
1706 2027 | duplicate_indices,
|
1707 2028 | original: items,
|
1708 2029 | })
|
1709 2030 | } else {
|
1710 2031 | Ok(items)
|
1711 2032 | }
|
1712 2033 | }
|
2034 + | /* ConstrainedCollectionGenerator.kt:104 */
|
1713 2035 | }
|
2036 + | /* ConstrainedCollectionGenerator.kt:133 */
|
1714 2037 | impl ::std::convert::TryFrom<::std::vec::Vec<::aws_smithy_types::Blob>> for BlobSet {
|
1715 2038 | type Error = crate::model::blob_set::ConstraintViolation;
|
1716 2039 |
|
1717 2040 | /// Constructs a `BlobSet` from an [`::std::vec::Vec<::aws_smithy_types::Blob>`], failing when the provided value does not satisfy the modeled constraints.
|
1718 2041 | fn try_from(
|
1719 2042 | value: ::std::vec::Vec<::aws_smithy_types::Blob>,
|
1720 2043 | ) -> ::std::result::Result<Self, Self::Error> {
|
1721 2044 | let value = Self::check_unique_items(value)?;
|
1722 2045 |
|
1723 2046 | Ok(Self(value))
|
1724 2047 | }
|
1725 2048 | }
|
1726 2049 |
|
1727 2050 | impl ::std::convert::From<BlobSet> for ::std::vec::Vec<::aws_smithy_types::Blob> {
|
1728 2051 | fn from(value: BlobSet) -> Self {
|
1729 2052 | value.into_inner()
|
1730 2053 | }
|
1731 2054 | }
|
2055 + | /* ConstrainedCollectionGenerator.kt:181 */
|
1732 2056 | impl crate::constrained::Constrained for BlobSet {
|
1733 2057 | type Unconstrained = crate::unconstrained::blob_set_unconstrained::BlobSetUnconstrained;
|
1734 2058 | }
|
1735 2059 |
|
2060 + | /* ConstrainedNumberGenerator.kt:82 */
|
1736 2061 | #[allow(missing_docs)] // documentation missing in model
|
1737 - | ///
|
2062 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
1738 2063 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1739 2064 | /// [constraint traits]. Use [`MaxLong::try_from`] to construct values of this type.
|
1740 2065 | ///
|
1741 2066 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1742 2067 | ///
|
2068 + | /* RustType.kt:516 */
|
1743 2069 | #[derive(
|
1744 2070 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1745 2071 | )]
|
1746 - | pub struct MaxLong(pub(crate) i64);
|
2072 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct MaxLong(pub(crate) i64);
|
2073 + | /* ConstrainedNumberGenerator.kt:91 */
|
1747 2074 | impl MaxLong {
|
1748 2075 | /// Returns an immutable reference to the underlying [`i64`].
|
1749 2076 | pub fn inner(&self) -> &i64 {
|
1750 2077 | &self.0
|
1751 2078 | }
|
1752 2079 |
|
1753 2080 | /// Consumes the value, returning the underlying [`i64`].
|
1754 2081 | pub fn into_inner(self) -> i64 {
|
1755 2082 | self.0
|
1756 2083 | }
|
1757 2084 | }
|
1758 2085 |
|
1759 2086 | impl crate::constrained::Constrained for MaxLong {
|
1760 2087 | type Unconstrained = i64;
|
1761 2088 | }
|
1762 2089 |
|
1763 2090 | impl ::std::convert::From<i64> for crate::constrained::MaybeConstrained<crate::model::MaxLong> {
|
1764 2091 | fn from(value: i64) -> Self {
|
1765 2092 | Self::Unconstrained(value)
|
1766 2093 | }
|
1767 2094 | }
|
1768 2095 |
|
1769 2096 | impl ::std::fmt::Display for MaxLong {
|
1770 2097 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1771 2098 | self.0.fmt(f)
|
1772 2099 | }
|
1773 2100 | }
|
1774 2101 |
|
1775 2102 | impl ::std::convert::From<MaxLong> for i64 {
|
1776 2103 | fn from(value: MaxLong) -> Self {
|
1777 2104 | value.into_inner()
|
1778 2105 | }
|
1779 2106 | }
|
2107 + | /* TraitInfo.kt:41 */
|
1780 2108 | impl MaxLong {
|
1781 2109 | fn check_range(
|
1782 2110 | value: i64,
|
1783 2111 | ) -> ::std::result::Result<(), crate::model::max_long::ConstraintViolation> {
|
1784 2112 | if value <= 8 {
|
1785 2113 | Ok(())
|
1786 2114 | } else {
|
1787 2115 | Err(crate::model::max_long::ConstraintViolation::Range(value))
|
1788 2116 | }
|
1789 2117 | }
|
1790 2118 | }
|
2119 + | /* TraitInfo.kt:57 */
|
1791 2120 | impl ::std::convert::TryFrom<i64> for MaxLong {
|
1792 2121 | type Error = crate::model::max_long::ConstraintViolation;
|
1793 2122 |
|
1794 2123 | /// Constructs a `MaxLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
1795 2124 | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
1796 2125 | Self::check_range(value)?;
|
1797 2126 |
|
1798 2127 | Ok(Self(value))
|
1799 2128 | }
|
1800 2129 | }
|
1801 2130 |
|
2131 + | /* ConstrainedNumberGenerator.kt:82 */
|
1802 2132 | #[allow(missing_docs)] // documentation missing in model
|
1803 - | ///
|
2133 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
1804 2134 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1805 2135 | /// [constraint traits]. Use [`MinLong::try_from`] to construct values of this type.
|
1806 2136 | ///
|
1807 2137 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1808 2138 | ///
|
2139 + | /* RustType.kt:516 */
|
1809 2140 | #[derive(
|
1810 2141 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1811 2142 | )]
|
1812 - | pub struct MinLong(pub(crate) i64);
|
2143 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct MinLong(pub(crate) i64);
|
2144 + | /* ConstrainedNumberGenerator.kt:91 */
|
1813 2145 | impl MinLong {
|
1814 2146 | /// Returns an immutable reference to the underlying [`i64`].
|
1815 2147 | pub fn inner(&self) -> &i64 {
|
1816 2148 | &self.0
|
1817 2149 | }
|
1818 2150 |
|
1819 2151 | /// Consumes the value, returning the underlying [`i64`].
|
1820 2152 | pub fn into_inner(self) -> i64 {
|
1821 2153 | self.0
|
1822 2154 | }
|
1823 2155 | }
|
1824 2156 |
|
1825 2157 | impl crate::constrained::Constrained for MinLong {
|
1826 2158 | type Unconstrained = i64;
|
1827 2159 | }
|
1828 2160 |
|
1829 2161 | impl ::std::convert::From<i64> for crate::constrained::MaybeConstrained<crate::model::MinLong> {
|
1830 2162 | fn from(value: i64) -> Self {
|
1831 2163 | Self::Unconstrained(value)
|
1832 2164 | }
|
1833 2165 | }
|
1834 2166 |
|
1835 2167 | impl ::std::fmt::Display for MinLong {
|
1836 2168 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1837 2169 | self.0.fmt(f)
|
1838 2170 | }
|
1839 2171 | }
|
1840 2172 |
|
1841 2173 | impl ::std::convert::From<MinLong> for i64 {
|
1842 2174 | fn from(value: MinLong) -> Self {
|
1843 2175 | value.into_inner()
|
1844 2176 | }
|
1845 2177 | }
|
2178 + | /* TraitInfo.kt:41 */
|
1846 2179 | impl MinLong {
|
1847 2180 | fn check_range(
|
1848 2181 | value: i64,
|
1849 2182 | ) -> ::std::result::Result<(), crate::model::min_long::ConstraintViolation> {
|
1850 2183 | if 2 <= value {
|
1851 2184 | Ok(())
|
1852 2185 | } else {
|
1853 2186 | Err(crate::model::min_long::ConstraintViolation::Range(value))
|
1854 2187 | }
|
1855 2188 | }
|
1856 2189 | }
|
2190 + | /* TraitInfo.kt:57 */
|
1857 2191 | impl ::std::convert::TryFrom<i64> for MinLong {
|
1858 2192 | type Error = crate::model::min_long::ConstraintViolation;
|
1859 2193 |
|
1860 2194 | /// Constructs a `MinLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
1861 2195 | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
1862 2196 | Self::check_range(value)?;
|
1863 2197 |
|
1864 2198 | Ok(Self(value))
|
1865 2199 | }
|
1866 2200 | }
|
1867 2201 |
|
2202 + | /* ConstrainedNumberGenerator.kt:82 */
|
1868 2203 | #[allow(missing_docs)] // documentation missing in model
|
1869 - | ///
|
2204 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
1870 2205 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1871 2206 | /// [constraint traits]. Use [`RangeLong::try_from`] to construct values of this type.
|
1872 2207 | ///
|
1873 2208 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1874 2209 | ///
|
2210 + | /* RustType.kt:516 */
|
1875 2211 | #[derive(
|
1876 2212 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1877 2213 | )]
|
1878 - | pub struct RangeLong(pub(crate) i64);
|
2214 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct RangeLong(pub(crate) i64);
|
2215 + | /* ConstrainedNumberGenerator.kt:91 */
|
1879 2216 | impl RangeLong {
|
1880 2217 | /// Returns an immutable reference to the underlying [`i64`].
|
1881 2218 | pub fn inner(&self) -> &i64 {
|
1882 2219 | &self.0
|
1883 2220 | }
|
1884 2221 |
|
1885 2222 | /// Consumes the value, returning the underlying [`i64`].
|
1886 2223 | pub fn into_inner(self) -> i64 {
|
1887 2224 | self.0
|
1888 2225 | }
|
1889 2226 | }
|
1890 2227 |
|
1891 2228 | impl crate::constrained::Constrained for RangeLong {
|
1892 2229 | type Unconstrained = i64;
|
1893 2230 | }
|
1894 2231 |
|
1895 2232 | impl ::std::convert::From<i64> for crate::constrained::MaybeConstrained<crate::model::RangeLong> {
|
1896 2233 | fn from(value: i64) -> Self {
|
1897 2234 | Self::Unconstrained(value)
|
1898 2235 | }
|
1899 2236 | }
|
1900 2237 |
|
1901 2238 | impl ::std::fmt::Display for RangeLong {
|
1902 2239 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1903 2240 | self.0.fmt(f)
|
1904 2241 | }
|
1905 2242 | }
|
1906 2243 |
|
1907 2244 | impl ::std::convert::From<RangeLong> for i64 {
|
1908 2245 | fn from(value: RangeLong) -> Self {
|
1909 2246 | value.into_inner()
|
1910 2247 | }
|
1911 2248 | }
|
2249 + | /* TraitInfo.kt:41 */
|
1912 2250 | impl RangeLong {
|
1913 2251 | fn check_range(
|
1914 2252 | value: i64,
|
1915 2253 | ) -> ::std::result::Result<(), crate::model::range_long::ConstraintViolation> {
|
1916 2254 | if (2..=8).contains(&value) {
|
1917 2255 | Ok(())
|
1918 2256 | } else {
|
1919 2257 | Err(crate::model::range_long::ConstraintViolation::Range(value))
|
1920 2258 | }
|
1921 2259 | }
|
1922 2260 | }
|
2261 + | /* TraitInfo.kt:57 */
|
1923 2262 | impl ::std::convert::TryFrom<i64> for RangeLong {
|
1924 2263 | type Error = crate::model::range_long::ConstraintViolation;
|
1925 2264 |
|
1926 2265 | /// Constructs a `RangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
1927 2266 | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
1928 2267 | Self::check_range(value)?;
|
1929 2268 |
|
1930 2269 | Ok(Self(value))
|
1931 2270 | }
|
1932 2271 | }
|
1933 2272 |
|
2273 + | /* ConstrainedNumberGenerator.kt:82 */
|
1934 2274 | #[allow(missing_docs)] // documentation missing in model
|
1935 - | ///
|
2275 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
1936 2276 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1937 2277 | /// [constraint traits]. Use [`MaxInteger::try_from`] to construct values of this type.
|
1938 2278 | ///
|
1939 2279 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1940 2280 | ///
|
2281 + | /* RustType.kt:516 */
|
1941 2282 | #[derive(
|
1942 2283 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1943 2284 | )]
|
1944 - | pub struct MaxInteger(pub(crate) i32);
|
2285 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct MaxInteger(pub(crate) i32);
|
2286 + | /* ConstrainedNumberGenerator.kt:91 */
|
1945 2287 | impl MaxInteger {
|
1946 2288 | /// Returns an immutable reference to the underlying [`i32`].
|
1947 2289 | pub fn inner(&self) -> &i32 {
|
1948 2290 | &self.0
|
1949 2291 | }
|
1950 2292 |
|
1951 2293 | /// Consumes the value, returning the underlying [`i32`].
|
1952 2294 | pub fn into_inner(self) -> i32 {
|
1953 2295 | self.0
|
1954 2296 | }
|
1955 2297 | }
|
1956 2298 |
|
1957 2299 | impl crate::constrained::Constrained for MaxInteger {
|
1958 2300 | type Unconstrained = i32;
|
1959 2301 | }
|
1960 2302 |
|
1961 2303 | impl ::std::convert::From<i32> for crate::constrained::MaybeConstrained<crate::model::MaxInteger> {
|
1962 2304 | fn from(value: i32) -> Self {
|
1963 2305 | Self::Unconstrained(value)
|
1964 2306 | }
|
1965 2307 | }
|
1966 2308 |
|
1967 2309 | impl ::std::fmt::Display for MaxInteger {
|
1968 2310 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1969 2311 | self.0.fmt(f)
|
1970 2312 | }
|
1971 2313 | }
|
1972 2314 |
|
1973 2315 | impl ::std::convert::From<MaxInteger> for i32 {
|
1974 2316 | fn from(value: MaxInteger) -> Self {
|
1975 2317 | value.into_inner()
|
1976 2318 | }
|
1977 2319 | }
|
2320 + | /* TraitInfo.kt:41 */
|
1978 2321 | impl MaxInteger {
|
1979 2322 | fn check_range(
|
1980 2323 | value: i32,
|
1981 2324 | ) -> ::std::result::Result<(), crate::model::max_integer::ConstraintViolation> {
|
1982 2325 | if value <= 8 {
|
1983 2326 | Ok(())
|
1984 2327 | } else {
|
1985 2328 | Err(crate::model::max_integer::ConstraintViolation::Range(value))
|
1986 2329 | }
|
1987 2330 | }
|
1988 2331 | }
|
2332 + | /* TraitInfo.kt:57 */
|
1989 2333 | impl ::std::convert::TryFrom<i32> for MaxInteger {
|
1990 2334 | type Error = crate::model::max_integer::ConstraintViolation;
|
1991 2335 |
|
1992 2336 | /// Constructs a `MaxInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
1993 2337 | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
1994 2338 | Self::check_range(value)?;
|
1995 2339 |
|
1996 2340 | Ok(Self(value))
|
1997 2341 | }
|
1998 2342 | }
|
1999 2343 |
|
2344 + | /* ConstrainedNumberGenerator.kt:82 */
|
2000 2345 | #[allow(missing_docs)] // documentation missing in model
|
2001 - | ///
|
2346 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
2002 2347 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2003 2348 | /// [constraint traits]. Use [`MinInteger::try_from`] to construct values of this type.
|
2004 2349 | ///
|
2005 2350 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2006 2351 | ///
|
2352 + | /* RustType.kt:516 */
|
2007 2353 | #[derive(
|
2008 2354 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2009 2355 | )]
|
2010 - | pub struct MinInteger(pub(crate) i32);
|
2356 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct MinInteger(pub(crate) i32);
|
2357 + | /* ConstrainedNumberGenerator.kt:91 */
|
2011 2358 | impl MinInteger {
|
2012 2359 | /// Returns an immutable reference to the underlying [`i32`].
|
2013 2360 | pub fn inner(&self) -> &i32 {
|
2014 2361 | &self.0
|
2015 2362 | }
|
2016 2363 |
|
2017 2364 | /// Consumes the value, returning the underlying [`i32`].
|
2018 2365 | pub fn into_inner(self) -> i32 {
|
2019 2366 | self.0
|
2020 2367 | }
|
2021 2368 | }
|
2022 2369 |
|
2023 2370 | impl crate::constrained::Constrained for MinInteger {
|
2024 2371 | type Unconstrained = i32;
|
2025 2372 | }
|
2026 2373 |
|
2027 2374 | impl ::std::convert::From<i32> for crate::constrained::MaybeConstrained<crate::model::MinInteger> {
|
2028 2375 | fn from(value: i32) -> Self {
|
2029 2376 | Self::Unconstrained(value)
|
2030 2377 | }
|
2031 2378 | }
|
2032 2379 |
|
2033 2380 | impl ::std::fmt::Display for MinInteger {
|
2034 2381 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2035 2382 | self.0.fmt(f)
|
2036 2383 | }
|
2037 2384 | }
|
2038 2385 |
|
2039 2386 | impl ::std::convert::From<MinInteger> for i32 {
|
2040 2387 | fn from(value: MinInteger) -> Self {
|
2041 2388 | value.into_inner()
|
2042 2389 | }
|
2043 2390 | }
|
2391 + | /* TraitInfo.kt:41 */
|
2044 2392 | impl MinInteger {
|
2045 2393 | fn check_range(
|
2046 2394 | value: i32,
|
2047 2395 | ) -> ::std::result::Result<(), crate::model::min_integer::ConstraintViolation> {
|
2048 2396 | if 2 <= value {
|
2049 2397 | Ok(())
|
2050 2398 | } else {
|
2051 2399 | Err(crate::model::min_integer::ConstraintViolation::Range(value))
|
2052 2400 | }
|
2053 2401 | }
|
2054 2402 | }
|
2403 + | /* TraitInfo.kt:57 */
|
2055 2404 | impl ::std::convert::TryFrom<i32> for MinInteger {
|
2056 2405 | type Error = crate::model::min_integer::ConstraintViolation;
|
2057 2406 |
|
2058 2407 | /// Constructs a `MinInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2059 2408 | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2060 2409 | Self::check_range(value)?;
|
2061 2410 |
|
2062 2411 | Ok(Self(value))
|
2063 2412 | }
|
2064 2413 | }
|
2065 2414 |
|
2415 + | /* ConstrainedNumberGenerator.kt:82 */
|
2066 2416 | #[allow(missing_docs)] // documentation missing in model
|
2067 - | ///
|
2417 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
2068 2418 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2069 2419 | /// [constraint traits]. Use [`RangeInteger::try_from`] to construct values of this type.
|
2070 2420 | ///
|
2071 2421 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2072 2422 | ///
|
2423 + | /* RustType.kt:516 */
|
2073 2424 | #[derive(
|
2074 2425 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2075 2426 | )]
|
2076 - | pub struct RangeInteger(pub(crate) i32);
|
2427 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct RangeInteger(pub(crate) i32);
|
2428 + | /* ConstrainedNumberGenerator.kt:91 */
|
2077 2429 | impl RangeInteger {
|
2078 2430 | /// Returns an immutable reference to the underlying [`i32`].
|
2079 2431 | pub fn inner(&self) -> &i32 {
|
2080 2432 | &self.0
|
2081 2433 | }
|
2082 2434 |
|
2083 2435 | /// Consumes the value, returning the underlying [`i32`].
|
2084 2436 | pub fn into_inner(self) -> i32 {
|
2085 2437 | self.0
|
2086 2438 | }
|
2087 2439 | }
|
2088 2440 |
|
2089 2441 | impl crate::constrained::Constrained for RangeInteger {
|
2090 2442 | type Unconstrained = i32;
|
2091 2443 | }
|
2092 2444 |
|
2093 2445 | impl ::std::convert::From<i32>
|
2094 2446 | for crate::constrained::MaybeConstrained<crate::model::RangeInteger>
|
2095 2447 | {
|
2096 2448 | fn from(value: i32) -> Self {
|
2097 2449 | Self::Unconstrained(value)
|
2098 2450 | }
|
2099 2451 | }
|
2100 2452 |
|
2101 2453 | impl ::std::fmt::Display for RangeInteger {
|
2102 2454 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2103 2455 | self.0.fmt(f)
|
2104 2456 | }
|
2105 2457 | }
|
2106 2458 |
|
2107 2459 | impl ::std::convert::From<RangeInteger> for i32 {
|
2108 2460 | fn from(value: RangeInteger) -> Self {
|
2109 2461 | value.into_inner()
|
2110 2462 | }
|
2111 2463 | }
|
2464 + | /* TraitInfo.kt:41 */
|
2112 2465 | impl RangeInteger {
|
2113 2466 | fn check_range(
|
2114 2467 | value: i32,
|
2115 2468 | ) -> ::std::result::Result<(), crate::model::range_integer::ConstraintViolation> {
|
2116 2469 | if (2..=8).contains(&value) {
|
2117 2470 | Ok(())
|
2118 2471 | } else {
|
2119 2472 | Err(crate::model::range_integer::ConstraintViolation::Range(
|
2120 2473 | value,
|
2121 2474 | ))
|
2122 2475 | }
|
2123 2476 | }
|
2124 2477 | }
|
2478 + | /* TraitInfo.kt:57 */
|
2125 2479 | impl ::std::convert::TryFrom<i32> for RangeInteger {
|
2126 2480 | type Error = crate::model::range_integer::ConstraintViolation;
|
2127 2481 |
|
2128 2482 | /// Constructs a `RangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2129 2483 | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2130 2484 | Self::check_range(value)?;
|
2131 2485 |
|
2132 2486 | Ok(Self(value))
|
2133 2487 | }
|
2134 2488 | }
|
2135 2489 |
|
2490 + | /* ConstrainedNumberGenerator.kt:82 */
|
2136 2491 | #[allow(missing_docs)] // documentation missing in model
|
2137 - | ///
|
2492 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
2138 2493 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2139 2494 | /// [constraint traits]. Use [`MaxShort::try_from`] to construct values of this type.
|
2140 2495 | ///
|
2141 2496 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2142 2497 | ///
|
2498 + | /* RustType.kt:516 */
|
2143 2499 | #[derive(
|
2144 2500 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2145 2501 | )]
|
2146 - | pub struct MaxShort(pub(crate) i16);
|
2502 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct MaxShort(pub(crate) i16);
|
2503 + | /* ConstrainedNumberGenerator.kt:91 */
|
2147 2504 | impl MaxShort {
|
2148 2505 | /// Returns an immutable reference to the underlying [`i16`].
|
2149 2506 | pub fn inner(&self) -> &i16 {
|
2150 2507 | &self.0
|
2151 2508 | }
|
2152 2509 |
|
2153 2510 | /// Consumes the value, returning the underlying [`i16`].
|
2154 2511 | pub fn into_inner(self) -> i16 {
|
2155 2512 | self.0
|
2156 2513 | }
|
2157 2514 | }
|
2158 2515 |
|
2159 2516 | impl crate::constrained::Constrained for MaxShort {
|
2160 2517 | type Unconstrained = i16;
|
2161 2518 | }
|
2162 2519 |
|
2163 2520 | impl ::std::convert::From<i16> for crate::constrained::MaybeConstrained<crate::model::MaxShort> {
|
2164 2521 | fn from(value: i16) -> Self {
|
2165 2522 | Self::Unconstrained(value)
|
2166 2523 | }
|
2167 2524 | }
|
2168 2525 |
|
2169 2526 | impl ::std::fmt::Display for MaxShort {
|
2170 2527 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2171 2528 | self.0.fmt(f)
|
2172 2529 | }
|
2173 2530 | }
|
2174 2531 |
|
2175 2532 | impl ::std::convert::From<MaxShort> for i16 {
|
2176 2533 | fn from(value: MaxShort) -> Self {
|
2177 2534 | value.into_inner()
|
2178 2535 | }
|
2179 2536 | }
|
2537 + | /* TraitInfo.kt:41 */
|
2180 2538 | impl MaxShort {
|
2181 2539 | fn check_range(
|
2182 2540 | value: i16,
|
2183 2541 | ) -> ::std::result::Result<(), crate::model::max_short::ConstraintViolation> {
|
2184 2542 | if value <= 8 {
|
2185 2543 | Ok(())
|
2186 2544 | } else {
|
2187 2545 | Err(crate::model::max_short::ConstraintViolation::Range(value))
|
2188 2546 | }
|
2189 2547 | }
|
2190 2548 | }
|
2549 + | /* TraitInfo.kt:57 */
|
2191 2550 | impl ::std::convert::TryFrom<i16> for MaxShort {
|
2192 2551 | type Error = crate::model::max_short::ConstraintViolation;
|
2193 2552 |
|
2194 2553 | /// Constructs a `MaxShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
2195 2554 | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
2196 2555 | Self::check_range(value)?;
|
2197 2556 |
|
2198 2557 | Ok(Self(value))
|
2199 2558 | }
|
2200 2559 | }
|
2201 2560 |
|
2561 + | /* ConstrainedNumberGenerator.kt:82 */
|
2202 2562 | #[allow(missing_docs)] // documentation missing in model
|
2203 - | ///
|
2563 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
2204 2564 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2205 2565 | /// [constraint traits]. Use [`MinShort::try_from`] to construct values of this type.
|
2206 2566 | ///
|
2207 2567 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2208 2568 | ///
|
2569 + | /* RustType.kt:516 */
|
2209 2570 | #[derive(
|
2210 2571 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2211 2572 | )]
|
2212 - | pub struct MinShort(pub(crate) i16);
|
2573 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct MinShort(pub(crate) i16);
|
2574 + | /* ConstrainedNumberGenerator.kt:91 */
|
2213 2575 | impl MinShort {
|
2214 2576 | /// Returns an immutable reference to the underlying [`i16`].
|
2215 2577 | pub fn inner(&self) -> &i16 {
|
2216 2578 | &self.0
|
2217 2579 | }
|
2218 2580 |
|
2219 2581 | /// Consumes the value, returning the underlying [`i16`].
|
2220 2582 | pub fn into_inner(self) -> i16 {
|
2221 2583 | self.0
|
2222 2584 | }
|
2223 2585 | }
|
2224 2586 |
|
2225 2587 | impl crate::constrained::Constrained for MinShort {
|
2226 2588 | type Unconstrained = i16;
|
2227 2589 | }
|
2228 2590 |
|
2229 2591 | impl ::std::convert::From<i16> for crate::constrained::MaybeConstrained<crate::model::MinShort> {
|
2230 2592 | fn from(value: i16) -> Self {
|
2231 2593 | Self::Unconstrained(value)
|
2232 2594 | }
|
2233 2595 | }
|
2234 2596 |
|
2235 2597 | impl ::std::fmt::Display for MinShort {
|
2236 2598 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2237 2599 | self.0.fmt(f)
|
2238 2600 | }
|
2239 2601 | }
|
2240 2602 |
|
2241 2603 | impl ::std::convert::From<MinShort> for i16 {
|
2242 2604 | fn from(value: MinShort) -> Self {
|
2243 2605 | value.into_inner()
|
2244 2606 | }
|
2245 2607 | }
|
2608 + | /* TraitInfo.kt:41 */
|
2246 2609 | impl MinShort {
|
2247 2610 | fn check_range(
|
2248 2611 | value: i16,
|
2249 2612 | ) -> ::std::result::Result<(), crate::model::min_short::ConstraintViolation> {
|
2250 2613 | if 2 <= value {
|
2251 2614 | Ok(())
|
2252 2615 | } else {
|
2253 2616 | Err(crate::model::min_short::ConstraintViolation::Range(value))
|
2254 2617 | }
|
2255 2618 | }
|
2256 2619 | }
|
2620 + | /* TraitInfo.kt:57 */
|
2257 2621 | impl ::std::convert::TryFrom<i16> for MinShort {
|
2258 2622 | type Error = crate::model::min_short::ConstraintViolation;
|
2259 2623 |
|
2260 2624 | /// Constructs a `MinShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
2261 2625 | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
2262 2626 | Self::check_range(value)?;
|
2263 2627 |
|
2264 2628 | Ok(Self(value))
|
2265 2629 | }
|
2266 2630 | }
|
2267 2631 |
|
2632 + | /* ConstrainedNumberGenerator.kt:82 */
|
2268 2633 | #[allow(missing_docs)] // documentation missing in model
|
2269 - | ///
|
2634 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
2270 2635 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2271 2636 | /// [constraint traits]. Use [`RangeShort::try_from`] to construct values of this type.
|
2272 2637 | ///
|
2273 2638 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2274 2639 | ///
|
2640 + | /* RustType.kt:516 */
|
2275 2641 | #[derive(
|
2276 2642 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2277 2643 | )]
|
2278 - | pub struct RangeShort(pub(crate) i16);
|
2644 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct RangeShort(pub(crate) i16);
|
2645 + | /* ConstrainedNumberGenerator.kt:91 */
|
2279 2646 | impl RangeShort {
|
2280 2647 | /// Returns an immutable reference to the underlying [`i16`].
|
2281 2648 | pub fn inner(&self) -> &i16 {
|
2282 2649 | &self.0
|
2283 2650 | }
|
2284 2651 |
|
2285 2652 | /// Consumes the value, returning the underlying [`i16`].
|
2286 2653 | pub fn into_inner(self) -> i16 {
|
2287 2654 | self.0
|
2288 2655 | }
|
2289 2656 | }
|
2290 2657 |
|
2291 2658 | impl crate::constrained::Constrained for RangeShort {
|
2292 2659 | type Unconstrained = i16;
|
2293 2660 | }
|
2294 2661 |
|
2295 2662 | impl ::std::convert::From<i16> for crate::constrained::MaybeConstrained<crate::model::RangeShort> {
|
2296 2663 | fn from(value: i16) -> Self {
|
2297 2664 | Self::Unconstrained(value)
|
2298 2665 | }
|
2299 2666 | }
|
2300 2667 |
|
2301 2668 | impl ::std::fmt::Display for RangeShort {
|
2302 2669 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2303 2670 | self.0.fmt(f)
|
2304 2671 | }
|
2305 2672 | }
|
2306 2673 |
|
2307 2674 | impl ::std::convert::From<RangeShort> for i16 {
|
2308 2675 | fn from(value: RangeShort) -> Self {
|
2309 2676 | value.into_inner()
|
2310 2677 | }
|
2311 2678 | }
|
2679 + | /* TraitInfo.kt:41 */
|
2312 2680 | impl RangeShort {
|
2313 2681 | fn check_range(
|
2314 2682 | value: i16,
|
2315 2683 | ) -> ::std::result::Result<(), crate::model::range_short::ConstraintViolation> {
|
2316 2684 | if (2..=8).contains(&value) {
|
2317 2685 | Ok(())
|
2318 2686 | } else {
|
2319 2687 | Err(crate::model::range_short::ConstraintViolation::Range(value))
|
2320 2688 | }
|
2321 2689 | }
|
2322 2690 | }
|
2691 + | /* TraitInfo.kt:57 */
|
2323 2692 | impl ::std::convert::TryFrom<i16> for RangeShort {
|
2324 2693 | type Error = crate::model::range_short::ConstraintViolation;
|
2325 2694 |
|
2326 2695 | /// Constructs a `RangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
2327 2696 | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
2328 2697 | Self::check_range(value)?;
|
2329 2698 |
|
2330 2699 | Ok(Self(value))
|
2331 2700 | }
|
2332 2701 | }
|
2333 2702 |
|
2703 + | /* ConstrainedNumberGenerator.kt:82 */
|
2334 2704 | #[allow(missing_docs)] // documentation missing in model
|
2335 - | ///
|
2705 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
2336 2706 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2337 2707 | /// [constraint traits]. Use [`MaxByte::try_from`] to construct values of this type.
|
2338 2708 | ///
|
2339 2709 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2340 2710 | ///
|
2711 + | /* RustType.kt:516 */
|
2341 2712 | #[derive(
|
2342 2713 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2343 2714 | )]
|
2344 - | pub struct MaxByte(pub(crate) i8);
|
2715 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct MaxByte(pub(crate) i8);
|
2716 + | /* ConstrainedNumberGenerator.kt:91 */
|
2345 2717 | impl MaxByte {
|
2346 2718 | /// Returns an immutable reference to the underlying [`i8`].
|
2347 2719 | pub fn inner(&self) -> &i8 {
|
2348 2720 | &self.0
|
2349 2721 | }
|
2350 2722 |
|
2351 2723 | /// Consumes the value, returning the underlying [`i8`].
|
2352 2724 | pub fn into_inner(self) -> i8 {
|
2353 2725 | self.0
|
2354 2726 | }
|
2355 2727 | }
|
2356 2728 |
|
2357 2729 | impl crate::constrained::Constrained for MaxByte {
|
2358 2730 | type Unconstrained = i8;
|
2359 2731 | }
|
2360 2732 |
|
2361 2733 | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MaxByte> {
|
2362 2734 | fn from(value: i8) -> Self {
|
2363 2735 | Self::Unconstrained(value)
|
2364 2736 | }
|
2365 2737 | }
|
2366 2738 |
|
2367 2739 | impl ::std::fmt::Display for MaxByte {
|
2368 2740 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2369 2741 | self.0.fmt(f)
|
2370 2742 | }
|
2371 2743 | }
|
2372 2744 |
|
2373 2745 | impl ::std::convert::From<MaxByte> for i8 {
|
2374 2746 | fn from(value: MaxByte) -> Self {
|
2375 2747 | value.into_inner()
|
2376 2748 | }
|
2377 2749 | }
|
2750 + | /* TraitInfo.kt:41 */
|
2378 2751 | impl MaxByte {
|
2379 2752 | fn check_range(
|
2380 2753 | value: i8,
|
2381 2754 | ) -> ::std::result::Result<(), crate::model::max_byte::ConstraintViolation> {
|
2382 2755 | if value <= 8 {
|
2383 2756 | Ok(())
|
2384 2757 | } else {
|
2385 2758 | Err(crate::model::max_byte::ConstraintViolation::Range(value))
|
2386 2759 | }
|
2387 2760 | }
|
2388 2761 | }
|
2762 + | /* TraitInfo.kt:57 */
|
2389 2763 | impl ::std::convert::TryFrom<i8> for MaxByte {
|
2390 2764 | type Error = crate::model::max_byte::ConstraintViolation;
|
2391 2765 |
|
2392 2766 | /// Constructs a `MaxByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
2393 2767 | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
2394 2768 | Self::check_range(value)?;
|
2395 2769 |
|
2396 2770 | Ok(Self(value))
|
2397 2771 | }
|
2398 2772 | }
|
2399 2773 |
|
2774 + | /* ConstrainedNumberGenerator.kt:82 */
|
2400 2775 | #[allow(missing_docs)] // documentation missing in model
|
2401 - | ///
|
2776 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
2402 2777 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2403 2778 | /// [constraint traits]. Use [`MinByte::try_from`] to construct values of this type.
|
2404 2779 | ///
|
2405 2780 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2406 2781 | ///
|
2782 + | /* RustType.kt:516 */
|
2407 2783 | #[derive(
|
2408 2784 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2409 2785 | )]
|
2410 - | pub struct MinByte(pub(crate) i8);
|
2786 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct MinByte(pub(crate) i8);
|
2787 + | /* ConstrainedNumberGenerator.kt:91 */
|
2411 2788 | impl MinByte {
|
2412 2789 | /// Returns an immutable reference to the underlying [`i8`].
|
2413 2790 | pub fn inner(&self) -> &i8 {
|
2414 2791 | &self.0
|
2415 2792 | }
|
2416 2793 |
|
2417 2794 | /// Consumes the value, returning the underlying [`i8`].
|
2418 2795 | pub fn into_inner(self) -> i8 {
|
2419 2796 | self.0
|
2420 2797 | }
|
2421 2798 | }
|
2422 2799 |
|
2423 2800 | impl crate::constrained::Constrained for MinByte {
|
2424 2801 | type Unconstrained = i8;
|
2425 2802 | }
|
2426 2803 |
|
2427 2804 | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MinByte> {
|
2428 2805 | fn from(value: i8) -> Self {
|
2429 2806 | Self::Unconstrained(value)
|
2430 2807 | }
|
2431 2808 | }
|
2432 2809 |
|
2433 2810 | impl ::std::fmt::Display for MinByte {
|
2434 2811 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2435 2812 | self.0.fmt(f)
|
2436 2813 | }
|
2437 2814 | }
|
2438 2815 |
|
2439 2816 | impl ::std::convert::From<MinByte> for i8 {
|
2440 2817 | fn from(value: MinByte) -> Self {
|
2441 2818 | value.into_inner()
|
2442 2819 | }
|
2443 2820 | }
|
2821 + | /* TraitInfo.kt:41 */
|
2444 2822 | impl MinByte {
|
2445 2823 | fn check_range(
|
2446 2824 | value: i8,
|
2447 2825 | ) -> ::std::result::Result<(), crate::model::min_byte::ConstraintViolation> {
|
2448 2826 | if 2 <= value {
|
2449 2827 | Ok(())
|
2450 2828 | } else {
|
2451 2829 | Err(crate::model::min_byte::ConstraintViolation::Range(value))
|
2452 2830 | }
|
2453 2831 | }
|
2454 2832 | }
|
2833 + | /* TraitInfo.kt:57 */
|
2455 2834 | impl ::std::convert::TryFrom<i8> for MinByte {
|
2456 2835 | type Error = crate::model::min_byte::ConstraintViolation;
|
2457 2836 |
|
2458 2837 | /// Constructs a `MinByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
2459 2838 | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
2460 2839 | Self::check_range(value)?;
|
2461 2840 |
|
2462 2841 | Ok(Self(value))
|
2463 2842 | }
|
2464 2843 | }
|
2465 2844 |
|
2845 + | /* ConstrainedNumberGenerator.kt:82 */
|
2466 2846 | #[allow(missing_docs)] // documentation missing in model
|
2467 - | ///
|
2847 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
2468 2848 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2469 2849 | /// [constraint traits]. Use [`RangeByte::try_from`] to construct values of this type.
|
2470 2850 | ///
|
2471 2851 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2472 2852 | ///
|
2853 + | /* RustType.kt:516 */
|
2473 2854 | #[derive(
|
2474 2855 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2475 2856 | )]
|
2476 - | pub struct RangeByte(pub(crate) i8);
|
2857 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct RangeByte(pub(crate) i8);
|
2858 + | /* ConstrainedNumberGenerator.kt:91 */
|
2477 2859 | impl RangeByte {
|
2478 2860 | /// Returns an immutable reference to the underlying [`i8`].
|
2479 2861 | pub fn inner(&self) -> &i8 {
|
2480 2862 | &self.0
|
2481 2863 | }
|
2482 2864 |
|
2483 2865 | /// Consumes the value, returning the underlying [`i8`].
|
2484 2866 | pub fn into_inner(self) -> i8 {
|
2485 2867 | self.0
|
2486 2868 | }
|
2487 2869 | }
|
2488 2870 |
|
2489 2871 | impl crate::constrained::Constrained for RangeByte {
|
2490 2872 | type Unconstrained = i8;
|
2491 2873 | }
|
2492 2874 |
|
2493 2875 | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::RangeByte> {
|
2494 2876 | fn from(value: i8) -> Self {
|
2495 2877 | Self::Unconstrained(value)
|
2496 2878 | }
|
2497 2879 | }
|
2498 2880 |
|
2499 2881 | impl ::std::fmt::Display for RangeByte {
|
2500 2882 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2501 2883 | self.0.fmt(f)
|
2502 2884 | }
|
2503 2885 | }
|
2504 2886 |
|
2505 2887 | impl ::std::convert::From<RangeByte> for i8 {
|
2506 2888 | fn from(value: RangeByte) -> Self {
|
2507 2889 | value.into_inner()
|
2508 2890 | }
|
2509 2891 | }
|
2892 + | /* TraitInfo.kt:41 */
|
2510 2893 | impl RangeByte {
|
2511 2894 | fn check_range(
|
2512 2895 | value: i8,
|
2513 2896 | ) -> ::std::result::Result<(), crate::model::range_byte::ConstraintViolation> {
|
2514 2897 | if (2..=8).contains(&value) {
|
2515 2898 | Ok(())
|
2516 2899 | } else {
|
2517 2900 | Err(crate::model::range_byte::ConstraintViolation::Range(value))
|
2518 2901 | }
|
2519 2902 | }
|
2520 2903 | }
|
2904 + | /* TraitInfo.kt:57 */
|
2521 2905 | impl ::std::convert::TryFrom<i8> for RangeByte {
|
2522 2906 | type Error = crate::model::range_byte::ConstraintViolation;
|
2523 2907 |
|
2524 2908 | /// Constructs a `RangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
2525 2909 | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
2526 2910 | Self::check_range(value)?;
|
2527 2911 |
|
2528 2912 | Ok(Self(value))
|
2529 2913 | }
|
2530 2914 | }
|
2531 2915 |
|
2916 + | /* UnionGenerator.kt:67 */
|
2532 2917 | #[allow(missing_docs)] // documentation missing in model
|
2918 + | /* RustType.kt:516 */
|
2533 2919 | #[derive(
|
2534 2920 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2535 2921 | )]
|
2536 - | pub enum PatternUnionOverride {
|
2922 + | pub /* UnionGenerator.kt:85 */ enum PatternUnionOverride {
|
2923 + | /* UnionGenerator.kt:90 */
|
2537 2924 | #[allow(missing_docs)] // documentation missing in model
|
2925 + | /* UnionGenerator.kt:190 */
|
2538 2926 | First(crate::model::pattern_union_override::First),
|
2927 + | /* UnionGenerator.kt:90 */
|
2539 2928 | #[allow(missing_docs)] // documentation missing in model
|
2929 + | /* UnionGenerator.kt:190 */
|
2540 2930 | Second(crate::model::pattern_union_override::Second),
|
2931 + | /* UnionGenerator.kt:85 */
|
2541 2932 | }
|
2933 + | /* UnionGenerator.kt:111 */
|
2542 2934 | impl PatternUnionOverride {
|
2935 + | /* UnionGenerator.kt:217 */
|
2543 2936 | /// Tries to convert the enum instance into [`First`](crate::model::PatternUnionOverride::First), extracting the inner [`First`](crate::model::pattern_union_override::First).
|
2937 + | /* UnionGenerator.kt:222 */
|
2544 2938 | /// Returns `Err(&Self)` if it can't be converted.
|
2939 + | /* UnionGenerator.kt:223 */
|
2545 2940 | pub fn as_first(
|
2546 2941 | &self,
|
2547 2942 | ) -> ::std::result::Result<&crate::model::pattern_union_override::First, &Self> {
|
2943 + | /* UnionGenerator.kt:227 */
|
2548 2944 | if let PatternUnionOverride::First(val) = &self {
|
2549 2945 | ::std::result::Result::Ok(val)
|
2550 2946 | } else {
|
2551 2947 | ::std::result::Result::Err(self)
|
2552 2948 | }
|
2949 + | /* UnionGenerator.kt:223 */
|
2553 2950 | }
|
2951 + | /* UnionGenerator.kt:121 */
|
2554 2952 | /// Returns true if this is a [`First`](crate::model::PatternUnionOverride::First).
|
2953 + | /* UnionGenerator.kt:122 */
|
2555 2954 | pub fn is_first(&self) -> bool {
|
2955 + | /* UnionGenerator.kt:123 */
|
2556 2956 | self.as_first().is_ok()
|
2957 + | /* UnionGenerator.kt:122 */
|
2557 2958 | }
|
2959 + | /* UnionGenerator.kt:217 */
|
2558 2960 | /// Tries to convert the enum instance into [`Second`](crate::model::PatternUnionOverride::Second), extracting the inner [`Second`](crate::model::pattern_union_override::Second).
|
2961 + | /* UnionGenerator.kt:222 */
|
2559 2962 | /// Returns `Err(&Self)` if it can't be converted.
|
2963 + | /* UnionGenerator.kt:223 */
|
2560 2964 | pub fn as_second(
|
2561 2965 | &self,
|
2562 2966 | ) -> ::std::result::Result<&crate::model::pattern_union_override::Second, &Self> {
|
2967 + | /* UnionGenerator.kt:227 */
|
2563 2968 | if let PatternUnionOverride::Second(val) = &self {
|
2564 2969 | ::std::result::Result::Ok(val)
|
2565 2970 | } else {
|
2566 2971 | ::std::result::Result::Err(self)
|
2567 2972 | }
|
2973 + | /* UnionGenerator.kt:223 */
|
2568 2974 | }
|
2975 + | /* UnionGenerator.kt:121 */
|
2569 2976 | /// Returns true if this is a [`Second`](crate::model::PatternUnionOverride::Second).
|
2977 + | /* UnionGenerator.kt:122 */
|
2570 2978 | pub fn is_second(&self) -> bool {
|
2979 + | /* UnionGenerator.kt:123 */
|
2571 2980 | self.as_second().is_ok()
|
2981 + | /* UnionGenerator.kt:122 */
|
2572 2982 | }
|
2983 + | /* UnionGenerator.kt:111 */
|
2573 2984 | }
|
2574 2985 |
|
2986 + | /* UnionGenerator.kt:67 */
|
2575 2987 | #[allow(missing_docs)] // documentation missing in model
|
2988 + | /* RustType.kt:516 */
|
2576 2989 | #[derive(
|
2577 2990 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2578 2991 | )]
|
2579 - | pub enum PatternUnion {
|
2992 + | pub /* UnionGenerator.kt:85 */ enum PatternUnion {
|
2993 + | /* UnionGenerator.kt:90 */
|
2580 2994 | #[allow(missing_docs)] // documentation missing in model
|
2995 + | /* UnionGenerator.kt:190 */
|
2581 2996 | First(crate::model::PatternString),
|
2997 + | /* UnionGenerator.kt:90 */
|
2582 2998 | #[allow(missing_docs)] // documentation missing in model
|
2999 + | /* UnionGenerator.kt:190 */
|
2583 3000 | Second(crate::model::PatternString),
|
3001 + | /* UnionGenerator.kt:85 */
|
2584 3002 | }
|
3003 + | /* UnionGenerator.kt:111 */
|
2585 3004 | impl PatternUnion {
|
3005 + | /* UnionGenerator.kt:217 */
|
2586 3006 | /// Tries to convert the enum instance into [`First`](crate::model::PatternUnion::First), extracting the inner [`PatternString`](crate::model::PatternString).
|
3007 + | /* UnionGenerator.kt:222 */
|
2587 3008 | /// Returns `Err(&Self)` if it can't be converted.
|
3009 + | /* UnionGenerator.kt:223 */
|
2588 3010 | pub fn as_first(&self) -> ::std::result::Result<&crate::model::PatternString, &Self> {
|
3011 + | /* UnionGenerator.kt:227 */
|
2589 3012 | if let PatternUnion::First(val) = &self {
|
2590 3013 | ::std::result::Result::Ok(val)
|
2591 3014 | } else {
|
2592 3015 | ::std::result::Result::Err(self)
|
2593 3016 | }
|
3017 + | /* UnionGenerator.kt:223 */
|
2594 3018 | }
|
3019 + | /* UnionGenerator.kt:121 */
|
2595 3020 | /// Returns true if this is a [`First`](crate::model::PatternUnion::First).
|
3021 + | /* UnionGenerator.kt:122 */
|
2596 3022 | pub fn is_first(&self) -> bool {
|
3023 + | /* UnionGenerator.kt:123 */
|
2597 3024 | self.as_first().is_ok()
|
3025 + | /* UnionGenerator.kt:122 */
|
2598 3026 | }
|
3027 + | /* UnionGenerator.kt:217 */
|
2599 3028 | /// Tries to convert the enum instance into [`Second`](crate::model::PatternUnion::Second), extracting the inner [`PatternString`](crate::model::PatternString).
|
3029 + | /* UnionGenerator.kt:222 */
|
2600 3030 | /// Returns `Err(&Self)` if it can't be converted.
|
3031 + | /* UnionGenerator.kt:223 */
|
2601 3032 | pub fn as_second(&self) -> ::std::result::Result<&crate::model::PatternString, &Self> {
|
3033 + | /* UnionGenerator.kt:227 */
|
2602 3034 | if let PatternUnion::Second(val) = &self {
|
2603 3035 | ::std::result::Result::Ok(val)
|
2604 3036 | } else {
|
2605 3037 | ::std::result::Result::Err(self)
|
2606 3038 | }
|
3039 + | /* UnionGenerator.kt:223 */
|
2607 3040 | }
|
3041 + | /* UnionGenerator.kt:121 */
|
2608 3042 | /// Returns true if this is a [`Second`](crate::model::PatternUnion::Second).
|
3043 + | /* UnionGenerator.kt:122 */
|
2609 3044 | pub fn is_second(&self) -> bool {
|
3045 + | /* UnionGenerator.kt:123 */
|
2610 3046 | self.as_second().is_ok()
|
3047 + | /* UnionGenerator.kt:122 */
|
2611 3048 | }
|
3049 + | /* UnionGenerator.kt:111 */
|
2612 3050 | }
|
2613 3051 |
|
3052 + | /* ConstrainedStringGenerator.kt:82 */
|
2614 3053 | #[allow(missing_docs)] // documentation missing in model
|
2615 - | ///
|
3054 + | /// /* ConstrainedStringGenerator.kt:83 */
|
2616 3055 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2617 3056 | /// [constraint traits]. Use [`PatternString::try_from`] to construct values of this type.
|
2618 3057 | ///
|
2619 3058 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2620 3059 | ///
|
3060 + | /* RustType.kt:516 */
|
2621 3061 | #[derive(
|
2622 3062 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2623 3063 | )]
|
2624 - | pub struct PatternString(pub(crate) ::std::string::String);
|
3064 + | pub /* ConstrainedStringGenerator.kt:86 */ struct PatternString(pub(crate) ::std::string::String);
|
3065 + | /* ConstrainedStringGenerator.kt:90 */
|
2625 3066 | impl PatternString {
|
2626 3067 | /// Extracts a string slice containing the entire underlying `String`.
|
2627 3068 | pub fn as_str(&self) -> &str {
|
2628 3069 | &self.0
|
2629 3070 | }
|
2630 3071 |
|
2631 3072 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
2632 3073 | pub fn inner(&self) -> &::std::string::String {
|
2633 3074 | &self.0
|
2634 3075 | }
|
2635 3076 |
|
2636 3077 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
2637 3078 | pub fn into_inner(self) -> ::std::string::String {
|
2638 3079 | self.0
|
2639 3080 | }
|
2640 3081 | }
|
3082 + | /* TraitInfo.kt:41 */
|
2641 3083 | impl PatternString {
|
2642 3084 | fn check_pattern(
|
2643 3085 | string: ::std::string::String,
|
2644 3086 | ) -> ::std::result::Result<
|
2645 3087 | ::std::string::String,
|
2646 3088 | crate::model::pattern_string::ConstraintViolation,
|
2647 3089 | > {
|
2648 3090 | let regex = Self::compile_regex();
|
2649 3091 |
|
2650 3092 | if regex.is_match(&string) {
|
2651 3093 | Ok(string)
|
2652 3094 | } else {
|
2653 3095 | Err(crate::model::pattern_string::ConstraintViolation::Pattern(
|
2654 3096 | string,
|
2655 3097 | ))
|
2656 3098 | }
|
2657 3099 | }
|
2658 3100 |
|
2659 3101 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
2660 3102 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
2661 3103 | pub fn compile_regex() -> &'static ::regex::Regex {
|
2662 3104 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
2663 3105 | ::regex::Regex::new(r#"^[a-m]+$"#).expect(r#"The regular expression ^[a-m]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
2664 3106 | });
|
2665 3107 |
|
2666 3108 | ®EX
|
2667 3109 | }
|
2668 3110 | }
|
3111 + | /* TraitInfo.kt:57 */
|
2669 3112 | impl ::std::convert::TryFrom<::std::string::String> for PatternString {
|
2670 3113 | type Error = crate::model::pattern_string::ConstraintViolation;
|
2671 3114 |
|
2672 3115 | /// Constructs a `PatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
2673 3116 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
2674 3117 | let value = Self::check_pattern(value)?;
|
2675 3118 |
|
2676 3119 | Ok(Self(value))
|
2677 3120 | }
|
2678 3121 | }
|
3122 + | /* ConstrainedStringGenerator.kt:112 */
|
2679 3123 | impl crate::constrained::Constrained for PatternString {
|
2680 3124 | type Unconstrained = ::std::string::String;
|
2681 3125 | }
|
2682 3126 |
|
2683 3127 | impl ::std::convert::From<::std::string::String>
|
2684 3128 | for crate::constrained::MaybeConstrained<crate::model::PatternString>
|
2685 3129 | {
|
2686 3130 | fn from(value: ::std::string::String) -> Self {
|
2687 3131 | Self::Unconstrained(value)
|
2688 3132 | }
|
2689 3133 | }
|
2690 3134 |
|
2691 3135 | impl ::std::fmt::Display for PatternString {
|
2692 3136 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2693 3137 | self.0.fmt(f)
|
2694 3138 | }
|
2695 3139 | }
|
2696 3140 |
|
2697 3141 | impl ::std::convert::From<PatternString> for ::std::string::String {
|
2698 3142 | fn from(value: PatternString) -> Self {
|
2699 3143 | value.into_inner()
|
2700 3144 | }
|
2701 3145 | }
|
2702 3146 |
|
3147 + | /* RustType.kt:516 */
|
2703 3148 | #[cfg(test)]
|
3149 + | /* ConstrainedStringGenerator.kt:205 */
|
2704 3150 | mod test_pattern_string {
|
2705 3151 | #[test]
|
2706 3152 | fn regex_compiles() {
|
2707 3153 | crate::model::PatternString::compile_regex();
|
2708 3154 | }
|
3155 + |
|
3156 + | /* ConstrainedStringGenerator.kt:205 */
|
2709 3157 | }
|
2710 3158 |
|
3159 + | /* ConstrainedStringGenerator.kt:82 */
|
2711 3160 | #[allow(missing_docs)] // documentation missing in model
|
2712 - | ///
|
3161 + | /// /* ConstrainedStringGenerator.kt:83 */
|
2713 3162 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2714 3163 | /// [constraint traits]. Use [`EvilString::try_from`] to construct values of this type.
|
2715 3164 | ///
|
2716 3165 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2717 3166 | ///
|
3167 + | /* RustType.kt:516 */
|
2718 3168 | #[derive(
|
2719 3169 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2720 3170 | )]
|
2721 - | pub struct EvilString(pub(crate) ::std::string::String);
|
3171 + | pub /* ConstrainedStringGenerator.kt:86 */ struct EvilString(pub(crate) ::std::string::String);
|
3172 + | /* ConstrainedStringGenerator.kt:90 */
|
2722 3173 | impl EvilString {
|
2723 3174 | /// Extracts a string slice containing the entire underlying `String`.
|
2724 3175 | pub fn as_str(&self) -> &str {
|
2725 3176 | &self.0
|
2726 3177 | }
|
2727 3178 |
|
2728 3179 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
2729 3180 | pub fn inner(&self) -> &::std::string::String {
|
2730 3181 | &self.0
|
2731 3182 | }
|
2732 3183 |
|
2733 3184 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
2734 3185 | pub fn into_inner(self) -> ::std::string::String {
|
2735 3186 | self.0
|
2736 3187 | }
|
2737 3188 | }
|
3189 + | /* TraitInfo.kt:41 */
|
2738 3190 | impl EvilString {
|
2739 3191 | fn check_pattern(
|
2740 3192 | string: ::std::string::String,
|
2741 3193 | ) -> ::std::result::Result<::std::string::String, crate::model::evil_string::ConstraintViolation>
|
2742 3194 | {
|
2743 3195 | let regex = Self::compile_regex();
|
2744 3196 |
|
2745 3197 | if regex.is_match(&string) {
|
2746 3198 | Ok(string)
|
2747 3199 | } else {
|
2748 3200 | Err(crate::model::evil_string::ConstraintViolation::Pattern(
|
2749 3201 | string,
|
2750 3202 | ))
|
2751 3203 | }
|
2752 3204 | }
|
2753 3205 |
|
2754 3206 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
2755 3207 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
2756 3208 | pub fn compile_regex() -> &'static ::regex::Regex {
|
2757 3209 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
2758 3210 | ::regex::Regex::new(r#"^([0-9]+)+$"#).expect(r#"The regular expression ^([0-9]+)+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
2759 3211 | });
|
2760 3212 |
|
2761 3213 | ®EX
|
2762 3214 | }
|
2763 3215 | }
|
3216 + | /* TraitInfo.kt:57 */
|
2764 3217 | impl ::std::convert::TryFrom<::std::string::String> for EvilString {
|
2765 3218 | type Error = crate::model::evil_string::ConstraintViolation;
|
2766 3219 |
|
2767 3220 | /// Constructs a `EvilString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
2768 3221 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
2769 3222 | let value = Self::check_pattern(value)?;
|
2770 3223 |
|
2771 3224 | Ok(Self(value))
|
2772 3225 | }
|
2773 3226 | }
|
3227 + | /* ConstrainedStringGenerator.kt:112 */
|
2774 3228 | impl crate::constrained::Constrained for EvilString {
|
2775 3229 | type Unconstrained = ::std::string::String;
|
2776 3230 | }
|
2777 3231 |
|
2778 3232 | impl ::std::convert::From<::std::string::String>
|
2779 3233 | for crate::constrained::MaybeConstrained<crate::model::EvilString>
|
2780 3234 | {
|
2781 3235 | fn from(value: ::std::string::String) -> Self {
|
2782 3236 | Self::Unconstrained(value)
|
2783 3237 | }
|
2784 3238 | }
|
2785 3239 |
|
2786 3240 | impl ::std::fmt::Display for EvilString {
|
2787 3241 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2788 3242 | self.0.fmt(f)
|
2789 3243 | }
|
2790 3244 | }
|
2791 3245 |
|
2792 3246 | impl ::std::convert::From<EvilString> for ::std::string::String {
|
2793 3247 | fn from(value: EvilString) -> Self {
|
2794 3248 | value.into_inner()
|
2795 3249 | }
|
2796 3250 | }
|
2797 3251 |
|
3252 + | /* RustType.kt:516 */
|
2798 3253 | #[cfg(test)]
|
3254 + | /* ConstrainedStringGenerator.kt:205 */
|
2799 3255 | mod test_evil_string {
|
2800 3256 | #[test]
|
2801 3257 | fn regex_compiles() {
|
2802 3258 | crate::model::EvilString::compile_regex();
|
2803 3259 | }
|
3260 + |
|
3261 + | /* ConstrainedStringGenerator.kt:205 */
|
2804 3262 | }
|
2805 3263 |
|
3264 + | /* ConstrainedStringGenerator.kt:82 */
|
2806 3265 | #[allow(missing_docs)] // documentation missing in model
|
2807 - | ///
|
3266 + | /// /* ConstrainedStringGenerator.kt:83 */
|
2808 3267 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2809 3268 | /// [constraint traits]. Use [`LengthString::try_from`] to construct values of this type.
|
2810 3269 | ///
|
2811 3270 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2812 3271 | ///
|
3272 + | /* RustType.kt:516 */
|
2813 3273 | #[derive(
|
2814 3274 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2815 3275 | )]
|
2816 - | pub struct LengthString(pub(crate) ::std::string::String);
|
3276 + | pub /* ConstrainedStringGenerator.kt:86 */ struct LengthString(pub(crate) ::std::string::String);
|
3277 + | /* ConstrainedStringGenerator.kt:90 */
|
2817 3278 | impl LengthString {
|
2818 3279 | /// Extracts a string slice containing the entire underlying `String`.
|
2819 3280 | pub fn as_str(&self) -> &str {
|
2820 3281 | &self.0
|
2821 3282 | }
|
2822 3283 |
|
2823 3284 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
2824 3285 | pub fn inner(&self) -> &::std::string::String {
|
2825 3286 | &self.0
|
2826 3287 | }
|
2827 3288 |
|
2828 3289 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
2829 3290 | pub fn into_inner(self) -> ::std::string::String {
|
2830 3291 | self.0
|
2831 3292 | }
|
2832 3293 | }
|
3294 + | /* TraitInfo.kt:41 */
|
2833 3295 | impl LengthString {
|
2834 3296 | fn check_length(
|
2835 3297 | string: &str,
|
2836 3298 | ) -> ::std::result::Result<(), crate::model::length_string::ConstraintViolation> {
|
2837 3299 | let length = string.chars().count();
|
2838 3300 |
|
2839 3301 | if (2..=8).contains(&length) {
|
2840 3302 | Ok(())
|
2841 3303 | } else {
|
2842 3304 | Err(crate::model::length_string::ConstraintViolation::Length(
|
2843 3305 | length,
|
2844 3306 | ))
|
2845 3307 | }
|
2846 3308 | }
|
2847 3309 | }
|
3310 + | /* TraitInfo.kt:57 */
|
2848 3311 | impl ::std::convert::TryFrom<::std::string::String> for LengthString {
|
2849 3312 | type Error = crate::model::length_string::ConstraintViolation;
|
2850 3313 |
|
2851 3314 | /// Constructs a `LengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
2852 3315 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
2853 3316 | Self::check_length(&value)?;
|
2854 3317 |
|
2855 3318 | Ok(Self(value))
|
2856 3319 | }
|
2857 3320 | }
|
3321 + | /* ConstrainedStringGenerator.kt:112 */
|
2858 3322 | impl crate::constrained::Constrained for LengthString {
|
2859 3323 | type Unconstrained = ::std::string::String;
|
2860 3324 | }
|
2861 3325 |
|
2862 3326 | impl ::std::convert::From<::std::string::String>
|
2863 3327 | for crate::constrained::MaybeConstrained<crate::model::LengthString>
|
2864 3328 | {
|
2865 3329 | fn from(value: ::std::string::String) -> Self {
|
2866 3330 | Self::Unconstrained(value)
|
2867 3331 | }
|
2868 3332 | }
|
2869 3333 |
|
2870 3334 | impl ::std::fmt::Display for LengthString {
|
2871 3335 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2872 3336 | self.0.fmt(f)
|
2873 3337 | }
|
2874 3338 | }
|
2875 3339 |
|
2876 3340 | impl ::std::convert::From<LengthString> for ::std::string::String {
|
2877 3341 | fn from(value: LengthString) -> Self {
|
2878 3342 | value.into_inner()
|
2879 3343 | }
|
2880 3344 | }
|
2881 3345 |
|
3346 + | /* ConstrainedCollectionGenerator.kt:93 */
|
2882 3347 | #[allow(missing_docs)] // documentation missing in model
|
2883 - | ///
|
3348 + | /// /* ConstrainedCollectionGenerator.kt:94 */
|
2884 3349 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2885 3350 | /// [constraint traits]. Use [`LengthList::try_from`] to construct values of this type.
|
2886 3351 | ///
|
2887 3352 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2888 3353 | ///
|
3354 + | /* RustType.kt:516 */
|
2889 3355 | #[derive(
|
2890 3356 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2891 3357 | )]
|
2892 - | pub struct LengthList(pub(crate) ::std::vec::Vec<crate::model::LengthString>);
|
3358 + | pub /* ConstrainedCollectionGenerator.kt:97 */ struct LengthList(
|
3359 + | pub(crate) ::std::vec::Vec<crate::model::LengthString>,
|
3360 + | );
|
3361 + | /* ConstrainedCollectionGenerator.kt:104 */
|
2893 3362 | impl LengthList {
|
3363 + | /* ConstrainedCollectionGenerator.kt:106 */
|
2894 3364 | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
2895 3365 | pub fn inner(&self) -> &::std::vec::Vec<crate::model::LengthString> {
|
2896 3366 | &self.0
|
2897 3367 | }
|
3368 + | /* ConstrainedCollectionGenerator.kt:116 */
|
2898 3369 | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
2899 3370 | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthString> {
|
2900 3371 | self.0
|
2901 3372 | }
|
2902 3373 |
|
2903 3374 | fn check_length(
|
2904 3375 | length: usize,
|
2905 3376 | ) -> ::std::result::Result<(), crate::model::length_list::ConstraintViolation> {
|
2906 3377 | if (2..=8).contains(&length) {
|
2907 3378 | Ok(())
|
2908 3379 | } else {
|
2909 3380 | Err(crate::model::length_list::ConstraintViolation::Length(
|
2910 3381 | length,
|
2911 3382 | ))
|
2912 3383 | }
|
2913 3384 | }
|
3385 + | /* ConstrainedCollectionGenerator.kt:104 */
|
2914 3386 | }
|
3387 + | /* ConstrainedCollectionGenerator.kt:133 */
|
2915 3388 | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthString>> for LengthList {
|
2916 3389 | type Error = crate::model::length_list::ConstraintViolation;
|
2917 3390 |
|
2918 3391 | /// Constructs a `LengthList` from an [`::std::vec::Vec<crate::model::LengthString>`], failing when the provided value does not satisfy the modeled constraints.
|
2919 3392 | fn try_from(
|
2920 3393 | value: ::std::vec::Vec<crate::model::LengthString>,
|
2921 3394 | ) -> ::std::result::Result<Self, Self::Error> {
|
2922 3395 | Self::check_length(value.len())?;
|
2923 3396 |
|
2924 3397 | Ok(Self(value))
|
2925 3398 | }
|
2926 3399 | }
|
2927 3400 |
|
2928 3401 | impl ::std::convert::From<LengthList> for ::std::vec::Vec<crate::model::LengthString> {
|
2929 3402 | fn from(value: LengthList) -> Self {
|
2930 3403 | value.into_inner()
|
2931 3404 | }
|
2932 3405 | }
|
3406 + | /* ConstrainedCollectionGenerator.kt:181 */
|
2933 3407 | impl crate::constrained::Constrained for LengthList {
|
2934 3408 | type Unconstrained = crate::unconstrained::length_list_unconstrained::LengthListUnconstrained;
|
2935 3409 | }
|
2936 3410 |
|
3411 + | /* ConstrainedMapGenerator.kt:78 */
|
2937 3412 | #[allow(missing_docs)] // documentation missing in model
|
2938 - | ///
|
3413 + | /// /* ConstrainedMapGenerator.kt:79 */
|
2939 3414 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2940 3415 | /// [constraint traits]. Use [`LengthMap::try_from`] to construct values of this type.
|
2941 3416 | ///
|
2942 3417 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2943 3418 | ///
|
3419 + | /* RustType.kt:516 */
|
2944 3420 | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2945 - | pub struct LengthMap(
|
3421 + | pub /* ConstrainedMapGenerator.kt:82 */ struct LengthMap(
|
2946 3422 | pub(crate) ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>,
|
2947 3423 | );
|
3424 + | /* ConstrainedMapGenerator.kt:83 */
|
2948 3425 | impl LengthMap {
|
3426 + | /* ConstrainedMapGenerator.kt:85 */
|
2949 3427 | /// Returns an immutable reference to the underlying [`::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>`].
|
2950 3428 | pub fn inner(
|
2951 3429 | &self,
|
2952 3430 | ) -> &::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList> {
|
2953 3431 | &self.0
|
2954 3432 | }
|
3433 + | /* ConstrainedMapGenerator.kt:95 */
|
2955 3434 | /// Consumes the value, returning the underlying [`::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>`].
|
2956 3435 | pub fn into_inner(
|
2957 3436 | self,
|
2958 3437 | ) -> ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList> {
|
2959 3438 | self.0
|
2960 3439 | }
|
3440 + | /* ConstrainedMapGenerator.kt:83 */
|
2961 3441 | }
|
3442 + | /* ConstrainedMapGenerator.kt:106 */
|
2962 3443 | impl
|
2963 3444 | ::std::convert::TryFrom<
|
2964 3445 | ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>,
|
2965 3446 | > for LengthMap
|
2966 3447 | {
|
2967 3448 | type Error = crate::model::length_map::ConstraintViolation;
|
2968 3449 |
|
2969 3450 | /// Constructs a `LengthMap` from an [`::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>`], failing when the provided value does not satisfy the modeled constraints.
|
2970 3451 | fn try_from(
|
2971 3452 | value: ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>,
|
2972 3453 | ) -> ::std::result::Result<Self, Self::Error> {
|
2973 3454 | let length = value.len();
|
2974 3455 | if (2..=8).contains(&length) {
|
2975 3456 | Ok(Self(value))
|
2976 3457 | } else {
|
2977 3458 | Err(crate::model::length_map::ConstraintViolation::Length(
|
2978 3459 | length,
|
2979 3460 | ))
|
2980 3461 | }
|
2981 3462 | }
|
2982 3463 | }
|
2983 3464 |
|
2984 3465 | impl ::std::convert::From<LengthMap>
|
2985 3466 | for ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>
|
2986 3467 | {
|
2987 3468 | fn from(value: LengthMap) -> Self {
|
2988 3469 | value.into_inner()
|
2989 3470 | }
|
2990 3471 | }
|
3472 + | /* ConstrainedMapGenerator.kt:164 */
|
2991 3473 | impl crate::constrained::Constrained for LengthMap {
|
2992 3474 | type Unconstrained = crate::unconstrained::length_map_unconstrained::LengthMapUnconstrained;
|
2993 3475 | }
|
2994 3476 |
|
3477 + | /* ConstrainedStringGenerator.kt:82 */
|
2995 3478 | #[allow(missing_docs)] // documentation missing in model
|
2996 - | ///
|
3479 + | /// /* ConstrainedStringGenerator.kt:83 */
|
2997 3480 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2998 3481 | /// [constraint traits]. Use [`MaxLengthString::try_from`] to construct values of this type.
|
2999 3482 | ///
|
3000 3483 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3001 3484 | ///
|
3485 + | /* RustType.kt:516 */
|
3002 3486 | #[derive(
|
3003 3487 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3004 3488 | )]
|
3005 - | pub struct MaxLengthString(pub(crate) ::std::string::String);
|
3489 + | pub /* ConstrainedStringGenerator.kt:86 */ struct MaxLengthString(pub(crate) ::std::string::String);
|
3490 + | /* ConstrainedStringGenerator.kt:90 */
|
3006 3491 | impl MaxLengthString {
|
3007 3492 | /// Extracts a string slice containing the entire underlying `String`.
|
3008 3493 | pub fn as_str(&self) -> &str {
|
3009 3494 | &self.0
|
3010 3495 | }
|
3011 3496 |
|
3012 3497 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
3013 3498 | pub fn inner(&self) -> &::std::string::String {
|
3014 3499 | &self.0
|
3015 3500 | }
|
3016 3501 |
|
3017 3502 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
3018 3503 | pub fn into_inner(self) -> ::std::string::String {
|
3019 3504 | self.0
|
3020 3505 | }
|
3021 3506 | }
|
3507 + | /* TraitInfo.kt:41 */
|
3022 3508 | impl MaxLengthString {
|
3023 3509 | fn check_length(
|
3024 3510 | string: &str,
|
3025 3511 | ) -> ::std::result::Result<(), crate::model::max_length_string::ConstraintViolation> {
|
3026 3512 | let length = string.chars().count();
|
3027 3513 |
|
3028 3514 | if length <= 8 {
|
3029 3515 | Ok(())
|
3030 3516 | } else {
|
3031 3517 | Err(crate::model::max_length_string::ConstraintViolation::Length(length))
|
3032 3518 | }
|
3033 3519 | }
|
3034 3520 | }
|
3521 + | /* TraitInfo.kt:57 */
|
3035 3522 | impl ::std::convert::TryFrom<::std::string::String> for MaxLengthString {
|
3036 3523 | type Error = crate::model::max_length_string::ConstraintViolation;
|
3037 3524 |
|
3038 3525 | /// Constructs a `MaxLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
3039 3526 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
3040 3527 | Self::check_length(&value)?;
|
3041 3528 |
|
3042 3529 | Ok(Self(value))
|
3043 3530 | }
|
3044 3531 | }
|
3532 + | /* ConstrainedStringGenerator.kt:112 */
|
3045 3533 | impl crate::constrained::Constrained for MaxLengthString {
|
3046 3534 | type Unconstrained = ::std::string::String;
|
3047 3535 | }
|
3048 3536 |
|
3049 3537 | impl ::std::convert::From<::std::string::String>
|
3050 3538 | for crate::constrained::MaybeConstrained<crate::model::MaxLengthString>
|
3051 3539 | {
|
3052 3540 | fn from(value: ::std::string::String) -> Self {
|
3053 3541 | Self::Unconstrained(value)
|
3054 3542 | }
|
3055 3543 | }
|
3056 3544 |
|
3057 3545 | impl ::std::fmt::Display for MaxLengthString {
|
3058 3546 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3059 3547 | self.0.fmt(f)
|
3060 3548 | }
|
3061 3549 | }
|
3062 3550 |
|
3063 3551 | impl ::std::convert::From<MaxLengthString> for ::std::string::String {
|
3064 3552 | fn from(value: MaxLengthString) -> Self {
|
3065 3553 | value.into_inner()
|
3066 3554 | }
|
3067 3555 | }
|
3068 3556 |
|
3557 + | /* ConstrainedStringGenerator.kt:82 */
|
3069 3558 | #[allow(missing_docs)] // documentation missing in model
|
3070 - | ///
|
3559 + | /// /* ConstrainedStringGenerator.kt:83 */
|
3071 3560 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3072 3561 | /// [constraint traits]. Use [`MinLengthString::try_from`] to construct values of this type.
|
3073 3562 | ///
|
3074 3563 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3075 3564 | ///
|
3565 + | /* RustType.kt:516 */
|
3076 3566 | #[derive(
|
3077 3567 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3078 3568 | )]
|
3079 - | pub struct MinLengthString(pub(crate) ::std::string::String);
|
3569 + | pub /* ConstrainedStringGenerator.kt:86 */ struct MinLengthString(pub(crate) ::std::string::String);
|
3570 + | /* ConstrainedStringGenerator.kt:90 */
|
3080 3571 | impl MinLengthString {
|
3081 3572 | /// Extracts a string slice containing the entire underlying `String`.
|
3082 3573 | pub fn as_str(&self) -> &str {
|
3083 3574 | &self.0
|
3084 3575 | }
|
3085 3576 |
|
3086 3577 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
3087 3578 | pub fn inner(&self) -> &::std::string::String {
|
3088 3579 | &self.0
|
3089 3580 | }
|
3090 3581 |
|
3091 3582 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
3092 3583 | pub fn into_inner(self) -> ::std::string::String {
|
3093 3584 | self.0
|
3094 3585 | }
|
3095 3586 | }
|
3587 + | /* TraitInfo.kt:41 */
|
3096 3588 | impl MinLengthString {
|
3097 3589 | fn check_length(
|
3098 3590 | string: &str,
|
3099 3591 | ) -> ::std::result::Result<(), crate::model::min_length_string::ConstraintViolation> {
|
3100 3592 | let length = string.chars().count();
|
3101 3593 |
|
3102 3594 | if 2 <= length {
|
3103 3595 | Ok(())
|
3104 3596 | } else {
|
3105 3597 | Err(crate::model::min_length_string::ConstraintViolation::Length(length))
|
3106 3598 | }
|
3107 3599 | }
|
3108 3600 | }
|
3601 + | /* TraitInfo.kt:57 */
|
3109 3602 | impl ::std::convert::TryFrom<::std::string::String> for MinLengthString {
|
3110 3603 | type Error = crate::model::min_length_string::ConstraintViolation;
|
3111 3604 |
|
3112 3605 | /// Constructs a `MinLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
3113 3606 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
3114 3607 | Self::check_length(&value)?;
|
3115 3608 |
|
3116 3609 | Ok(Self(value))
|
3117 3610 | }
|
3118 3611 | }
|
3612 + | /* ConstrainedStringGenerator.kt:112 */
|
3119 3613 | impl crate::constrained::Constrained for MinLengthString {
|
3120 3614 | type Unconstrained = ::std::string::String;
|
3121 3615 | }
|
3122 3616 |
|
3123 3617 | impl ::std::convert::From<::std::string::String>
|
3124 3618 | for crate::constrained::MaybeConstrained<crate::model::MinLengthString>
|
3125 3619 | {
|
3126 3620 | fn from(value: ::std::string::String) -> Self {
|
3127 3621 | Self::Unconstrained(value)
|
3128 3622 | }
|
3129 3623 | }
|
3130 3624 |
|
3131 3625 | impl ::std::fmt::Display for MinLengthString {
|
3132 3626 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3133 3627 | self.0.fmt(f)
|
3134 3628 | }
|
3135 3629 | }
|
3136 3630 |
|
3137 3631 | impl ::std::convert::From<MinLengthString> for ::std::string::String {
|
3138 3632 | fn from(value: MinLengthString) -> Self {
|
3139 3633 | value.into_inner()
|
3140 3634 | }
|
3141 3635 | }
|
3142 3636 |
|
3637 + | /* ConstrainedBlobGenerator.kt:66 */
|
3143 3638 | #[allow(missing_docs)] // documentation missing in model
|
3144 - | ///
|
3639 + | /// /* ConstrainedBlobGenerator.kt:67 */
|
3145 3640 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3146 3641 | /// [constraint traits]. Use [`LengthBlob::try_from`] to construct values of this type.
|
3147 3642 | ///
|
3148 3643 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3149 3644 | ///
|
3645 + | /* RustType.kt:516 */
|
3150 3646 | #[derive(
|
3151 3647 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3152 3648 | )]
|
3153 - | pub struct LengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
3649 + | pub /* ConstrainedBlobGenerator.kt:70 */ struct LengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
3650 + | /* ConstrainedBlobGenerator.kt:71 */
|
3154 3651 | impl LengthBlob {
|
3652 + | /* ConstrainedBlobGenerator.kt:73 */
|
3155 3653 | /// Returns an immutable reference to the underlying [`::aws_smithy_types::Blob`].
|
3156 3654 | pub fn inner(&self) -> &::aws_smithy_types::Blob {
|
3157 3655 | &self.0
|
3158 3656 | }
|
3657 + | /* ConstrainedBlobGenerator.kt:82 */
|
3159 3658 | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
3160 3659 | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3161 3660 | self.0
|
3162 3661 | }
|
3662 + | /* ConstrainedBlobGenerator.kt:71 */
|
3163 3663 | }
|
3664 + | /* TraitInfo.kt:41 */
|
3164 3665 | impl LengthBlob {
|
3165 3666 | fn check_length(
|
3166 3667 | blob: &::aws_smithy_types::Blob,
|
3167 3668 | ) -> ::std::result::Result<(), crate::model::length_blob::ConstraintViolation> {
|
3168 3669 | let length = blob.as_ref().len();
|
3169 3670 |
|
3170 3671 | if (2..=8).contains(&length) {
|
3171 3672 | Ok(())
|
3172 3673 | } else {
|
3173 3674 | Err(crate::model::length_blob::ConstraintViolation::Length(
|
3174 3675 | length,
|
3175 3676 | ))
|
3176 3677 | }
|
3177 3678 | }
|
3178 3679 | }
|
3680 + | /* TraitInfo.kt:57 */
|
3179 3681 | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for LengthBlob {
|
3180 3682 | type Error = crate::model::length_blob::ConstraintViolation;
|
3181 3683 |
|
3182 3684 | /// Constructs a `LengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
3183 3685 | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
3184 3686 | Self::check_length(&value)?;
|
3185 3687 |
|
3186 3688 | Ok(Self(value))
|
3187 3689 | }
|
3188 3690 | }
|
3691 + | /* ConstrainedBlobGenerator.kt:94 */
|
3189 3692 | impl crate::constrained::Constrained for LengthBlob {
|
3190 3693 | type Unconstrained = ::aws_smithy_types::Blob;
|
3191 3694 | }
|
3192 3695 |
|
3193 3696 | impl ::std::convert::From<::aws_smithy_types::Blob>
|
3194 3697 | for crate::constrained::MaybeConstrained<crate::model::LengthBlob>
|
3195 3698 | {
|
3196 3699 | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
3197 3700 | Self::Unconstrained(value)
|
3198 3701 | }
|
3199 3702 | }
|
3200 3703 |
|
3201 3704 | impl ::std::convert::From<LengthBlob> for ::aws_smithy_types::Blob {
|
3202 3705 | fn from(value: LengthBlob) -> Self {
|
3203 3706 | value.into_inner()
|
3204 3707 | }
|
3205 3708 | }
|
3206 3709 |
|
3710 + | /* UnionGenerator.kt:67 */
|
3207 3711 | #[allow(missing_docs)] // documentation missing in model
|
3712 + | /* RustType.kt:516 */
|
3208 3713 | #[derive(
|
3209 3714 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3210 3715 | )]
|
3211 - | pub enum EnumUnion {
|
3716 + | pub /* UnionGenerator.kt:85 */ enum EnumUnion {
|
3717 + | /* UnionGenerator.kt:90 */
|
3212 3718 | #[allow(missing_docs)] // documentation missing in model
|
3719 + | /* UnionGenerator.kt:190 */
|
3213 3720 | First(crate::model::EnumString),
|
3721 + | /* UnionGenerator.kt:90 */
|
3214 3722 | #[allow(missing_docs)] // documentation missing in model
|
3723 + | /* UnionGenerator.kt:190 */
|
3215 3724 | Second(crate::model::EnumString),
|
3725 + | /* UnionGenerator.kt:85 */
|
3216 3726 | }
|
3727 + | /* UnionGenerator.kt:111 */
|
3217 3728 | impl EnumUnion {
|
3729 + | /* UnionGenerator.kt:217 */
|
3218 3730 | /// Tries to convert the enum instance into [`First`](crate::model::EnumUnion::First), extracting the inner [`EnumString`](crate::model::EnumString).
|
3731 + | /* UnionGenerator.kt:222 */
|
3219 3732 | /// Returns `Err(&Self)` if it can't be converted.
|
3733 + | /* UnionGenerator.kt:223 */
|
3220 3734 | pub fn as_first(&self) -> ::std::result::Result<&crate::model::EnumString, &Self> {
|
3735 + | /* UnionGenerator.kt:227 */
|
3221 3736 | if let EnumUnion::First(val) = &self {
|
3222 3737 | ::std::result::Result::Ok(val)
|
3223 3738 | } else {
|
3224 3739 | ::std::result::Result::Err(self)
|
3225 3740 | }
|
3741 + | /* UnionGenerator.kt:223 */
|
3226 3742 | }
|
3743 + | /* UnionGenerator.kt:121 */
|
3227 3744 | /// Returns true if this is a [`First`](crate::model::EnumUnion::First).
|
3745 + | /* UnionGenerator.kt:122 */
|
3228 3746 | pub fn is_first(&self) -> bool {
|
3747 + | /* UnionGenerator.kt:123 */
|
3229 3748 | self.as_first().is_ok()
|
3749 + | /* UnionGenerator.kt:122 */
|
3230 3750 | }
|
3751 + | /* UnionGenerator.kt:217 */
|
3231 3752 | /// Tries to convert the enum instance into [`Second`](crate::model::EnumUnion::Second), extracting the inner [`EnumString`](crate::model::EnumString).
|
3753 + | /* UnionGenerator.kt:222 */
|
3232 3754 | /// Returns `Err(&Self)` if it can't be converted.
|
3755 + | /* UnionGenerator.kt:223 */
|
3233 3756 | pub fn as_second(&self) -> ::std::result::Result<&crate::model::EnumString, &Self> {
|
3757 + | /* UnionGenerator.kt:227 */
|
3234 3758 | if let EnumUnion::Second(val) = &self {
|
3235 3759 | ::std::result::Result::Ok(val)
|
3236 3760 | } else {
|
3237 3761 | ::std::result::Result::Err(self)
|
3238 3762 | }
|
3763 + | /* UnionGenerator.kt:223 */
|
3239 3764 | }
|
3765 + | /* UnionGenerator.kt:121 */
|
3240 3766 | /// Returns true if this is a [`Second`](crate::model::EnumUnion::Second).
|
3767 + | /* UnionGenerator.kt:122 */
|
3241 3768 | pub fn is_second(&self) -> bool {
|
3769 + | /* UnionGenerator.kt:123 */
|
3242 3770 | self.as_second().is_ok()
|
3771 + | /* UnionGenerator.kt:122 */
|
3243 3772 | }
|
3773 + | /* UnionGenerator.kt:111 */
|
3244 3774 | }
|
3245 3775 |
|
3776 + | /* EnumGenerator.kt:154 */
|
3246 3777 | #[allow(missing_docs)] // documentation missing in model
|
3778 + | /* RustType.kt:516 */
|
3247 3779 | #[derive(
|
3248 3780 | ::std::clone::Clone,
|
3249 3781 | ::std::cmp::Eq,
|
3250 3782 | ::std::cmp::Ord,
|
3251 3783 | ::std::cmp::PartialEq,
|
3252 3784 | ::std::cmp::PartialOrd,
|
3253 3785 | ::std::fmt::Debug,
|
3254 3786 | ::std::hash::Hash,
|
3255 3787 | )]
|
3256 - | pub enum EnumString {
|
3788 + | pub /* EnumGenerator.kt:267 */ enum EnumString {
|
3789 + | /* EnumGenerator.kt:154 */
|
3257 3790 | #[allow(missing_docs)] // documentation missing in model
|
3791 + | /* EnumGenerator.kt:143 */
|
3258 3792 | Abc,
|
3793 + | /* EnumGenerator.kt:154 */
|
3259 3794 | #[allow(missing_docs)] // documentation missing in model
|
3795 + | /* EnumGenerator.kt:143 */
|
3260 3796 | Def,
|
3797 + | /* EnumGenerator.kt:154 */
|
3261 3798 | #[allow(missing_docs)] // documentation missing in model
|
3799 + | /* EnumGenerator.kt:143 */
|
3262 3800 | Ghi,
|
3801 + | /* EnumGenerator.kt:154 */
|
3263 3802 | #[allow(missing_docs)] // documentation missing in model
|
3803 + | /* EnumGenerator.kt:143 */
|
3264 3804 | Jkl,
|
3805 + | /* EnumGenerator.kt:267 */
|
3265 3806 | }
|
3266 - | /// See [`EnumString`](crate::model::EnumString).
|
3807 + | /// /* CodegenDelegator.kt:51 */See [`EnumString`](crate::model::EnumString).
|
3267 3808 | pub mod enum_string {
|
3268 3809 | #[derive(Debug, PartialEq)]
|
3269 3810 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
3270 3811 |
|
3271 3812 | impl ::std::fmt::Display for ConstraintViolation {
|
3272 3813 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3273 3814 | write!(
|
3274 3815 | f,
|
3275 3816 | r#"Value provided for 'aws.protocoltests.restjson.validation#EnumString' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, ghi, jkl]"#
|
3276 3817 | )
|
3277 3818 | }
|
3278 3819 | }
|
3279 3820 |
|
3280 3821 | impl ::std::error::Error for ConstraintViolation {}
|
3281 3822 | impl ConstraintViolation {
|
3282 3823 | pub(crate) fn as_validation_exception_field(
|
3283 3824 | self,
|
3284 3825 | path: ::std::string::String,
|
3285 3826 | ) -> crate::model::ValidationExceptionField {
|
3286 3827 | crate::model::ValidationExceptionField {
|
3287 3828 | message: format!(
|
3288 3829 | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, ghi, jkl]"#,
|
3289 3830 | &path
|
3290 3831 | ),
|
3291 3832 | path,
|
3292 3833 | }
|
3293 3834 | }
|
3294 3835 | }
|
3836 + |
|
3837 + | /* ServerEnumGenerator.kt:46 */
|
3295 3838 | }
|
3839 + | /* ServerEnumGenerator.kt:85 */
|
3296 3840 | impl ::std::convert::TryFrom<&str> for EnumString {
|
3297 3841 | type Error = crate::model::enum_string::ConstraintViolation;
|
3298 3842 | fn try_from(
|
3299 3843 | s: &str,
|
3300 3844 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
3301 3845 | match s {
|
3302 3846 | "abc" => Ok(EnumString::Abc),
|
3303 3847 | "def" => Ok(EnumString::Def),
|
3304 3848 | "ghi" => Ok(EnumString::Ghi),
|
3305 3849 | "jkl" => Ok(EnumString::Jkl),
|
3306 3850 | _ => Err(crate::model::enum_string::ConstraintViolation(s.to_owned())),
|
3307 3851 | }
|
3308 3852 | }
|
3309 3853 | }
|
3310 3854 | impl ::std::convert::TryFrom<::std::string::String> for EnumString {
|
3311 3855 | type Error = crate::model::enum_string::ConstraintViolation;
|
3312 3856 | fn try_from(
|
3313 3857 | s: ::std::string::String,
|
3314 3858 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
3315 3859 | {
|
3316 3860 | s.as_str().try_into()
|
3317 3861 | }
|
3318 3862 | }
|
3863 + | /* ServerEnumGenerator.kt:145 */
|
3319 3864 | impl std::str::FromStr for EnumString {
|
3320 3865 | type Err = crate::model::enum_string::ConstraintViolation;
|
3321 3866 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
3322 3867 | Self::try_from(s)
|
3323 3868 | }
|
3324 3869 | }
|
3870 + | /* EnumGenerator.kt:274 */
|
3325 3871 | impl EnumString {
|
3326 3872 | /// Returns the `&str` value of the enum member.
|
3327 3873 | pub fn as_str(&self) -> &str {
|
3328 3874 | match self {
|
3329 3875 | EnumString::Abc => "abc",
|
3330 3876 | EnumString::Def => "def",
|
3331 3877 | EnumString::Ghi => "ghi",
|
3332 3878 | EnumString::Jkl => "jkl",
|
3333 3879 | }
|
3334 3880 | }
|
3335 3881 | /// Returns all the `&str` representations of the enum members.
|
3336 3882 | pub const fn values() -> &'static [&'static str] {
|
3337 3883 | &["abc", "def", "ghi", "jkl"]
|
3338 3884 | }
|
3339 3885 | }
|
3886 + | /* EnumGenerator.kt:223 */
|
3340 3887 | impl ::std::convert::AsRef<str> for EnumString {
|
3341 3888 | fn as_ref(&self) -> &str {
|
3342 3889 | self.as_str()
|
3343 3890 | }
|
3344 3891 | }
|
3892 + | /* ConstrainedTraitForEnumGenerator.kt:36 */
|
3345 3893 | impl crate::constrained::Constrained for EnumString {
|
3346 3894 | type Unconstrained = ::std::string::String;
|
3347 3895 | }
|
3348 3896 |
|
3349 3897 | impl ::std::convert::From<::std::string::String>
|
3350 3898 | for crate::constrained::MaybeConstrained<crate::model::EnumString>
|
3351 3899 | {
|
3352 3900 | fn from(value: ::std::string::String) -> Self {
|
3353 3901 | Self::Unconstrained(value)
|
3354 3902 | }
|
3355 3903 | }
|
3356 3904 |
|
3905 + | /* EnumGenerator.kt:154 */
|
3357 3906 | #[allow(missing_docs)] // documentation missing in model
|
3907 + | /* RustType.kt:516 */
|
3358 3908 | #[derive(
|
3359 3909 | ::std::clone::Clone,
|
3360 3910 | ::std::cmp::Eq,
|
3361 3911 | ::std::cmp::Ord,
|
3362 3912 | ::std::cmp::PartialEq,
|
3363 3913 | ::std::cmp::PartialOrd,
|
3364 3914 | ::std::fmt::Debug,
|
3365 3915 | ::std::hash::Hash,
|
3366 3916 | )]
|
3367 - | pub enum EnumTraitString {
|
3917 + | pub /* EnumGenerator.kt:267 */ enum EnumTraitString {
|
3918 + | /* EnumGenerator.kt:154 */
|
3368 3919 | #[allow(missing_docs)] // documentation missing in model
|
3920 + | /* EnumGenerator.kt:143 */
|
3369 3921 | Abc,
|
3922 + | /* EnumGenerator.kt:154 */
|
3370 3923 | #[allow(missing_docs)] // documentation missing in model
|
3924 + | /* EnumGenerator.kt:143 */
|
3371 3925 | Def,
|
3926 + | /* EnumGenerator.kt:154 */
|
3372 3927 | #[allow(missing_docs)] // documentation missing in model
|
3928 + | /* EnumGenerator.kt:143 */
|
3373 3929 | Ghi,
|
3930 + | /* EnumGenerator.kt:267 */
|
3374 3931 | }
|
3375 - | /// See [`EnumTraitString`](crate::model::EnumTraitString).
|
3932 + | /// /* CodegenDelegator.kt:51 */See [`EnumTraitString`](crate::model::EnumTraitString).
|
3376 3933 | pub mod enum_trait_string {
|
3377 3934 | #[derive(Debug, PartialEq)]
|
3378 3935 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
3379 3936 |
|
3380 3937 | impl ::std::fmt::Display for ConstraintViolation {
|
3381 3938 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3382 3939 | write!(
|
3383 3940 | f,
|
3384 3941 | r#"Value provided for 'aws.protocoltests.restjson.validation#EnumTraitString' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, ghi]"#
|
3385 3942 | )
|
3386 3943 | }
|
3387 3944 | }
|
3388 3945 |
|
3389 3946 | impl ::std::error::Error for ConstraintViolation {}
|
3390 3947 | impl ConstraintViolation {
|
3391 3948 | pub(crate) fn as_validation_exception_field(
|
3392 3949 | self,
|
3393 3950 | path: ::std::string::String,
|
3394 3951 | ) -> crate::model::ValidationExceptionField {
|
3395 3952 | crate::model::ValidationExceptionField {
|
3396 3953 | message: format!(
|
3397 3954 | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, ghi]"#,
|
3398 3955 | &path
|
3399 3956 | ),
|
3400 3957 | path,
|
3401 3958 | }
|
3402 3959 | }
|
3403 3960 | }
|
3961 + |
|
3962 + | /* ServerEnumGenerator.kt:46 */
|
3404 3963 | }
|
3964 + | /* ServerEnumGenerator.kt:85 */
|
3405 3965 | impl ::std::convert::TryFrom<&str> for EnumTraitString {
|
3406 3966 | type Error = crate::model::enum_trait_string::ConstraintViolation;
|
3407 3967 | fn try_from(
|
3408 3968 | s: &str,
|
3409 3969 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
3410 3970 | match s {
|
3411 3971 | "abc" => Ok(EnumTraitString::Abc),
|
3412 3972 | "def" => Ok(EnumTraitString::Def),
|
3413 3973 | "ghi" => Ok(EnumTraitString::Ghi),
|
3414 3974 | _ => Err(crate::model::enum_trait_string::ConstraintViolation(
|
3415 3975 | s.to_owned(),
|
3416 3976 | )),
|
3417 3977 | }
|
3418 3978 | }
|
3419 3979 | }
|
3420 3980 | impl ::std::convert::TryFrom<::std::string::String> for EnumTraitString {
|
3421 3981 | type Error = crate::model::enum_trait_string::ConstraintViolation;
|
3422 3982 | fn try_from(
|
3423 3983 | s: ::std::string::String,
|
3424 3984 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
3425 3985 | {
|
3426 3986 | s.as_str().try_into()
|
3427 3987 | }
|
3428 3988 | }
|
3989 + | /* ServerEnumGenerator.kt:145 */
|
3429 3990 | impl std::str::FromStr for EnumTraitString {
|
3430 3991 | type Err = crate::model::enum_trait_string::ConstraintViolation;
|
3431 3992 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
3432 3993 | Self::try_from(s)
|
3433 3994 | }
|
3434 3995 | }
|
3996 + | /* EnumGenerator.kt:274 */
|
3435 3997 | impl EnumTraitString {
|
3436 3998 | /// Returns the `&str` value of the enum member.
|
3437 3999 | pub fn as_str(&self) -> &str {
|
3438 4000 | match self {
|
3439 4001 | EnumTraitString::Abc => "abc",
|
3440 4002 | EnumTraitString::Def => "def",
|
3441 4003 | EnumTraitString::Ghi => "ghi",
|
3442 4004 | }
|
3443 4005 | }
|
3444 4006 | /// Returns all the `&str` representations of the enum members.
|
3445 4007 | pub const fn values() -> &'static [&'static str] {
|
3446 4008 | &["abc", "def", "ghi"]
|
3447 4009 | }
|
3448 4010 | }
|
4011 + | /* EnumGenerator.kt:223 */
|
3449 4012 | impl ::std::convert::AsRef<str> for EnumTraitString {
|
3450 4013 | fn as_ref(&self) -> &str {
|
3451 4014 | self.as_str()
|
3452 4015 | }
|
3453 4016 | }
|
4017 + | /* ConstrainedTraitForEnumGenerator.kt:36 */
|
3454 4018 | impl crate::constrained::Constrained for EnumTraitString {
|
3455 4019 | type Unconstrained = ::std::string::String;
|
3456 4020 | }
|
3457 4021 |
|
3458 4022 | impl ::std::convert::From<::std::string::String>
|
3459 4023 | for crate::constrained::MaybeConstrained<crate::model::EnumTraitString>
|
3460 4024 | {
|
3461 4025 | fn from(value: ::std::string::String) -> Self {
|
3462 4026 | Self::Unconstrained(value)
|
3463 4027 | }
|
3464 4028 | }
|
3465 - | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4029 + | /// /* ServerBuilderGenerator.kt:171 */See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
3466 4030 | pub mod validation_exception_field {
|
3467 4031 |
|
4032 + | /* RustType.kt:516 */
|
3468 4033 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3469 - | /// Holds one variant for each of the ways the builder can fail.
|
4034 + | /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
|
4035 + | /* RustType.kt:516 */
|
3470 4036 | #[non_exhaustive]
|
4037 + | /* ServerBuilderConstraintViolations.kt:75 */
|
3471 4038 | #[allow(clippy::enum_variant_names)]
|
3472 4039 | pub enum ConstraintViolation {
|
3473 - | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
4040 + | /// /* ServerBuilderConstraintViolations.kt:138 */`path` was not provided but it is required when building `ValidationExceptionField`.
|
4041 + | /* ServerBuilderConstraintViolations.kt:143 */
|
3474 4042 | MissingPath,
|
3475 - | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
4043 + | /// /* ServerBuilderConstraintViolations.kt:138 */`message` was not provided but it is required when building `ValidationExceptionField`.
|
4044 + | /* ServerBuilderConstraintViolations.kt:143 */
|
3476 4045 | MissingMessage,
|
4046 + | /* ServerBuilderConstraintViolations.kt:75 */
|
3477 4047 | }
|
4048 + | /* ServerBuilderConstraintViolations.kt:117 */
|
3478 4049 | impl ::std::fmt::Display for ConstraintViolation {
|
4050 + | /* ServerBuilderConstraintViolations.kt:118 */
|
3479 4051 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4052 + | /* ServerBuilderConstraintViolations.kt:119 */
|
3480 4053 | match self {
|
3481 - | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
3482 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
3483 - | }
|
4054 + | /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
4055 + | /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
4056 + | /* ServerBuilderConstraintViolations.kt:119 */}
|
4057 + | /* ServerBuilderConstraintViolations.kt:118 */
|
3484 4058 | }
|
4059 + | /* ServerBuilderConstraintViolations.kt:117 */
|
3485 4060 | }
|
4061 + | /* ServerBuilderConstraintViolations.kt:84 */
|
3486 4062 | impl ::std::error::Error for ConstraintViolation {}
|
4063 + | /* ServerBuilderGenerator.kt:446 */
|
3487 4064 | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
3488 4065 | type Error = ConstraintViolation;
|
3489 4066 |
|
3490 4067 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
3491 4068 | builder.build()
|
3492 4069 | }
|
3493 4070 | }
|
3494 - | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4071 + | /// /* ServerBuilderGenerator.kt:201 */A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4072 + | /* RustType.kt:516 */
|
3495 4073 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4074 + | /* ServerBuilderGenerator.kt:211 */
|
3496 4075 | pub struct Builder {
|
4076 + | /* ServerBuilderGenerator.kt:308 */
|
3497 4077 | pub(crate) path: ::std::option::Option<::std::string::String>,
|
4078 + | /* ServerBuilderGenerator.kt:308 */
|
3498 4079 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
4080 + | /* ServerBuilderGenerator.kt:211 */
|
3499 4081 | }
|
4082 + | /* ServerBuilderGenerator.kt:215 */
|
3500 4083 | impl Builder {
|
3501 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
4084 + | /// /* ServerBuilderGenerator.kt:331 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
4085 + | /* ServerBuilderGenerator.kt:343 */
|
3502 4086 | pub fn path(mut self, input: ::std::string::String) -> Self {
|
3503 - | self.path = Some(input);
|
4087 + | /* ServerBuilderGenerator.kt:344 */
|
4088 + | self.path =
|
4089 + | /* ServerBuilderGenerator.kt:345 */Some(
|
4090 + | /* ServerBuilderGenerator.kt:376 */input
|
4091 + | /* ServerBuilderGenerator.kt:345 */)
|
4092 + | /* ServerBuilderGenerator.kt:344 */;
|
3504 4093 | self
|
4094 + | /* ServerBuilderGenerator.kt:343 */
|
3505 4095 | }
|
3506 - | /// A detailed description of the validation failure.
|
4096 + | /// /* ServerBuilderGenerator.kt:331 */A detailed description of the validation failure.
|
4097 + | /* ServerBuilderGenerator.kt:343 */
|
3507 4098 | pub fn message(mut self, input: ::std::string::String) -> Self {
|
3508 - | self.message = Some(input);
|
4099 + | /* ServerBuilderGenerator.kt:344 */
|
4100 + | self.message =
|
4101 + | /* ServerBuilderGenerator.kt:345 */Some(
|
4102 + | /* ServerBuilderGenerator.kt:376 */input
|
4103 + | /* ServerBuilderGenerator.kt:345 */)
|
4104 + | /* ServerBuilderGenerator.kt:344 */;
|
3509 4105 | self
|
4106 + | /* ServerBuilderGenerator.kt:343 */
|
3510 4107 | }
|
3511 - | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
3512 - | ///
|
4108 + | /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4109 + | /// /* ServerBuilderGenerator.kt:260 */
|
3513 4110 | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
|
3514 4111 | ///
|
3515 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
4112 + | /// /* ServerBuilderGenerator.kt:268 */If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
4113 + | /* ServerBuilderGenerator.kt:271 */
|
3516 4114 | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
3517 4115 | self.build_enforcing_all_constraints()
|
3518 4116 | }
|
4117 + | /* ServerBuilderGenerator.kt:283 */
|
3519 4118 | fn build_enforcing_all_constraints(
|
3520 4119 | self,
|
3521 4120 | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
3522 - | Ok(crate::model::ValidationExceptionField {
|
3523 - | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
3524 - | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
3525 - | })
|
4121 + | /* ServerBuilderGenerator.kt:287 */
|
4122 + | Ok(
|
4123 + | /* ServerBuilderGenerator.kt:542 */
|
4124 + | crate::model::ValidationExceptionField {
|
4125 + | /* ServerBuilderGenerator.kt:546 */
|
4126 + | path: self
|
4127 + | .path
|
4128 + | /* ServerBuilderGenerator.kt:569 */
|
4129 + | .ok_or(ConstraintViolation::MissingPath)?,
|
4130 + | /* ServerBuilderGenerator.kt:546 */
|
4131 + | message: self
|
4132 + | .message
|
4133 + | /* ServerBuilderGenerator.kt:569 */
|
4134 + | .ok_or(ConstraintViolation::MissingMessage)?,
|
4135 + | /* ServerBuilderGenerator.kt:542 */
|
4136 + | }, /* ServerBuilderGenerator.kt:287 */
|
4137 + | )
|
4138 + | /* ServerBuilderGenerator.kt:283 */
|
3526 4139 | }
|
4140 + | /* ServerBuilderGenerator.kt:215 */
|
3527 4141 | }
|
4142 + |
|
4143 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3528 4144 | }
|
3529 - | /// See [`SensitivePatternString`](crate::model::SensitivePatternString).
|
4145 + | /// /* CodegenDelegator.kt:51 */See [`SensitivePatternString`](crate::model::SensitivePatternString).
|
3530 4146 | pub mod sensitive_pattern_string {
|
3531 4147 |
|
4148 + | /* ConstrainedStringGenerator.kt:155 */
|
3532 4149 | #[derive(Debug, PartialEq)]
|
3533 4150 | pub enum ConstraintViolation {
|
3534 4151 | /// Error when a string doesn't satisfy its `@pattern`.
|
3535 4152 | /// Contains the String that failed the pattern.
|
3536 4153 | Pattern(String),
|
3537 4154 | }
|
3538 4155 |
|
3539 4156 | impl ::std::fmt::Display for ConstraintViolation {
|
3540 4157 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3541 4158 | let message = match self {
|
3542 4159 | Self::Pattern(_) => {
|
3543 4160 | format!(
|
3544 4161 | r#"Value provided for `aws.protocoltests.restjson.validation#SensitivePatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
3545 4162 | r#"^[a-m]+$"#
|
3546 4163 | )
|
3547 4164 | }
|
3548 4165 | };
|
3549 4166 | write!(f, "{message}")
|
3550 4167 | }
|
3551 4168 | }
|
3552 4169 |
|
3553 4170 | impl ::std::error::Error for ConstraintViolation {}
|
4171 + | /* ConstrainedStringGenerator.kt:180 */
|
3554 4172 | impl ConstraintViolation {
|
3555 4173 | pub(crate) fn as_validation_exception_field(
|
3556 4174 | self,
|
3557 4175 | path: ::std::string::String,
|
3558 4176 | ) -> crate::model::ValidationExceptionField {
|
3559 4177 | match self {
|
3560 4178 | #[allow(unused_variables)]
|
3561 4179 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
3562 4180 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[a-m]+$"#),
|
3563 4181 | path
|
3564 4182 | },
|
3565 4183 | }
|
3566 4184 | }
|
3567 4185 | }
|
4186 + |
|
4187 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3568 4188 | }
|
3569 4189 | pub mod recursive_union_one {
|
3570 4190 |
|
4191 + | /* RustType.kt:516 */
|
3571 4192 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4193 + | /* UnconstrainedUnionGenerator.kt:150 */
|
3572 4194 | #[allow(clippy::enum_variant_names)]
|
3573 4195 | pub enum ConstraintViolation {
|
4196 + | /* UnconstrainedUnionGenerator.kt:218 */
|
3574 4197 | String(crate::model::recursive_enum_string::ConstraintViolation),
|
4198 + | /* UnconstrainedUnionGenerator.kt:218 */
|
3575 4199 | Union(::std::boxed::Box<crate::model::recursive_union_two::ConstraintViolation>),
|
4200 + | /* UnconstrainedUnionGenerator.kt:150 */
|
3576 4201 | }
|
4202 + | /* UnconstrainedUnionGenerator.kt:158 */
|
3577 4203 | impl ::std::fmt::Display for ConstraintViolation {
|
3578 4204 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3579 4205 | match self {
|
3580 4206 | Self::String(inner) => write!(f, "{inner}"),
|
3581 4207 | Self::Union(inner) => write!(f, "{inner}"),
|
3582 4208 | }
|
3583 4209 | }
|
3584 4210 | }
|
3585 4211 |
|
3586 4212 | impl ::std::error::Error for ConstraintViolation {}
|
4213 + | /* UnconstrainedUnionGenerator.kt:176 */
|
3587 4214 | impl ConstraintViolation {
|
3588 4215 | pub(crate) fn as_validation_exception_field(
|
3589 4216 | self,
|
3590 4217 | path: ::std::string::String,
|
3591 4218 | ) -> crate::model::ValidationExceptionField {
|
3592 4219 | match self {
|
3593 4220 | Self::String(inner) => inner.as_validation_exception_field(path + "/string"),
|
3594 4221 | Self::Union(inner) => inner.as_validation_exception_field(path + "/union"),
|
3595 4222 | }
|
3596 4223 | }
|
3597 4224 | }
|
4225 + |
|
4226 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3598 4227 | }
|
3599 4228 | pub mod recursive_union_two {
|
3600 4229 |
|
4230 + | /* RustType.kt:516 */
|
3601 4231 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4232 + | /* UnconstrainedUnionGenerator.kt:150 */
|
3602 4233 | #[allow(clippy::enum_variant_names)]
|
3603 4234 | pub enum ConstraintViolation {
|
4235 + | /* UnconstrainedUnionGenerator.kt:218 */
|
3604 4236 | String(crate::model::recursive_enum_string::ConstraintViolation),
|
4237 + | /* UnconstrainedUnionGenerator.kt:218 */
|
3605 4238 | Union(crate::model::recursive_union_one::ConstraintViolation),
|
4239 + | /* UnconstrainedUnionGenerator.kt:150 */
|
3606 4240 | }
|
4241 + | /* UnconstrainedUnionGenerator.kt:158 */
|
3607 4242 | impl ::std::fmt::Display for ConstraintViolation {
|
3608 4243 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3609 4244 | match self {
|
3610 4245 | Self::String(inner) => write!(f, "{inner}"),
|
3611 4246 | Self::Union(inner) => write!(f, "{inner}"),
|
3612 4247 | }
|
3613 4248 | }
|
3614 4249 | }
|
3615 4250 |
|
3616 4251 | impl ::std::error::Error for ConstraintViolation {}
|
4252 + | /* UnconstrainedUnionGenerator.kt:176 */
|
3617 4253 | impl ConstraintViolation {
|
3618 4254 | pub(crate) fn as_validation_exception_field(
|
3619 4255 | self,
|
3620 4256 | path: ::std::string::String,
|
3621 4257 | ) -> crate::model::ValidationExceptionField {
|
3622 4258 | match self {
|
3623 4259 | Self::String(inner) => inner.as_validation_exception_field(path + "/string"),
|
3624 4260 | Self::Union(inner) => inner.as_validation_exception_field(path + "/union"),
|
3625 4261 | }
|
3626 4262 | }
|
3627 4263 | }
|
4264 + |
|
4265 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3628 4266 | }
|
3629 - | /// See [`UnionSet`](crate::model::UnionSet).
|
4267 + | /// /* CodegenDelegator.kt:51 */See [`UnionSet`](crate::model::UnionSet).
|
3630 4268 | pub mod union_set {
|
3631 4269 |
|
4270 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
3632 4271 | #[allow(clippy::enum_variant_names)]
|
3633 4272 | #[derive(Debug, PartialEq)]
|
3634 4273 | pub enum ConstraintViolation {
|
3635 4274 | /// Constraint violation error when the list does not contain unique items
|
3636 4275 | UniqueItems {
|
3637 4276 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
3638 4277 | /// at least two elements.
|
3639 4278 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
3640 4279 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
3641 4280 | /// Nothing is guaranteed about the order of the indices.
|
3642 4281 | duplicate_indices: ::std::vec::Vec<usize>,
|
3643 4282 | /// The original vector, that contains duplicate items.
|
3644 4283 | original: ::std::vec::Vec<crate::model::FooUnion>,
|
3645 4284 | },
|
3646 4285 | }
|
3647 4286 |
|
3648 4287 | impl ::std::fmt::Display for ConstraintViolation {
|
3649 4288 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3650 4289 | let message = match self {
|
3651 4290 | Self::UniqueItems { duplicate_indices, .. } =>
|
3652 4291 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#UnionSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
3653 4292 | };
|
3654 4293 | write!(f, "{message}")
|
3655 4294 | }
|
3656 4295 | }
|
3657 4296 |
|
3658 4297 | impl ::std::error::Error for ConstraintViolation {}
|
4298 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
3659 4299 | impl ConstraintViolation {
|
3660 4300 | pub(crate) fn as_validation_exception_field(
|
3661 4301 | self,
|
3662 4302 | path: ::std::string::String,
|
3663 4303 | ) -> crate::model::ValidationExceptionField {
|
3664 4304 | match self {
|
3665 4305 | Self::UniqueItems { duplicate_indices, .. } =>
|
3666 4306 | crate::model::ValidationExceptionField {
|
3667 4307 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
3668 4308 | path,
|
3669 4309 | },
|
3670 4310 | }
|
3671 4311 | }
|
3672 4312 | }
|
4313 + |
|
4314 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3673 4315 | }
|
3674 - | /// See [`StructureSetWithNoKey`](crate::model::StructureSetWithNoKey).
|
4316 + | /// /* CodegenDelegator.kt:51 */See [`StructureSetWithNoKey`](crate::model::StructureSetWithNoKey).
|
3675 4317 | pub mod structure_set_with_no_key {
|
3676 4318 |
|
4319 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
3677 4320 | #[allow(clippy::enum_variant_names)]
|
3678 4321 | #[derive(Debug, PartialEq)]
|
3679 4322 | pub enum ConstraintViolation {
|
3680 4323 | /// Constraint violation error when the list does not contain unique items
|
3681 4324 | UniqueItems {
|
3682 4325 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
3683 4326 | /// at least two elements.
|
3684 4327 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
3685 4328 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
3686 4329 | /// Nothing is guaranteed about the order of the indices.
|
3687 4330 | duplicate_indices: ::std::vec::Vec<usize>,
|
3688 4331 | /// The original vector, that contains duplicate items.
|
3689 4332 | original: ::std::vec::Vec<crate::model::MissingKeyStructure>,
|
3690 4333 | },
|
3691 4334 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
3692 4335 | /// The first component of the tuple is the index in the collection where the
|
3693 4336 | /// first constraint violation was found.
|
3694 4337 | #[doc(hidden)]
|
3695 4338 | Member(
|
3696 4339 | usize,
|
3697 4340 | crate::model::missing_key_structure::ConstraintViolation,
|
3698 4341 | ),
|
3699 4342 | }
|
3700 4343 |
|
3701 4344 | impl ::std::fmt::Display for ConstraintViolation {
|
3702 4345 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3703 4346 | let message = match self {
|
3704 4347 | Self::UniqueItems { duplicate_indices, .. } =>
|
3705 4348 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.restjson.validation#StructureSetWithNoKey' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
3706 4349 | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
3707 4350 | failing_member)
|
3708 4351 | };
|
3709 4352 | write!(f, "{message}")
|
3710 4353 | }
|
3711 4354 | }
|
3712 4355 |
|
3713 4356 | impl ::std::error::Error for ConstraintViolation {}
|
4357 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
3714 4358 | impl ConstraintViolation {
|
3715 4359 | pub(crate) fn as_validation_exception_field(
|
3716 4360 | self,
|
3717 4361 | path: ::std::string::String,
|
3718 4362 | ) -> crate::model::ValidationExceptionField {
|
3719 4363 | match self {
|
3720 4364 | Self::UniqueItems { duplicate_indices, .. } =>
|
3721 4365 | crate::model::ValidationExceptionField {
|
3722 4366 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
3723 4367 | path,
|
3724 4368 | },
|
3725 4369 | Self::Member(index, member_constraint_violation) =>
|
3726 4370 | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
3727 4371 | }
|
3728 4372 | }
|
3729 4373 | }
|
4374 + |
|
4375 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3730 4376 | }
|
3731 - | /// See [`MissingKeyStructure`](crate::model::MissingKeyStructure).
|
4377 + | /// /* ServerBuilderGenerator.kt:171 */See [`MissingKeyStructure`](crate::model::MissingKeyStructure).
|
3732 4378 | pub mod missing_key_structure {
|
3733 4379 |
|
4380 + | /* RustType.kt:516 */
|
3734 4381 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3735 - | /// Holds one variant for each of the ways the builder can fail.
|
4382 + | /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
|
4383 + | /* RustType.kt:516 */
|
3736 4384 | #[non_exhaustive]
|
4385 + | /* ServerBuilderConstraintViolations.kt:75 */
|
3737 4386 | #[allow(clippy::enum_variant_names)]
|
3738 4387 | pub enum ConstraintViolation {
|
3739 - | /// `hi` was not provided but it is required when building `MissingKeyStructure`.
|
4388 + | /// /* ServerBuilderConstraintViolations.kt:138 */`hi` was not provided but it is required when building `MissingKeyStructure`.
|
4389 + | /* ServerBuilderConstraintViolations.kt:143 */
|
3740 4390 | MissingHi,
|
4391 + | /* ServerBuilderConstraintViolations.kt:75 */
|
3741 4392 | }
|
4393 + | /* ServerBuilderConstraintViolations.kt:117 */
|
3742 4394 | impl ::std::fmt::Display for ConstraintViolation {
|
4395 + | /* ServerBuilderConstraintViolations.kt:118 */
|
3743 4396 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4397 + | /* ServerBuilderConstraintViolations.kt:119 */
|
3744 4398 | match self {
|
4399 + | /* ServerBuilderConstraintViolations.kt:127 */
|
3745 4400 | ConstraintViolation::MissingHi => write!(
|
3746 4401 | f,
|
3747 4402 | "`hi` was not provided but it is required when building `MissingKeyStructure`"
|
3748 4403 | ),
|
4404 + | /* ServerBuilderConstraintViolations.kt:119 */
|
3749 4405 | }
|
4406 + | /* ServerBuilderConstraintViolations.kt:118 */
|
3750 4407 | }
|
4408 + | /* ServerBuilderConstraintViolations.kt:117 */
|
3751 4409 | }
|
4410 + | /* ServerBuilderConstraintViolations.kt:84 */
|
3752 4411 | impl ::std::error::Error for ConstraintViolation {}
|
4412 + | /* ServerBuilderConstraintViolations.kt:171 */
|
3753 4413 | impl ConstraintViolation {
|
3754 4414 | pub(crate) fn as_validation_exception_field(
|
3755 4415 | self,
|
3756 4416 | path: ::std::string::String,
|
3757 4417 | ) -> crate::model::ValidationExceptionField {
|
3758 4418 | match self {
|
3759 4419 | ConstraintViolation::MissingHi => crate::model::ValidationExceptionField {
|
3760 4420 | message: format!(
|
3761 4421 | "Value at '{}/hi' failed to satisfy constraint: Member must not be null",
|
3762 4422 | path
|
3763 4423 | ),
|
3764 4424 | path: path + "/hi",
|
3765 4425 | },
|
3766 4426 | }
|
3767 4427 | }
|
3768 4428 | }
|
4429 + | /* ServerBuilderGenerator.kt:244 */
|
3769 4430 | impl ::std::convert::From<Builder>
|
3770 4431 | for crate::constrained::MaybeConstrained<crate::model::MissingKeyStructure>
|
3771 4432 | {
|
3772 4433 | fn from(builder: Builder) -> Self {
|
3773 4434 | Self::Unconstrained(builder)
|
3774 4435 | }
|
3775 4436 | }
|
4437 + | /* ServerBuilderGenerator.kt:446 */
|
3776 4438 | impl ::std::convert::TryFrom<Builder> for crate::model::MissingKeyStructure {
|
3777 4439 | type Error = ConstraintViolation;
|
3778 4440 |
|
3779 4441 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
3780 4442 | builder.build()
|
3781 4443 | }
|
3782 4444 | }
|
3783 - | /// A builder for [`MissingKeyStructure`](crate::model::MissingKeyStructure).
|
4445 + | /// /* ServerBuilderGenerator.kt:201 */A builder for [`MissingKeyStructure`](crate::model::MissingKeyStructure).
|
4446 + | /* RustType.kt:516 */
|
3784 4447 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4448 + | /* ServerBuilderGenerator.kt:211 */
|
3785 4449 | pub struct Builder {
|
4450 + | /* ServerBuilderGenerator.kt:308 */
|
3786 4451 | pub(crate) hi: ::std::option::Option<::std::string::String>,
|
4452 + | /* ServerBuilderGenerator.kt:211 */
|
3787 4453 | }
|
4454 + | /* ServerBuilderGenerator.kt:215 */
|
3788 4455 | impl Builder {
|
4456 + | /* ServerBuilderGenerator.kt:331 */
|
3789 4457 | #[allow(missing_docs)] // documentation missing in model
|
4458 + | /* ServerBuilderGenerator.kt:343 */
|
3790 4459 | pub fn hi(mut self, input: ::std::string::String) -> Self {
|
3791 - | self.hi = Some(input);
|
4460 + | /* ServerBuilderGenerator.kt:344 */
|
4461 + | self.hi =
|
4462 + | /* ServerBuilderGenerator.kt:345 */Some(
|
4463 + | /* ServerBuilderGenerator.kt:376 */input
|
4464 + | /* ServerBuilderGenerator.kt:345 */)
|
4465 + | /* ServerBuilderGenerator.kt:344 */;
|
3792 4466 | self
|
4467 + | /* ServerBuilderGenerator.kt:343 */
|
3793 4468 | }
|
4469 + | /* ServerBuilderGenerator.kt:426 */
|
3794 4470 | #[allow(missing_docs)] // documentation missing in model
|
4471 + | /* ServerBuilderGenerator.kt:428 */
|
3795 4472 | pub(crate) fn set_hi(
|
3796 4473 | mut self,
|
3797 4474 | input: impl ::std::convert::Into<::std::string::String>,
|
3798 4475 | ) -> Self {
|
4476 + | /* ServerBuilderGenerator.kt:429 */
|
3799 4477 | self.hi = Some(input.into());
|
3800 4478 | self
|
4479 + | /* ServerBuilderGenerator.kt:428 */
|
3801 4480 | }
|
3802 - | /// Consumes the builder and constructs a [`MissingKeyStructure`](crate::model::MissingKeyStructure).
|
3803 - | ///
|
4481 + | /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MissingKeyStructure`](crate::model::MissingKeyStructure).
|
4482 + | /// /* ServerBuilderGenerator.kt:260 */
|
3804 4483 | /// The builder fails to construct a [`MissingKeyStructure`](crate::model::MissingKeyStructure) if a [`ConstraintViolation`] occurs.
|
3805 4484 | ///
|
4485 + | /* ServerBuilderGenerator.kt:271 */
|
3806 4486 | pub fn build(self) -> Result<crate::model::MissingKeyStructure, ConstraintViolation> {
|
3807 4487 | self.build_enforcing_all_constraints()
|
3808 4488 | }
|
4489 + | /* ServerBuilderGenerator.kt:283 */
|
3809 4490 | fn build_enforcing_all_constraints(
|
3810 4491 | self,
|
3811 4492 | ) -> Result<crate::model::MissingKeyStructure, ConstraintViolation> {
|
3812 - | Ok(crate::model::MissingKeyStructure {
|
3813 - | hi: self.hi.ok_or(ConstraintViolation::MissingHi)?,
|
3814 - | })
|
4493 + | /* ServerBuilderGenerator.kt:287 */
|
4494 + | Ok(
|
4495 + | /* ServerBuilderGenerator.kt:542 */
|
4496 + | crate::model::MissingKeyStructure {
|
4497 + | /* ServerBuilderGenerator.kt:546 */
|
4498 + | hi: self
|
4499 + | .hi
|
4500 + | /* ServerBuilderGenerator.kt:569 */
|
4501 + | .ok_or(ConstraintViolation::MissingHi)?,
|
4502 + | /* ServerBuilderGenerator.kt:542 */
|
4503 + | }, /* ServerBuilderGenerator.kt:287 */
|
4504 + | )
|
4505 + | /* ServerBuilderGenerator.kt:283 */
|
3815 4506 | }
|
4507 + | /* ServerBuilderGenerator.kt:215 */
|
3816 4508 | }
|
4509 + |
|
4510 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3817 4511 | }
|
3818 - | /// See [`StructureSet`](crate::model::StructureSet).
|
4512 + | /// /* CodegenDelegator.kt:51 */See [`StructureSet`](crate::model::StructureSet).
|
3819 4513 | pub mod structure_set {
|
3820 4514 |
|
4515 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
3821 4516 | #[allow(clippy::enum_variant_names)]
|
3822 4517 | #[derive(Debug, PartialEq)]
|
3823 4518 | pub enum ConstraintViolation {
|
3824 4519 | /// Constraint violation error when the list does not contain unique items
|
3825 4520 | UniqueItems {
|
3826 4521 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
3827 4522 | /// at least two elements.
|
3828 4523 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
3829 4524 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
3830 4525 | /// Nothing is guaranteed about the order of the indices.
|
3831 4526 | duplicate_indices: ::std::vec::Vec<usize>,
|
3832 4527 | /// The original vector, that contains duplicate items.
|
3833 4528 | original: ::std::vec::Vec<crate::model::GreetingStruct>,
|
3834 4529 | },
|
3835 4530 | }
|
3836 4531 |
|
3837 4532 | impl ::std::fmt::Display for ConstraintViolation {
|
3838 4533 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3839 4534 | let message = match self {
|
3840 4535 | Self::UniqueItems { duplicate_indices, .. } =>
|
3841 4536 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#StructureSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
3842 4537 | };
|
3843 4538 | write!(f, "{message}")
|
3844 4539 | }
|
3845 4540 | }
|
3846 4541 |
|
3847 4542 | impl ::std::error::Error for ConstraintViolation {}
|
4543 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
3848 4544 | impl ConstraintViolation {
|
3849 4545 | pub(crate) fn as_validation_exception_field(
|
3850 4546 | self,
|
3851 4547 | path: ::std::string::String,
|
3852 4548 | ) -> crate::model::ValidationExceptionField {
|
3853 4549 | match self {
|
3854 4550 | Self::UniqueItems { duplicate_indices, .. } =>
|
3855 4551 | crate::model::ValidationExceptionField {
|
3856 4552 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
3857 4553 | path,
|
3858 4554 | },
|
3859 4555 | }
|
3860 4556 | }
|
3861 4557 | }
|
4558 + |
|
4559 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3862 4560 | }
|
3863 - | /// See [`GreetingStruct`](crate::model::GreetingStruct).
|
4561 + | /// /* ServerBuilderGenerator.kt:171 */See [`GreetingStruct`](crate::model::GreetingStruct).
|
3864 4562 | pub mod greeting_struct {
|
3865 4563 |
|
4564 + | /* ServerBuilderGenerator.kt:461 */
|
3866 4565 | impl ::std::convert::From<Builder> for crate::model::GreetingStruct {
|
3867 4566 | fn from(builder: Builder) -> Self {
|
3868 4567 | builder.build()
|
3869 4568 | }
|
3870 4569 | }
|
3871 - | /// A builder for [`GreetingStruct`](crate::model::GreetingStruct).
|
4570 + | /// /* ServerBuilderGenerator.kt:201 */A builder for [`GreetingStruct`](crate::model::GreetingStruct).
|
4571 + | /* RustType.kt:516 */
|
3872 4572 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4573 + | /* ServerBuilderGenerator.kt:211 */
|
3873 4574 | pub struct Builder {
|
4575 + | /* ServerBuilderGenerator.kt:308 */
|
3874 4576 | pub(crate) hi: ::std::option::Option<::std::string::String>,
|
4577 + | /* ServerBuilderGenerator.kt:211 */
|
3875 4578 | }
|
4579 + | /* ServerBuilderGenerator.kt:215 */
|
3876 4580 | impl Builder {
|
4581 + | /* ServerBuilderGenerator.kt:331 */
|
3877 4582 | #[allow(missing_docs)] // documentation missing in model
|
4583 + | /* ServerBuilderGenerator.kt:343 */
|
3878 4584 | pub fn hi(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
3879 - | self.hi = input;
|
4585 + | /* ServerBuilderGenerator.kt:344 */
|
4586 + | self.hi =
|
4587 + | /* ServerBuilderGenerator.kt:376 */input
|
4588 + | /* ServerBuilderGenerator.kt:344 */;
|
3880 4589 | self
|
4590 + | /* ServerBuilderGenerator.kt:343 */
|
3881 4591 | }
|
4592 + | /* ServerBuilderGenerator.kt:426 */
|
3882 4593 | #[allow(missing_docs)] // documentation missing in model
|
4594 + | /* ServerBuilderGenerator.kt:428 */
|
3883 4595 | pub(crate) fn set_hi(
|
3884 4596 | mut self,
|
3885 4597 | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
3886 4598 | ) -> Self {
|
4599 + | /* ServerBuilderGenerator.kt:429 */
|
3887 4600 | self.hi = input.map(|v| v.into());
|
3888 4601 | self
|
4602 + | /* ServerBuilderGenerator.kt:428 */
|
3889 4603 | }
|
3890 - | /// Consumes the builder and constructs a [`GreetingStruct`](crate::model::GreetingStruct).
|
4604 + | /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`GreetingStruct`](crate::model::GreetingStruct).
|
4605 + | /* ServerBuilderGenerator.kt:271 */
|
3891 4606 | pub fn build(self) -> crate::model::GreetingStruct {
|
3892 4607 | self.build_enforcing_all_constraints()
|
3893 4608 | }
|
4609 + | /* ServerBuilderGenerator.kt:283 */
|
3894 4610 | fn build_enforcing_all_constraints(self) -> crate::model::GreetingStruct {
|
3895 - | crate::model::GreetingStruct { hi: self.hi }
|
4611 + | /* ServerBuilderGenerator.kt:542 */
|
4612 + | crate::model::GreetingStruct {
|
4613 + | /* ServerBuilderGenerator.kt:546 */
|
4614 + | hi: self.hi,
|
4615 + | /* ServerBuilderGenerator.kt:542 */
|
3896 4616 | }
|
4617 + | /* ServerBuilderGenerator.kt:283 */
|
3897 4618 | }
|
4619 + | /* ServerBuilderGenerator.kt:215 */
|
4620 + | }
|
4621 + |
|
4622 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3898 4623 | }
|
3899 - | /// See [`ListSet`](crate::model::ListSet).
|
4624 + | /// /* CodegenDelegator.kt:51 */See [`ListSet`](crate::model::ListSet).
|
3900 4625 | pub mod list_set {
|
3901 4626 |
|
4627 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
3902 4628 | #[allow(clippy::enum_variant_names)]
|
3903 4629 | #[derive(Debug, PartialEq)]
|
3904 4630 | pub enum ConstraintViolation {
|
3905 4631 | /// Constraint violation error when the list does not contain unique items
|
3906 4632 | UniqueItems {
|
3907 4633 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
3908 4634 | /// at least two elements.
|
3909 4635 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
3910 4636 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
3911 4637 | /// Nothing is guaranteed about the order of the indices.
|
3912 4638 | duplicate_indices: ::std::vec::Vec<usize>,
|
3913 4639 | /// The original vector, that contains duplicate items.
|
3914 4640 | original: ::std::vec::Vec<::std::vec::Vec<::std::string::String>>,
|
3915 4641 | },
|
3916 4642 | }
|
3917 4643 |
|
3918 4644 | impl ::std::fmt::Display for ConstraintViolation {
|
3919 4645 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3920 4646 | let message = match self {
|
3921 4647 | Self::UniqueItems { duplicate_indices, .. } =>
|
3922 4648 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#ListSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
3923 4649 | };
|
3924 4650 | write!(f, "{message}")
|
3925 4651 | }
|
3926 4652 | }
|
3927 4653 |
|
3928 4654 | impl ::std::error::Error for ConstraintViolation {}
|
4655 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
3929 4656 | impl ConstraintViolation {
|
3930 4657 | pub(crate) fn as_validation_exception_field(
|
3931 4658 | self,
|
3932 4659 | path: ::std::string::String,
|
3933 4660 | ) -> crate::model::ValidationExceptionField {
|
3934 4661 | match self {
|
3935 4662 | Self::UniqueItems { duplicate_indices, .. } =>
|
3936 4663 | crate::model::ValidationExceptionField {
|
3937 4664 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
3938 4665 | path,
|
3939 4666 | },
|
3940 4667 | }
|
3941 4668 | }
|
3942 4669 | }
|
4670 + |
|
4671 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3943 4672 | }
|
3944 - | /// See [`IntegerEnumSet`](crate::model::IntegerEnumSet).
|
4673 + | /// /* CodegenDelegator.kt:51 */See [`IntegerEnumSet`](crate::model::IntegerEnumSet).
|
3945 4674 | pub mod integer_enum_set {
|
3946 4675 |
|
4676 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
3947 4677 | #[allow(clippy::enum_variant_names)]
|
3948 4678 | #[derive(Debug, PartialEq)]
|
3949 4679 | pub enum ConstraintViolation {
|
3950 4680 | /// Constraint violation error when the list does not contain unique items
|
3951 4681 | UniqueItems {
|
3952 4682 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
3953 4683 | /// at least two elements.
|
3954 4684 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
3955 4685 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
3956 4686 | /// Nothing is guaranteed about the order of the indices.
|
3957 4687 | duplicate_indices: ::std::vec::Vec<usize>,
|
3958 4688 | /// The original vector, that contains duplicate items.
|
3959 4689 | original: ::std::vec::Vec<i32>,
|
3960 4690 | },
|
3961 4691 | }
|
3962 4692 |
|
3963 4693 | impl ::std::fmt::Display for ConstraintViolation {
|
3964 4694 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3965 4695 | let message = match self {
|
3966 4696 | Self::UniqueItems { duplicate_indices, .. } =>
|
3967 4697 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#IntegerEnumSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
3968 4698 | };
|
3969 4699 | write!(f, "{message}")
|
3970 4700 | }
|
3971 4701 | }
|
3972 4702 |
|
3973 4703 | impl ::std::error::Error for ConstraintViolation {}
|
4704 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
3974 4705 | impl ConstraintViolation {
|
3975 4706 | pub(crate) fn as_validation_exception_field(
|
3976 4707 | self,
|
3977 4708 | path: ::std::string::String,
|
3978 4709 | ) -> crate::model::ValidationExceptionField {
|
3979 4710 | match self {
|
3980 4711 | Self::UniqueItems { duplicate_indices, .. } =>
|
3981 4712 | crate::model::ValidationExceptionField {
|
3982 4713 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
3983 4714 | path,
|
3984 4715 | },
|
3985 4716 | }
|
3986 4717 | }
|
3987 4718 | }
|
4719 + |
|
4720 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3988 4721 | }
|
3989 - | /// See [`FooEnumSet`](crate::model::FooEnumSet).
|
4722 + | /// /* CodegenDelegator.kt:51 */See [`FooEnumSet`](crate::model::FooEnumSet).
|
3990 4723 | pub mod foo_enum_set {
|
3991 4724 |
|
4725 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
3992 4726 | #[allow(clippy::enum_variant_names)]
|
3993 4727 | #[derive(Debug, PartialEq)]
|
3994 4728 | pub enum ConstraintViolation {
|
3995 4729 | /// Constraint violation error when the list does not contain unique items
|
3996 4730 | UniqueItems {
|
3997 4731 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
3998 4732 | /// at least two elements.
|
3999 4733 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4000 4734 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4001 4735 | /// Nothing is guaranteed about the order of the indices.
|
4002 4736 | duplicate_indices: ::std::vec::Vec<usize>,
|
4003 4737 | /// The original vector, that contains duplicate items.
|
4004 4738 | original: ::std::vec::Vec<crate::model::FooEnum>,
|
4005 4739 | },
|
4006 4740 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4007 4741 | /// The first component of the tuple is the index in the collection where the
|
4008 4742 | /// first constraint violation was found.
|
4009 4743 | #[doc(hidden)]
|
4010 4744 | Member(usize, crate::model::foo_enum::ConstraintViolation),
|
4011 4745 | }
|
4012 4746 |
|
4013 4747 | impl ::std::fmt::Display for ConstraintViolation {
|
4014 4748 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4015 4749 | let message = match self {
|
4016 4750 | Self::UniqueItems { duplicate_indices, .. } =>
|
4017 4751 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#FooEnumSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4018 4752 | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
4019 4753 | failing_member)
|
4020 4754 | };
|
4021 4755 | write!(f, "{message}")
|
4022 4756 | }
|
4023 4757 | }
|
4024 4758 |
|
4025 4759 | impl ::std::error::Error for ConstraintViolation {}
|
4760 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
4026 4761 | impl ConstraintViolation {
|
4027 4762 | pub(crate) fn as_validation_exception_field(
|
4028 4763 | self,
|
4029 4764 | path: ::std::string::String,
|
4030 4765 | ) -> crate::model::ValidationExceptionField {
|
4031 4766 | match self {
|
4032 4767 | Self::UniqueItems { duplicate_indices, .. } =>
|
4033 4768 | crate::model::ValidationExceptionField {
|
4034 4769 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4035 4770 | path,
|
4036 4771 | },
|
4037 4772 | Self::Member(index, member_constraint_violation) =>
|
4038 4773 | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
4039 4774 | }
|
4040 4775 | }
|
4041 4776 | }
|
4777 + |
|
4778 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4042 4779 | }
|
4043 - | /// See [`HttpDateSet`](crate::model::HttpDateSet).
|
4780 + | /// /* CodegenDelegator.kt:51 */See [`HttpDateSet`](crate::model::HttpDateSet).
|
4044 4781 | pub mod http_date_set {
|
4045 4782 |
|
4783 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
4046 4784 | #[allow(clippy::enum_variant_names)]
|
4047 4785 | #[derive(Debug, PartialEq)]
|
4048 4786 | pub enum ConstraintViolation {
|
4049 4787 | /// Constraint violation error when the list does not contain unique items
|
4050 4788 | UniqueItems {
|
4051 4789 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4052 4790 | /// at least two elements.
|
4053 4791 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4054 4792 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4055 4793 | /// Nothing is guaranteed about the order of the indices.
|
4056 4794 | duplicate_indices: ::std::vec::Vec<usize>,
|
4057 4795 | /// The original vector, that contains duplicate items.
|
4058 4796 | original: ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
4059 4797 | },
|
4060 4798 | }
|
4061 4799 |
|
4062 4800 | impl ::std::fmt::Display for ConstraintViolation {
|
4063 4801 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4064 4802 | let message = match self {
|
4065 4803 | Self::UniqueItems { duplicate_indices, .. } =>
|
4066 4804 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#HttpDateSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4067 4805 | };
|
4068 4806 | write!(f, "{message}")
|
4069 4807 | }
|
4070 4808 | }
|
4071 4809 |
|
4072 4810 | impl ::std::error::Error for ConstraintViolation {}
|
4811 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
4073 4812 | impl ConstraintViolation {
|
4074 4813 | pub(crate) fn as_validation_exception_field(
|
4075 4814 | self,
|
4076 4815 | path: ::std::string::String,
|
4077 4816 | ) -> crate::model::ValidationExceptionField {
|
4078 4817 | match self {
|
4079 4818 | Self::UniqueItems { duplicate_indices, .. } =>
|
4080 4819 | crate::model::ValidationExceptionField {
|
4081 4820 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4082 4821 | path,
|
4083 4822 | },
|
4084 4823 | }
|
4085 4824 | }
|
4086 4825 | }
|
4826 + |
|
4827 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4087 4828 | }
|
4088 - | /// See [`DateTimeSet`](crate::model::DateTimeSet).
|
4829 + | /// /* CodegenDelegator.kt:51 */See [`DateTimeSet`](crate::model::DateTimeSet).
|
4089 4830 | pub mod date_time_set {
|
4090 4831 |
|
4832 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
4091 4833 | #[allow(clippy::enum_variant_names)]
|
4092 4834 | #[derive(Debug, PartialEq)]
|
4093 4835 | pub enum ConstraintViolation {
|
4094 4836 | /// Constraint violation error when the list does not contain unique items
|
4095 4837 | UniqueItems {
|
4096 4838 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4097 4839 | /// at least two elements.
|
4098 4840 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4099 4841 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4100 4842 | /// Nothing is guaranteed about the order of the indices.
|
4101 4843 | duplicate_indices: ::std::vec::Vec<usize>,
|
4102 4844 | /// The original vector, that contains duplicate items.
|
4103 4845 | original: ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
4104 4846 | },
|
4105 4847 | }
|
4106 4848 |
|
4107 4849 | impl ::std::fmt::Display for ConstraintViolation {
|
4108 4850 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4109 4851 | let message = match self {
|
4110 4852 | Self::UniqueItems { duplicate_indices, .. } =>
|
4111 4853 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#DateTimeSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4112 4854 | };
|
4113 4855 | write!(f, "{message}")
|
4114 4856 | }
|
4115 4857 | }
|
4116 4858 |
|
4117 4859 | impl ::std::error::Error for ConstraintViolation {}
|
4860 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
4118 4861 | impl ConstraintViolation {
|
4119 4862 | pub(crate) fn as_validation_exception_field(
|
4120 4863 | self,
|
4121 4864 | path: ::std::string::String,
|
4122 4865 | ) -> crate::model::ValidationExceptionField {
|
4123 4866 | match self {
|
4124 4867 | Self::UniqueItems { duplicate_indices, .. } =>
|
4125 4868 | crate::model::ValidationExceptionField {
|
4126 4869 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4127 4870 | path,
|
4128 4871 | },
|
4129 4872 | }
|
4130 4873 | }
|
4131 4874 | }
|
4875 + |
|
4876 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4132 4877 | }
|
4133 - | /// See [`TimestampSet`](crate::model::TimestampSet).
|
4878 + | /// /* CodegenDelegator.kt:51 */See [`TimestampSet`](crate::model::TimestampSet).
|
4134 4879 | pub mod timestamp_set {
|
4135 4880 |
|
4881 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
4136 4882 | #[allow(clippy::enum_variant_names)]
|
4137 4883 | #[derive(Debug, PartialEq)]
|
4138 4884 | pub enum ConstraintViolation {
|
4139 4885 | /// Constraint violation error when the list does not contain unique items
|
4140 4886 | UniqueItems {
|
4141 4887 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4142 4888 | /// at least two elements.
|
4143 4889 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4144 4890 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4145 4891 | /// Nothing is guaranteed about the order of the indices.
|
4146 4892 | duplicate_indices: ::std::vec::Vec<usize>,
|
4147 4893 | /// The original vector, that contains duplicate items.
|
4148 4894 | original: ::std::vec::Vec<::aws_smithy_types::DateTime>,
|
4149 4895 | },
|
4150 4896 | }
|
4151 4897 |
|
4152 4898 | impl ::std::fmt::Display for ConstraintViolation {
|
4153 4899 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4154 4900 | let message = match self {
|
4155 4901 | Self::UniqueItems { duplicate_indices, .. } =>
|
4156 4902 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#TimestampSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4157 4903 | };
|
4158 4904 | write!(f, "{message}")
|
4159 4905 | }
|
4160 4906 | }
|
4161 4907 |
|
4162 4908 | impl ::std::error::Error for ConstraintViolation {}
|
4909 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
4163 4910 | impl ConstraintViolation {
|
4164 4911 | pub(crate) fn as_validation_exception_field(
|
4165 4912 | self,
|
4166 4913 | path: ::std::string::String,
|
4167 4914 | ) -> crate::model::ValidationExceptionField {
|
4168 4915 | match self {
|
4169 4916 | Self::UniqueItems { duplicate_indices, .. } =>
|
4170 4917 | crate::model::ValidationExceptionField {
|
4171 4918 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4172 4919 | path,
|
4173 4920 | },
|
4174 4921 | }
|
4175 4922 | }
|
4176 4923 | }
|
4924 + |
|
4925 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4177 4926 | }
|
4178 - | /// See [`LongSet`](crate::model::LongSet).
|
4927 + | /// /* CodegenDelegator.kt:51 */See [`LongSet`](crate::model::LongSet).
|
4179 4928 | pub mod long_set {
|
4180 4929 |
|
4930 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
4181 4931 | #[allow(clippy::enum_variant_names)]
|
4182 4932 | #[derive(Debug, PartialEq)]
|
4183 4933 | pub enum ConstraintViolation {
|
4184 4934 | /// Constraint violation error when the list does not contain unique items
|
4185 4935 | UniqueItems {
|
4186 4936 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4187 4937 | /// at least two elements.
|
4188 4938 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4189 4939 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4190 4940 | /// Nothing is guaranteed about the order of the indices.
|
4191 4941 | duplicate_indices: ::std::vec::Vec<usize>,
|
4192 4942 | /// The original vector, that contains duplicate items.
|
4193 4943 | original: ::std::vec::Vec<i64>,
|
4194 4944 | },
|
4195 4945 | }
|
4196 4946 |
|
4197 4947 | impl ::std::fmt::Display for ConstraintViolation {
|
4198 4948 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4199 4949 | let message = match self {
|
4200 4950 | Self::UniqueItems { duplicate_indices, .. } =>
|
4201 4951 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#LongSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4202 4952 | };
|
4203 4953 | write!(f, "{message}")
|
4204 4954 | }
|
4205 4955 | }
|
4206 4956 |
|
4207 4957 | impl ::std::error::Error for ConstraintViolation {}
|
4958 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
4208 4959 | impl ConstraintViolation {
|
4209 4960 | pub(crate) fn as_validation_exception_field(
|
4210 4961 | self,
|
4211 4962 | path: ::std::string::String,
|
4212 4963 | ) -> crate::model::ValidationExceptionField {
|
4213 4964 | match self {
|
4214 4965 | Self::UniqueItems { duplicate_indices, .. } =>
|
4215 4966 | crate::model::ValidationExceptionField {
|
4216 4967 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4217 4968 | path,
|
4218 4969 | },
|
4219 4970 | }
|
4220 4971 | }
|
4221 4972 | }
|
4973 + |
|
4974 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4222 4975 | }
|
4223 - | /// See [`IntegerSet`](crate::model::IntegerSet).
|
4976 + | /// /* CodegenDelegator.kt:51 */See [`IntegerSet`](crate::model::IntegerSet).
|
4224 4977 | pub mod integer_set {
|
4225 4978 |
|
4979 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
4226 4980 | #[allow(clippy::enum_variant_names)]
|
4227 4981 | #[derive(Debug, PartialEq)]
|
4228 4982 | pub enum ConstraintViolation {
|
4229 4983 | /// Constraint violation error when the list does not contain unique items
|
4230 4984 | UniqueItems {
|
4231 4985 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4232 4986 | /// at least two elements.
|
4233 4987 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4234 4988 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4235 4989 | /// Nothing is guaranteed about the order of the indices.
|
4236 4990 | duplicate_indices: ::std::vec::Vec<usize>,
|
4237 4991 | /// The original vector, that contains duplicate items.
|
4238 4992 | original: ::std::vec::Vec<i32>,
|
4239 4993 | },
|
4240 4994 | }
|
4241 4995 |
|
4242 4996 | impl ::std::fmt::Display for ConstraintViolation {
|
4243 4997 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4244 4998 | let message = match self {
|
4245 4999 | Self::UniqueItems { duplicate_indices, .. } =>
|
4246 5000 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#IntegerSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4247 5001 | };
|
4248 5002 | write!(f, "{message}")
|
4249 5003 | }
|
4250 5004 | }
|
4251 5005 |
|
4252 5006 | impl ::std::error::Error for ConstraintViolation {}
|
5007 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
4253 5008 | impl ConstraintViolation {
|
4254 5009 | pub(crate) fn as_validation_exception_field(
|
4255 5010 | self,
|
4256 5011 | path: ::std::string::String,
|
4257 5012 | ) -> crate::model::ValidationExceptionField {
|
4258 5013 | match self {
|
4259 5014 | Self::UniqueItems { duplicate_indices, .. } =>
|
4260 5015 | crate::model::ValidationExceptionField {
|
4261 5016 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4262 5017 | path,
|
4263 5018 | },
|
4264 5019 | }
|
4265 5020 | }
|
4266 5021 | }
|
5022 + |
|
5023 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4267 5024 | }
|
4268 - | /// See [`ShortSet`](crate::model::ShortSet).
|
5025 + | /// /* CodegenDelegator.kt:51 */See [`ShortSet`](crate::model::ShortSet).
|
4269 5026 | pub mod short_set {
|
4270 5027 |
|
5028 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
4271 5029 | #[allow(clippy::enum_variant_names)]
|
4272 5030 | #[derive(Debug, PartialEq)]
|
4273 5031 | pub enum ConstraintViolation {
|
4274 5032 | /// Constraint violation error when the list does not contain unique items
|
4275 5033 | UniqueItems {
|
4276 5034 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4277 5035 | /// at least two elements.
|
4278 5036 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4279 5037 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4280 5038 | /// Nothing is guaranteed about the order of the indices.
|
4281 5039 | duplicate_indices: ::std::vec::Vec<usize>,
|
4282 5040 | /// The original vector, that contains duplicate items.
|
4283 5041 | original: ::std::vec::Vec<i16>,
|
4284 5042 | },
|
4285 5043 | }
|
4286 5044 |
|
4287 5045 | impl ::std::fmt::Display for ConstraintViolation {
|
4288 5046 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4289 5047 | let message = match self {
|
4290 5048 | Self::UniqueItems { duplicate_indices, .. } =>
|
4291 5049 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#ShortSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4292 5050 | };
|
4293 5051 | write!(f, "{message}")
|
4294 5052 | }
|
4295 5053 | }
|
4296 5054 |
|
4297 5055 | impl ::std::error::Error for ConstraintViolation {}
|
5056 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
4298 5057 | impl ConstraintViolation {
|
4299 5058 | pub(crate) fn as_validation_exception_field(
|
4300 5059 | self,
|
4301 5060 | path: ::std::string::String,
|
4302 5061 | ) -> crate::model::ValidationExceptionField {
|
4303 5062 | match self {
|
4304 5063 | Self::UniqueItems { duplicate_indices, .. } =>
|
4305 5064 | crate::model::ValidationExceptionField {
|
4306 5065 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4307 5066 | path,
|
4308 5067 | },
|
4309 5068 | }
|
4310 5069 | }
|
4311 5070 | }
|
5071 + |
|
5072 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4312 5073 | }
|
4313 - | /// See [`ByteSet`](crate::model::ByteSet).
|
5074 + | /// /* CodegenDelegator.kt:51 */See [`ByteSet`](crate::model::ByteSet).
|
4314 5075 | pub mod byte_set {
|
4315 5076 |
|
5077 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
4316 5078 | #[allow(clippy::enum_variant_names)]
|
4317 5079 | #[derive(Debug, PartialEq)]
|
4318 5080 | pub enum ConstraintViolation {
|
4319 5081 | /// Constraint violation error when the list does not contain unique items
|
4320 5082 | UniqueItems {
|
4321 5083 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4322 5084 | /// at least two elements.
|
4323 5085 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4324 5086 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4325 5087 | /// Nothing is guaranteed about the order of the indices.
|
4326 5088 | duplicate_indices: ::std::vec::Vec<usize>,
|
4327 5089 | /// The original vector, that contains duplicate items.
|
4328 5090 | original: ::std::vec::Vec<i8>,
|
4329 5091 | },
|
4330 5092 | }
|
4331 5093 |
|
4332 5094 | impl ::std::fmt::Display for ConstraintViolation {
|
4333 5095 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4334 5096 | let message = match self {
|
4335 5097 | Self::UniqueItems { duplicate_indices, .. } =>
|
4336 5098 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#ByteSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4337 5099 | };
|
4338 5100 | write!(f, "{message}")
|
4339 5101 | }
|
4340 5102 | }
|
4341 5103 |
|
4342 5104 | impl ::std::error::Error for ConstraintViolation {}
|
5105 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
4343 5106 | impl ConstraintViolation {
|
4344 5107 | pub(crate) fn as_validation_exception_field(
|
4345 5108 | self,
|
4346 5109 | path: ::std::string::String,
|
4347 5110 | ) -> crate::model::ValidationExceptionField {
|
4348 5111 | match self {
|
4349 5112 | Self::UniqueItems { duplicate_indices, .. } =>
|
4350 5113 | crate::model::ValidationExceptionField {
|
4351 5114 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4352 5115 | path,
|
4353 5116 | },
|
4354 5117 | }
|
4355 5118 | }
|
4356 5119 | }
|
5120 + |
|
5121 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4357 5122 | }
|
4358 - | /// See [`StringSet`](crate::model::StringSet).
|
5123 + | /// /* CodegenDelegator.kt:51 */See [`StringSet`](crate::model::StringSet).
|
4359 5124 | pub mod string_set {
|
4360 5125 |
|
5126 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
4361 5127 | #[allow(clippy::enum_variant_names)]
|
4362 5128 | #[derive(Debug, PartialEq)]
|
4363 5129 | pub enum ConstraintViolation {
|
4364 5130 | /// Constraint violation error when the list does not contain unique items
|
4365 5131 | UniqueItems {
|
4366 5132 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4367 5133 | /// at least two elements.
|
4368 5134 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4369 5135 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4370 5136 | /// Nothing is guaranteed about the order of the indices.
|
4371 5137 | duplicate_indices: ::std::vec::Vec<usize>,
|
4372 5138 | /// The original vector, that contains duplicate items.
|
4373 5139 | original: ::std::vec::Vec<::std::string::String>,
|
4374 5140 | },
|
4375 5141 | }
|
4376 5142 |
|
4377 5143 | impl ::std::fmt::Display for ConstraintViolation {
|
4378 5144 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4379 5145 | let message = match self {
|
4380 5146 | Self::UniqueItems { duplicate_indices, .. } =>
|
4381 5147 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#StringSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4382 5148 | };
|
4383 5149 | write!(f, "{message}")
|
4384 5150 | }
|
4385 5151 | }
|
4386 5152 |
|
4387 5153 | impl ::std::error::Error for ConstraintViolation {}
|
5154 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
4388 5155 | impl ConstraintViolation {
|
4389 5156 | pub(crate) fn as_validation_exception_field(
|
4390 5157 | self,
|
4391 5158 | path: ::std::string::String,
|
4392 5159 | ) -> crate::model::ValidationExceptionField {
|
4393 5160 | match self {
|
4394 5161 | Self::UniqueItems { duplicate_indices, .. } =>
|
4395 5162 | crate::model::ValidationExceptionField {
|
4396 5163 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4397 5164 | path,
|
4398 5165 | },
|
4399 5166 | }
|
4400 5167 | }
|
4401 5168 | }
|
5169 + |
|
5170 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4402 5171 | }
|
4403 - | /// See [`BooleanSet`](crate::model::BooleanSet).
|
5172 + | /// /* CodegenDelegator.kt:51 */See [`BooleanSet`](crate::model::BooleanSet).
|
4404 5173 | pub mod boolean_set {
|
4405 5174 |
|
5175 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
4406 5176 | #[allow(clippy::enum_variant_names)]
|
4407 5177 | #[derive(Debug, PartialEq)]
|
4408 5178 | pub enum ConstraintViolation {
|
4409 5179 | /// Constraint violation error when the list does not contain unique items
|
4410 5180 | UniqueItems {
|
4411 5181 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4412 5182 | /// at least two elements.
|
4413 5183 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4414 5184 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4415 5185 | /// Nothing is guaranteed about the order of the indices.
|
4416 5186 | duplicate_indices: ::std::vec::Vec<usize>,
|
4417 5187 | /// The original vector, that contains duplicate items.
|
4418 5188 | original: ::std::vec::Vec<bool>,
|
4419 5189 | },
|
4420 5190 | }
|
4421 5191 |
|
4422 5192 | impl ::std::fmt::Display for ConstraintViolation {
|
4423 5193 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4424 5194 | let message = match self {
|
4425 5195 | Self::UniqueItems { duplicate_indices, .. } =>
|
4426 5196 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#BooleanSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4427 5197 | };
|
4428 5198 | write!(f, "{message}")
|
4429 5199 | }
|
4430 5200 | }
|
4431 5201 |
|
4432 5202 | impl ::std::error::Error for ConstraintViolation {}
|
5203 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
4433 5204 | impl ConstraintViolation {
|
4434 5205 | pub(crate) fn as_validation_exception_field(
|
4435 5206 | self,
|
4436 5207 | path: ::std::string::String,
|
4437 5208 | ) -> crate::model::ValidationExceptionField {
|
4438 5209 | match self {
|
4439 5210 | Self::UniqueItems { duplicate_indices, .. } =>
|
4440 5211 | crate::model::ValidationExceptionField {
|
4441 5212 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4442 5213 | path,
|
4443 5214 | },
|
4444 5215 | }
|
4445 5216 | }
|
4446 5217 | }
|
5218 + |
|
5219 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4447 5220 | }
|
4448 - | /// See [`BlobSet`](crate::model::BlobSet).
|
5221 + | /// /* CodegenDelegator.kt:51 */See [`BlobSet`](crate::model::BlobSet).
|
4449 5222 | pub mod blob_set {
|
4450 5223 |
|
5224 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
4451 5225 | #[allow(clippy::enum_variant_names)]
|
4452 5226 | #[derive(Debug, PartialEq)]
|
4453 5227 | pub enum ConstraintViolation {
|
4454 5228 | /// Constraint violation error when the list does not contain unique items
|
4455 5229 | UniqueItems {
|
4456 5230 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4457 5231 | /// at least two elements.
|
4458 5232 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4459 5233 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4460 5234 | /// Nothing is guaranteed about the order of the indices.
|
4461 5235 | duplicate_indices: ::std::vec::Vec<usize>,
|
4462 5236 | /// The original vector, that contains duplicate items.
|
4463 5237 | original: ::std::vec::Vec<::aws_smithy_types::Blob>,
|
4464 5238 | },
|
4465 5239 | }
|
4466 5240 |
|
4467 5241 | impl ::std::fmt::Display for ConstraintViolation {
|
4468 5242 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4469 5243 | let message = match self {
|
4470 5244 | Self::UniqueItems { duplicate_indices, .. } =>
|
4471 5245 | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#BlobSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4472 5246 | };
|
4473 5247 | write!(f, "{message}")
|
4474 5248 | }
|
4475 5249 | }
|
4476 5250 |
|
4477 5251 | impl ::std::error::Error for ConstraintViolation {}
|
5252 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
4478 5253 | impl ConstraintViolation {
|
4479 5254 | pub(crate) fn as_validation_exception_field(
|
4480 5255 | self,
|
4481 5256 | path: ::std::string::String,
|
4482 5257 | ) -> crate::model::ValidationExceptionField {
|
4483 5258 | match self {
|
4484 5259 | Self::UniqueItems { duplicate_indices, .. } =>
|
4485 5260 | crate::model::ValidationExceptionField {
|
4486 5261 | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4487 5262 | path,
|
4488 5263 | },
|
4489 5264 | }
|
4490 5265 | }
|
4491 5266 | }
|
5267 + |
|
5268 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4492 5269 | }
|
4493 - | /// See [`MaxLong`](crate::model::MaxLong).
|
5270 + | /// /* CodegenDelegator.kt:51 */See [`MaxLong`](crate::model::MaxLong).
|
4494 5271 | pub mod max_long {
|
4495 5272 |
|
5273 + | /* ConstrainedNumberGenerator.kt:139 */
|
4496 5274 | #[derive(Debug, PartialEq)]
|
4497 5275 | pub enum ConstraintViolation {
|
4498 5276 | Range(i64),
|
4499 5277 | }
|
4500 5278 |
|
4501 5279 | impl ::std::fmt::Display for ConstraintViolation {
|
4502 5280 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4503 5281 | write!(f, "Value for `aws.protocoltests.restjson.validation#MaxLong`failed to satisfy constraint: Member must be less than or equal to 8")
|
4504 5282 | }
|
4505 5283 | }
|
4506 5284 |
|
4507 5285 | impl ::std::error::Error for ConstraintViolation {}
|
5286 + | /* ConstrainedNumberGenerator.kt:159 */
|
4508 5287 | impl ConstraintViolation {
|
4509 5288 | pub(crate) fn as_validation_exception_field(
|
4510 5289 | self,
|
4511 5290 | path: ::std::string::String,
|
4512 5291 | ) -> crate::model::ValidationExceptionField {
|
4513 5292 | match self {
|
4514 5293 | Self::Range(_) => crate::model::ValidationExceptionField {
|
4515 5294 | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 8", &path),
|
4516 5295 | path,
|
4517 5296 | },
|
4518 5297 | }
|
4519 5298 | }
|
4520 5299 | }
|
5300 + |
|
5301 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4521 5302 | }
|
4522 - | /// See [`MinLong`](crate::model::MinLong).
|
5303 + | /// /* CodegenDelegator.kt:51 */See [`MinLong`](crate::model::MinLong).
|
4523 5304 | pub mod min_long {
|
4524 5305 |
|
5306 + | /* ConstrainedNumberGenerator.kt:139 */
|
4525 5307 | #[derive(Debug, PartialEq)]
|
4526 5308 | pub enum ConstraintViolation {
|
4527 5309 | Range(i64),
|
4528 5310 | }
|
4529 5311 |
|
4530 5312 | impl ::std::fmt::Display for ConstraintViolation {
|
4531 5313 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4532 5314 | write!(f, "Value for `aws.protocoltests.restjson.validation#MinLong`failed to satisfy constraint: Member must be greater than or equal to 2")
|
4533 5315 | }
|
4534 5316 | }
|
4535 5317 |
|
4536 5318 | impl ::std::error::Error for ConstraintViolation {}
|
5319 + | /* ConstrainedNumberGenerator.kt:159 */
|
4537 5320 | impl ConstraintViolation {
|
4538 5321 | pub(crate) fn as_validation_exception_field(
|
4539 5322 | self,
|
4540 5323 | path: ::std::string::String,
|
4541 5324 | ) -> crate::model::ValidationExceptionField {
|
4542 5325 | match self {
|
4543 5326 | Self::Range(_) => crate::model::ValidationExceptionField {
|
4544 5327 | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to 2", &path),
|
4545 5328 | path,
|
4546 5329 | },
|
4547 5330 | }
|
4548 5331 | }
|
4549 5332 | }
|
5333 + |
|
5334 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4550 5335 | }
|
4551 - | /// See [`RangeLong`](crate::model::RangeLong).
|
5336 + | /// /* CodegenDelegator.kt:51 */See [`RangeLong`](crate::model::RangeLong).
|
4552 5337 | pub mod range_long {
|
4553 5338 |
|
5339 + | /* ConstrainedNumberGenerator.kt:139 */
|
4554 5340 | #[derive(Debug, PartialEq)]
|
4555 5341 | pub enum ConstraintViolation {
|
4556 5342 | Range(i64),
|
4557 5343 | }
|
4558 5344 |
|
4559 5345 | impl ::std::fmt::Display for ConstraintViolation {
|
4560 5346 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4561 5347 | write!(f, "Value for `aws.protocoltests.restjson.validation#RangeLong`failed to satisfy constraint: Member must be between 2 and 8, inclusive")
|
4562 5348 | }
|
4563 5349 | }
|
4564 5350 |
|
4565 5351 | impl ::std::error::Error for ConstraintViolation {}
|
5352 + | /* ConstrainedNumberGenerator.kt:159 */
|
4566 5353 | impl ConstraintViolation {
|
4567 5354 | pub(crate) fn as_validation_exception_field(
|
4568 5355 | self,
|
4569 5356 | path: ::std::string::String,
|
4570 5357 | ) -> crate::model::ValidationExceptionField {
|
4571 5358 | match self {
|
4572 5359 | Self::Range(_) => crate::model::ValidationExceptionField {
|
4573 5360 | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 2 and 8, inclusive", &path),
|
4574 5361 | path,
|
4575 5362 | },
|
4576 5363 | }
|
4577 5364 | }
|
4578 5365 | }
|
5366 + |
|
5367 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4579 5368 | }
|
4580 - | /// See [`MaxInteger`](crate::model::MaxInteger).
|
5369 + | /// /* CodegenDelegator.kt:51 */See [`MaxInteger`](crate::model::MaxInteger).
|
4581 5370 | pub mod max_integer {
|
4582 5371 |
|
5372 + | /* ConstrainedNumberGenerator.kt:139 */
|
4583 5373 | #[derive(Debug, PartialEq)]
|
4584 5374 | pub enum ConstraintViolation {
|
4585 5375 | Range(i32),
|
4586 5376 | }
|
4587 5377 |
|
4588 5378 | impl ::std::fmt::Display for ConstraintViolation {
|
4589 5379 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4590 5380 | write!(f, "Value for `aws.protocoltests.restjson.validation#MaxInteger`failed to satisfy constraint: Member must be less than or equal to 8")
|
4591 5381 | }
|
4592 5382 | }
|
4593 5383 |
|
4594 5384 | impl ::std::error::Error for ConstraintViolation {}
|
5385 + | /* ConstrainedNumberGenerator.kt:159 */
|
4595 5386 | impl ConstraintViolation {
|
4596 5387 | pub(crate) fn as_validation_exception_field(
|
4597 5388 | self,
|
4598 5389 | path: ::std::string::String,
|
4599 5390 | ) -> crate::model::ValidationExceptionField {
|
4600 5391 | match self {
|
4601 5392 | Self::Range(_) => crate::model::ValidationExceptionField {
|
4602 5393 | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 8", &path),
|
4603 5394 | path,
|
4604 5395 | },
|
4605 5396 | }
|
4606 5397 | }
|
4607 5398 | }
|
5399 + |
|
5400 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4608 5401 | }
|
4609 - | /// See [`MinInteger`](crate::model::MinInteger).
|
5402 + | /// /* CodegenDelegator.kt:51 */See [`MinInteger`](crate::model::MinInteger).
|
4610 5403 | pub mod min_integer {
|
4611 5404 |
|
5405 + | /* ConstrainedNumberGenerator.kt:139 */
|
4612 5406 | #[derive(Debug, PartialEq)]
|
4613 5407 | pub enum ConstraintViolation {
|
4614 5408 | Range(i32),
|
4615 5409 | }
|
4616 5410 |
|
4617 5411 | impl ::std::fmt::Display for ConstraintViolation {
|
4618 5412 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4619 5413 | write!(f, "Value for `aws.protocoltests.restjson.validation#MinInteger`failed to satisfy constraint: Member must be greater than or equal to 2")
|
4620 5414 | }
|
4621 5415 | }
|
4622 5416 |
|
4623 5417 | impl ::std::error::Error for ConstraintViolation {}
|
5418 + | /* ConstrainedNumberGenerator.kt:159 */
|
4624 5419 | impl ConstraintViolation {
|
4625 5420 | pub(crate) fn as_validation_exception_field(
|
4626 5421 | self,
|
4627 5422 | path: ::std::string::String,
|
4628 5423 | ) -> crate::model::ValidationExceptionField {
|
4629 5424 | match self {
|
4630 5425 | Self::Range(_) => crate::model::ValidationExceptionField {
|
4631 5426 | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to 2", &path),
|
4632 5427 | path,
|
4633 5428 | },
|
4634 5429 | }
|
4635 5430 | }
|
4636 5431 | }
|
5432 + |
|
5433 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4637 5434 | }
|
4638 - | /// See [`RangeInteger`](crate::model::RangeInteger).
|
5435 + | /// /* CodegenDelegator.kt:51 */See [`RangeInteger`](crate::model::RangeInteger).
|
4639 5436 | pub mod range_integer {
|
4640 5437 |
|
5438 + | /* ConstrainedNumberGenerator.kt:139 */
|
4641 5439 | #[derive(Debug, PartialEq)]
|
4642 5440 | pub enum ConstraintViolation {
|
4643 5441 | Range(i32),
|
4644 5442 | }
|
4645 5443 |
|
4646 5444 | impl ::std::fmt::Display for ConstraintViolation {
|
4647 5445 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4648 5446 | write!(f, "Value for `aws.protocoltests.restjson.validation#RangeInteger`failed to satisfy constraint: Member must be between 2 and 8, inclusive")
|
4649 5447 | }
|
4650 5448 | }
|
4651 5449 |
|
4652 5450 | impl ::std::error::Error for ConstraintViolation {}
|
5451 + | /* ConstrainedNumberGenerator.kt:159 */
|
4653 5452 | impl ConstraintViolation {
|
4654 5453 | pub(crate) fn as_validation_exception_field(
|
4655 5454 | self,
|
4656 5455 | path: ::std::string::String,
|
4657 5456 | ) -> crate::model::ValidationExceptionField {
|
4658 5457 | match self {
|
4659 5458 | Self::Range(_) => crate::model::ValidationExceptionField {
|
4660 5459 | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 2 and 8, inclusive", &path),
|
4661 5460 | path,
|
4662 5461 | },
|
4663 5462 | }
|
4664 5463 | }
|
4665 5464 | }
|
5465 + |
|
5466 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4666 5467 | }
|
4667 - | /// See [`MaxShort`](crate::model::MaxShort).
|
5468 + | /// /* CodegenDelegator.kt:51 */See [`MaxShort`](crate::model::MaxShort).
|
4668 5469 | pub mod max_short {
|
4669 5470 |
|
5471 + | /* ConstrainedNumberGenerator.kt:139 */
|
4670 5472 | #[derive(Debug, PartialEq)]
|
4671 5473 | pub enum ConstraintViolation {
|
4672 5474 | Range(i16),
|
4673 5475 | }
|
4674 5476 |
|
4675 5477 | impl ::std::fmt::Display for ConstraintViolation {
|
4676 5478 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4677 5479 | write!(f, "Value for `aws.protocoltests.restjson.validation#MaxShort`failed to satisfy constraint: Member must be less than or equal to 8")
|
4678 5480 | }
|
4679 5481 | }
|
4680 5482 |
|
4681 5483 | impl ::std::error::Error for ConstraintViolation {}
|
5484 + | /* ConstrainedNumberGenerator.kt:159 */
|
4682 5485 | impl ConstraintViolation {
|
4683 5486 | pub(crate) fn as_validation_exception_field(
|
4684 5487 | self,
|
4685 5488 | path: ::std::string::String,
|
4686 5489 | ) -> crate::model::ValidationExceptionField {
|
4687 5490 | match self {
|
4688 5491 | Self::Range(_) => crate::model::ValidationExceptionField {
|
4689 5492 | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 8", &path),
|
4690 5493 | path,
|
4691 5494 | },
|
4692 5495 | }
|
4693 5496 | }
|
4694 5497 | }
|
5498 + |
|
5499 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4695 5500 | }
|
4696 - | /// See [`MinShort`](crate::model::MinShort).
|
5501 + | /// /* CodegenDelegator.kt:51 */See [`MinShort`](crate::model::MinShort).
|
4697 5502 | pub mod min_short {
|
4698 5503 |
|
5504 + | /* ConstrainedNumberGenerator.kt:139 */
|
4699 5505 | #[derive(Debug, PartialEq)]
|
4700 5506 | pub enum ConstraintViolation {
|
4701 5507 | Range(i16),
|
4702 5508 | }
|
4703 5509 |
|
4704 5510 | impl ::std::fmt::Display for ConstraintViolation {
|
4705 5511 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4706 5512 | write!(f, "Value for `aws.protocoltests.restjson.validation#MinShort`failed to satisfy constraint: Member must be greater than or equal to 2")
|
4707 5513 | }
|
4708 5514 | }
|
4709 5515 |
|
4710 5516 | impl ::std::error::Error for ConstraintViolation {}
|
5517 + | /* ConstrainedNumberGenerator.kt:159 */
|
4711 5518 | impl ConstraintViolation {
|
4712 5519 | pub(crate) fn as_validation_exception_field(
|
4713 5520 | self,
|
4714 5521 | path: ::std::string::String,
|
4715 5522 | ) -> crate::model::ValidationExceptionField {
|
4716 5523 | match self {
|
4717 5524 | Self::Range(_) => crate::model::ValidationExceptionField {
|
4718 5525 | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to 2", &path),
|
4719 5526 | path,
|
4720 5527 | },
|
4721 5528 | }
|
4722 5529 | }
|
4723 5530 | }
|
5531 + |
|
5532 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4724 5533 | }
|
4725 - | /// See [`RangeShort`](crate::model::RangeShort).
|
5534 + | /// /* CodegenDelegator.kt:51 */See [`RangeShort`](crate::model::RangeShort).
|
4726 5535 | pub mod range_short {
|
4727 5536 |
|
5537 + | /* ConstrainedNumberGenerator.kt:139 */
|
4728 5538 | #[derive(Debug, PartialEq)]
|
4729 5539 | pub enum ConstraintViolation {
|
4730 5540 | Range(i16),
|
4731 5541 | }
|
4732 5542 |
|
4733 5543 | impl ::std::fmt::Display for ConstraintViolation {
|
4734 5544 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4735 5545 | write!(f, "Value for `aws.protocoltests.restjson.validation#RangeShort`failed to satisfy constraint: Member must be between 2 and 8, inclusive")
|
4736 5546 | }
|
4737 5547 | }
|
4738 5548 |
|
4739 5549 | impl ::std::error::Error for ConstraintViolation {}
|
5550 + | /* ConstrainedNumberGenerator.kt:159 */
|
4740 5551 | impl ConstraintViolation {
|
4741 5552 | pub(crate) fn as_validation_exception_field(
|
4742 5553 | self,
|
4743 5554 | path: ::std::string::String,
|
4744 5555 | ) -> crate::model::ValidationExceptionField {
|
4745 5556 | match self {
|
4746 5557 | Self::Range(_) => crate::model::ValidationExceptionField {
|
4747 5558 | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 2 and 8, inclusive", &path),
|
4748 5559 | path,
|
4749 5560 | },
|
4750 5561 | }
|
4751 5562 | }
|
4752 5563 | }
|
5564 + |
|
5565 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4753 5566 | }
|
4754 - | /// See [`MaxByte`](crate::model::MaxByte).
|
5567 + | /// /* CodegenDelegator.kt:51 */See [`MaxByte`](crate::model::MaxByte).
|
4755 5568 | pub mod max_byte {
|
4756 5569 |
|
5570 + | /* ConstrainedNumberGenerator.kt:139 */
|
4757 5571 | #[derive(Debug, PartialEq)]
|
4758 5572 | pub enum ConstraintViolation {
|
4759 5573 | Range(i8),
|
4760 5574 | }
|
4761 5575 |
|
4762 5576 | impl ::std::fmt::Display for ConstraintViolation {
|
4763 5577 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4764 5578 | write!(f, "Value for `aws.protocoltests.restjson.validation#MaxByte`failed to satisfy constraint: Member must be less than or equal to 8")
|
4765 5579 | }
|
4766 5580 | }
|
4767 5581 |
|
4768 5582 | impl ::std::error::Error for ConstraintViolation {}
|
5583 + | /* ConstrainedNumberGenerator.kt:159 */
|
4769 5584 | impl ConstraintViolation {
|
4770 5585 | pub(crate) fn as_validation_exception_field(
|
4771 5586 | self,
|
4772 5587 | path: ::std::string::String,
|
4773 5588 | ) -> crate::model::ValidationExceptionField {
|
4774 5589 | match self {
|
4775 5590 | Self::Range(_) => crate::model::ValidationExceptionField {
|
4776 5591 | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 8", &path),
|
4777 5592 | path,
|
4778 5593 | },
|
4779 5594 | }
|
4780 5595 | }
|
4781 5596 | }
|
5597 + |
|
5598 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4782 5599 | }
|
4783 - | /// See [`MinByte`](crate::model::MinByte).
|
5600 + | /// /* CodegenDelegator.kt:51 */See [`MinByte`](crate::model::MinByte).
|
4784 5601 | pub mod min_byte {
|
4785 5602 |
|
5603 + | /* ConstrainedNumberGenerator.kt:139 */
|
4786 5604 | #[derive(Debug, PartialEq)]
|
4787 5605 | pub enum ConstraintViolation {
|
4788 5606 | Range(i8),
|
4789 5607 | }
|
4790 5608 |
|
4791 5609 | impl ::std::fmt::Display for ConstraintViolation {
|
4792 5610 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4793 5611 | write!(f, "Value for `aws.protocoltests.restjson.validation#MinByte`failed to satisfy constraint: Member must be greater than or equal to 2")
|
4794 5612 | }
|
4795 5613 | }
|
4796 5614 |
|
4797 5615 | impl ::std::error::Error for ConstraintViolation {}
|
5616 + | /* ConstrainedNumberGenerator.kt:159 */
|
4798 5617 | impl ConstraintViolation {
|
4799 5618 | pub(crate) fn as_validation_exception_field(
|
4800 5619 | self,
|
4801 5620 | path: ::std::string::String,
|
4802 5621 | ) -> crate::model::ValidationExceptionField {
|
4803 5622 | match self {
|
4804 5623 | Self::Range(_) => crate::model::ValidationExceptionField {
|
4805 5624 | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to 2", &path),
|
4806 5625 | path,
|
4807 5626 | },
|
4808 5627 | }
|
4809 5628 | }
|
4810 5629 | }
|
5630 + |
|
5631 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4811 5632 | }
|
4812 - | /// See [`RangeByte`](crate::model::RangeByte).
|
5633 + | /// /* CodegenDelegator.kt:51 */See [`RangeByte`](crate::model::RangeByte).
|
4813 5634 | pub mod range_byte {
|
4814 5635 |
|
5636 + | /* ConstrainedNumberGenerator.kt:139 */
|
4815 5637 | #[derive(Debug, PartialEq)]
|
4816 5638 | pub enum ConstraintViolation {
|
4817 5639 | Range(i8),
|
4818 5640 | }
|
4819 5641 |
|
4820 5642 | impl ::std::fmt::Display for ConstraintViolation {
|
4821 5643 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4822 5644 | write!(f, "Value for `aws.protocoltests.restjson.validation#RangeByte`failed to satisfy constraint: Member must be between 2 and 8, inclusive")
|
4823 5645 | }
|
4824 5646 | }
|
4825 5647 |
|
4826 5648 | impl ::std::error::Error for ConstraintViolation {}
|
5649 + | /* ConstrainedNumberGenerator.kt:159 */
|
4827 5650 | impl ConstraintViolation {
|
4828 5651 | pub(crate) fn as_validation_exception_field(
|
4829 5652 | self,
|
4830 5653 | path: ::std::string::String,
|
4831 5654 | ) -> crate::model::ValidationExceptionField {
|
4832 5655 | match self {
|
4833 5656 | Self::Range(_) => crate::model::ValidationExceptionField {
|
4834 5657 | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 2 and 8, inclusive", &path),
|
4835 5658 | path,
|
4836 5659 | },
|
4837 5660 | }
|
4838 5661 | }
|
4839 5662 | }
|
5663 + |
|
5664 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
4840 5665 | }
|
4841 5666 | pub mod pattern_union_override {
|
4842 5667 |
|
5668 + | /* RustType.kt:516 */
|
4843 5669 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5670 + | /* UnconstrainedUnionGenerator.kt:150 */
|
4844 5671 | #[allow(clippy::enum_variant_names)]
|
4845 5672 | pub enum ConstraintViolation {
|
5673 + | /* UnconstrainedUnionGenerator.kt:218 */
|
4846 5674 | First(crate::model::pattern_union_override::first::ConstraintViolation),
|
5675 + | /* UnconstrainedUnionGenerator.kt:218 */
|
4847 5676 | Second(crate::model::pattern_union_override::second::ConstraintViolation),
|
5677 + | /* UnconstrainedUnionGenerator.kt:150 */
|
4848 5678 | }
|
5679 + | /* UnconstrainedUnionGenerator.kt:158 */
|
4849 5680 | impl ::std::fmt::Display for ConstraintViolation {
|
4850 5681 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4851 5682 | match self {
|
4852 5683 | Self::First(inner) => write!(f, "{inner}"),
|
4853 5684 | Self::Second(inner) => write!(f, "{inner}"),
|
4854 5685 | }
|
4855 5686 | }
|
4856 5687 | }
|
4857 5688 |
|
4858 5689 | impl ::std::error::Error for ConstraintViolation {}
|
5690 + | /* UnconstrainedUnionGenerator.kt:176 */
|
4859 5691 | impl ConstraintViolation {
|
4860 5692 | pub(crate) fn as_validation_exception_field(
|
4861 5693 | self,
|
4862 5694 | path: ::std::string::String,
|
4863 5695 | ) -> crate::model::ValidationExceptionField {
|
4864 5696 | match self {
|
4865 5697 | Self::First(inner) => inner.as_validation_exception_field(path + "/first"),
|
4866 5698 | Self::Second(inner) => inner.as_validation_exception_field(path + "/second"),
|
4867 5699 | }
|
4868 5700 | }
|
4869 5701 | }
|
5702 + | /* ConstrainedStringGenerator.kt:82 */
|
4870 5703 | #[allow(missing_docs)] // documentation missing in model
|
4871 - | ///
|
5704 + | /// /* ConstrainedStringGenerator.kt:83 */
|
4872 5705 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4873 5706 | /// [constraint traits]. Use [`Second::try_from`] to construct values of this type.
|
4874 5707 | ///
|
4875 5708 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4876 5709 | ///
|
5710 + | /* RustType.kt:516 */
|
4877 5711 | #[derive(
|
4878 5712 | ::std::clone::Clone,
|
4879 5713 | ::std::cmp::Eq,
|
4880 5714 | ::std::cmp::PartialEq,
|
4881 5715 | ::std::fmt::Debug,
|
4882 5716 | ::std::hash::Hash,
|
4883 5717 | )]
|
4884 - | pub struct Second(pub(crate) ::std::string::String);
|
5718 + | pub /* ConstrainedStringGenerator.kt:86 */ struct Second(pub(crate) ::std::string::String);
|
5719 + | /* ConstrainedStringGenerator.kt:90 */
|
4885 5720 | impl Second {
|
4886 5721 | /// Extracts a string slice containing the entire underlying `String`.
|
4887 5722 | pub fn as_str(&self) -> &str {
|
4888 5723 | &self.0
|
4889 5724 | }
|
4890 5725 |
|
4891 5726 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
4892 5727 | pub fn inner(&self) -> &::std::string::String {
|
4893 5728 | &self.0
|
4894 5729 | }
|
4895 5730 |
|
4896 5731 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
4897 5732 | pub fn into_inner(self) -> ::std::string::String {
|
4898 5733 | self.0
|
4899 5734 | }
|
4900 5735 | }
|
5736 + | /* TraitInfo.kt:41 */
|
4901 5737 | impl Second {
|
4902 5738 | fn check_pattern(
|
4903 5739 | string: ::std::string::String,
|
4904 5740 | ) -> ::std::result::Result<
|
4905 5741 | ::std::string::String,
|
4906 5742 | crate::model::pattern_union_override::second::ConstraintViolation,
|
4907 5743 | > {
|
4908 5744 | let regex = Self::compile_regex();
|
4909 5745 |
|
4910 5746 | if regex.is_match(&string) {
|
4911 5747 | Ok(string)
|
4912 5748 | } else {
|
4913 5749 | Err(
|
4914 5750 | crate::model::pattern_union_override::second::ConstraintViolation::Pattern(
|
4915 5751 | string,
|
4916 5752 | ),
|
4917 5753 | )
|
4918 5754 | }
|
4919 5755 | }
|
4920 5756 |
|
4921 5757 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
4922 5758 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
4923 5759 | pub fn compile_regex() -> &'static ::regex::Regex {
|
4924 5760 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
4925 5761 | ::regex::Regex::new(r#"^[g-m]+$"#).expect(r#"The regular expression ^[g-m]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
4926 5762 | });
|
4927 5763 |
|
4928 5764 | ®EX
|
4929 5765 | }
|
4930 5766 | }
|
5767 + | /* TraitInfo.kt:57 */
|
4931 5768 | impl ::std::convert::TryFrom<::std::string::String> for Second {
|
4932 5769 | type Error = crate::model::pattern_union_override::second::ConstraintViolation;
|
4933 5770 |
|
4934 5771 | /// Constructs a `Second` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
4935 5772 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
4936 5773 | let value = Self::check_pattern(value)?;
|
4937 5774 |
|
4938 5775 | Ok(Self(value))
|
4939 5776 | }
|
4940 5777 | }
|
5778 + | /* ConstrainedStringGenerator.kt:112 */
|
4941 5779 | impl crate::constrained::Constrained for Second {
|
4942 5780 | type Unconstrained = ::std::string::String;
|
4943 5781 | }
|
4944 5782 |
|
4945 5783 | impl ::std::convert::From<::std::string::String>
|
4946 5784 | for crate::constrained::MaybeConstrained<crate::model::pattern_union_override::Second>
|
4947 5785 | {
|
4948 5786 | fn from(value: ::std::string::String) -> Self {
|
4949 5787 | Self::Unconstrained(value)
|
4950 5788 | }
|
4951 5789 | }
|
4952 5790 |
|
4953 5791 | impl ::std::fmt::Display for Second {
|
4954 5792 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4955 5793 | self.0.fmt(f)
|
4956 5794 | }
|
4957 5795 | }
|
4958 5796 |
|
4959 5797 | impl ::std::convert::From<Second> for ::std::string::String {
|
4960 5798 | fn from(value: Second) -> Self {
|
4961 5799 | value.into_inner()
|
4962 5800 | }
|
4963 5801 | }
|
5802 + | /* RustType.kt:516 */
|
4964 5803 | #[cfg(test)]
|
5804 + | /* ConstrainedStringGenerator.kt:205 */
|
4965 5805 | mod test_second {
|
4966 5806 | #[test]
|
4967 5807 | fn regex_compiles() {
|
4968 5808 | crate::model::pattern_union_override::Second::compile_regex();
|
4969 5809 | }
|
5810 + |
|
5811 + | /* ConstrainedStringGenerator.kt:205 */
|
4970 5812 | }
|
5813 + | /* ConstrainedStringGenerator.kt:82 */
|
4971 5814 | #[allow(missing_docs)] // documentation missing in model
|
4972 - | ///
|
5815 + | /// /* ConstrainedStringGenerator.kt:83 */
|
4973 5816 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4974 5817 | /// [constraint traits]. Use [`First::try_from`] to construct values of this type.
|
4975 5818 | ///
|
4976 5819 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4977 5820 | ///
|
5821 + | /* RustType.kt:516 */
|
4978 5822 | #[derive(
|
4979 5823 | ::std::clone::Clone,
|
4980 5824 | ::std::cmp::Eq,
|
4981 5825 | ::std::cmp::PartialEq,
|
4982 5826 | ::std::fmt::Debug,
|
4983 5827 | ::std::hash::Hash,
|
4984 5828 | )]
|
4985 - | pub struct First(pub(crate) ::std::string::String);
|
5829 + | pub /* ConstrainedStringGenerator.kt:86 */ struct First(pub(crate) ::std::string::String);
|
5830 + | /* ConstrainedStringGenerator.kt:90 */
|
4986 5831 | impl First {
|
4987 5832 | /// Extracts a string slice containing the entire underlying `String`.
|
4988 5833 | pub fn as_str(&self) -> &str {
|
4989 5834 | &self.0
|
4990 5835 | }
|
4991 5836 |
|
4992 5837 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
4993 5838 | pub fn inner(&self) -> &::std::string::String {
|
4994 5839 | &self.0
|
4995 5840 | }
|
4996 5841 |
|
4997 5842 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
4998 5843 | pub fn into_inner(self) -> ::std::string::String {
|
4999 5844 | self.0
|
5000 5845 | }
|
5001 5846 | }
|
5847 + | /* TraitInfo.kt:41 */
|
5002 5848 | impl First {
|
5003 5849 | fn check_pattern(
|
5004 5850 | string: ::std::string::String,
|
5005 5851 | ) -> ::std::result::Result<
|
5006 5852 | ::std::string::String,
|
5007 5853 | crate::model::pattern_union_override::first::ConstraintViolation,
|
5008 5854 | > {
|
5009 5855 | let regex = Self::compile_regex();
|
5010 5856 |
|
5011 5857 | if regex.is_match(&string) {
|
5012 5858 | Ok(string)
|
5013 5859 | } else {
|
5014 5860 | Err(
|
5015 5861 | crate::model::pattern_union_override::first::ConstraintViolation::Pattern(
|
5016 5862 | string,
|
5017 5863 | ),
|
5018 5864 | )
|
5019 5865 | }
|
5020 5866 | }
|
5021 5867 |
|
5022 5868 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
5023 5869 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
5024 5870 | pub fn compile_regex() -> &'static ::regex::Regex {
|
5025 5871 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
5026 5872 | ::regex::Regex::new(r#"^[g-m]+$"#).expect(r#"The regular expression ^[g-m]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
5027 5873 | });
|
5028 5874 |
|
5029 5875 | ®EX
|
5030 5876 | }
|
5031 5877 | }
|
5878 + | /* TraitInfo.kt:57 */
|
5032 5879 | impl ::std::convert::TryFrom<::std::string::String> for First {
|
5033 5880 | type Error = crate::model::pattern_union_override::first::ConstraintViolation;
|
5034 5881 |
|
5035 5882 | /// Constructs a `First` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
5036 5883 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
5037 5884 | let value = Self::check_pattern(value)?;
|
5038 5885 |
|
5039 5886 | Ok(Self(value))
|
5040 5887 | }
|
5041 5888 | }
|
5889 + | /* ConstrainedStringGenerator.kt:112 */
|
5042 5890 | impl crate::constrained::Constrained for First {
|
5043 5891 | type Unconstrained = ::std::string::String;
|
5044 5892 | }
|
5045 5893 |
|
5046 5894 | impl ::std::convert::From<::std::string::String>
|
5047 5895 | for crate::constrained::MaybeConstrained<crate::model::pattern_union_override::First>
|
5048 5896 | {
|
5049 5897 | fn from(value: ::std::string::String) -> Self {
|
5050 5898 | Self::Unconstrained(value)
|
5051 5899 | }
|
5052 5900 | }
|
5053 5901 |
|
5054 5902 | impl ::std::fmt::Display for First {
|
5055 5903 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5056 5904 | self.0.fmt(f)
|
5057 5905 | }
|
5058 5906 | }
|
5059 5907 |
|
5060 5908 | impl ::std::convert::From<First> for ::std::string::String {
|
5061 5909 | fn from(value: First) -> Self {
|
5062 5910 | value.into_inner()
|
5063 5911 | }
|
5064 5912 | }
|
5913 + | /* RustType.kt:516 */
|
5065 5914 | #[cfg(test)]
|
5915 + | /* ConstrainedStringGenerator.kt:205 */
|
5066 5916 | mod test_first {
|
5067 5917 | #[test]
|
5068 5918 | fn regex_compiles() {
|
5069 5919 | crate::model::pattern_union_override::First::compile_regex();
|
5070 5920 | }
|
5921 + |
|
5922 + | /* ConstrainedStringGenerator.kt:205 */
|
5071 5923 | }
|
5072 5924 |
|
5073 5925 | /// See [`PatternUnionOverrideSecond`](crate::model::pattern_union_override::Second).
|
5074 5926 | pub mod second {
|
5075 5927 |
|
5928 + | /* ConstrainedStringGenerator.kt:155 */
|
5076 5929 | #[derive(Debug, PartialEq)]
|
5077 5930 | pub enum ConstraintViolation {
|
5078 5931 | /// Error when a string doesn't satisfy its `@pattern`.
|
5079 5932 | /// Contains the String that failed the pattern.
|
5080 5933 | Pattern(String),
|
5081 5934 | }
|
5082 5935 |
|
5083 5936 | impl ::std::fmt::Display for ConstraintViolation {
|
5084 5937 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5085 5938 | let message = match self {
|
5086 5939 | Self::Pattern(_) => {
|
5087 5940 | format!(
|
5088 5941 | r#"Value provided for `aws.protocoltests.restjson.validation#PatternUnionOverrideSecond` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
5089 5942 | r#"^[g-m]+$"#
|
5090 5943 | )
|
5091 5944 | }
|
5092 5945 | };
|
5093 5946 | write!(f, "{message}")
|
5094 5947 | }
|
5095 5948 | }
|
5096 5949 |
|
5097 5950 | impl ::std::error::Error for ConstraintViolation {}
|
5951 + | /* ConstrainedStringGenerator.kt:180 */
|
5098 5952 | impl ConstraintViolation {
|
5099 5953 | pub(crate) fn as_validation_exception_field(
|
5100 5954 | self,
|
5101 5955 | path: ::std::string::String,
|
5102 5956 | ) -> crate::model::ValidationExceptionField {
|
5103 5957 | match self {
|
5104 5958 | #[allow(unused_variables)]
|
5105 5959 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
5106 5960 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[g-m]+$"#),
|
5107 5961 | path
|
5108 5962 | },
|
5109 5963 | }
|
5110 5964 | }
|
5111 5965 | }
|
5112 5966 | }
|
5113 5967 | /// See [`PatternUnionOverrideFirst`](crate::model::pattern_union_override::First).
|
5114 5968 | pub mod first {
|
5115 5969 |
|
5970 + | /* ConstrainedStringGenerator.kt:155 */
|
5116 5971 | #[derive(Debug, PartialEq)]
|
5117 5972 | pub enum ConstraintViolation {
|
5118 5973 | /// Error when a string doesn't satisfy its `@pattern`.
|
5119 5974 | /// Contains the String that failed the pattern.
|
5120 5975 | Pattern(String),
|
5121 5976 | }
|
5122 5977 |
|
5123 5978 | impl ::std::fmt::Display for ConstraintViolation {
|
5124 5979 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5125 5980 | let message = match self {
|
5126 5981 | Self::Pattern(_) => {
|
5127 5982 | format!(
|
5128 5983 | r#"Value provided for `aws.protocoltests.restjson.validation#PatternUnionOverrideFirst` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
5129 5984 | r#"^[g-m]+$"#
|
5130 5985 | )
|
5131 5986 | }
|
5132 5987 | };
|
5133 5988 | write!(f, "{message}")
|
5134 5989 | }
|
5135 5990 | }
|
5136 5991 |
|
5137 5992 | impl ::std::error::Error for ConstraintViolation {}
|
5993 + | /* ConstrainedStringGenerator.kt:180 */
|
5138 5994 | impl ConstraintViolation {
|
5139 5995 | pub(crate) fn as_validation_exception_field(
|
5140 5996 | self,
|
5141 5997 | path: ::std::string::String,
|
5142 5998 | ) -> crate::model::ValidationExceptionField {
|
5143 5999 | match self {
|
5144 6000 | #[allow(unused_variables)]
|
5145 6001 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
5146 6002 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[g-m]+$"#),
|
5147 6003 | path
|
5148 6004 | },
|
5149 6005 | }
|
5150 6006 | }
|
5151 6007 | }
|
5152 6008 | }
|
6009 + |
|
6010 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
5153 6011 | }
|
5154 6012 | pub mod pattern_map_override {
|
5155 6013 |
|
6014 + | /* MapConstraintViolationGenerator.kt:82 */
|
5156 6015 | #[allow(clippy::enum_variant_names)]
|
5157 6016 | #[derive(Debug, PartialEq)]
|
5158 6017 | pub enum ConstraintViolation {
|
5159 6018 | #[doc(hidden)]
|
5160 6019 | Key(crate::model::pattern_map_override::key::ConstraintViolation),
|
5161 6020 | #[doc(hidden)]
|
5162 6021 | Value(
|
5163 6022 | crate::model::pattern_map_override::Key,
|
5164 6023 | crate::model::pattern_map_override::value::ConstraintViolation,
|
5165 6024 | ),
|
5166 6025 | }
|
5167 6026 |
|
5168 6027 | impl ::std::fmt::Display for ConstraintViolation {
|
5169 6028 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5170 6029 | match self {
|
5171 6030 | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5172 6031 | Self::Value(_, value_constraint_violation) => {
|
5173 6032 | write!(f, "{}", value_constraint_violation)
|
5174 6033 | }
|
5175 6034 | }
|
5176 6035 | }
|
5177 6036 | }
|
5178 6037 |
|
5179 6038 | impl ::std::error::Error for ConstraintViolation {}
|
6039 + | /* MapConstraintViolationGenerator.kt:111 */
|
5180 6040 | impl ConstraintViolation {
|
5181 6041 | pub(crate) fn as_validation_exception_field(
|
5182 6042 | self,
|
5183 6043 | path: ::std::string::String,
|
5184 6044 | ) -> crate::model::ValidationExceptionField {
|
5185 6045 | match self {
|
5186 6046 | Self::Key(key_constraint_violation) => {
|
5187 6047 | key_constraint_violation.as_validation_exception_field(path)
|
5188 6048 | }
|
5189 6049 | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5190 6050 | .as_validation_exception_field(path + "/" + key.as_str()),
|
5191 6051 | }
|
5192 6052 | }
|
5193 6053 | }
|
6054 + | /* ConstrainedStringGenerator.kt:82 */
|
5194 6055 | #[allow(missing_docs)] // documentation missing in model
|
5195 - | ///
|
6056 + | /// /* ConstrainedStringGenerator.kt:83 */
|
5196 6057 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5197 6058 | /// [constraint traits]. Use [`Value::try_from`] to construct values of this type.
|
5198 6059 | ///
|
5199 6060 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5200 6061 | ///
|
6062 + | /* RustType.kt:516 */
|
5201 6063 | #[derive(
|
5202 6064 | ::std::clone::Clone,
|
5203 6065 | ::std::cmp::Eq,
|
5204 6066 | ::std::cmp::PartialEq,
|
5205 6067 | ::std::fmt::Debug,
|
5206 6068 | ::std::hash::Hash,
|
5207 6069 | )]
|
5208 - | pub struct Value(pub(crate) ::std::string::String);
|
6070 + | pub /* ConstrainedStringGenerator.kt:86 */ struct Value(pub(crate) ::std::string::String);
|
6071 + | /* ConstrainedStringGenerator.kt:90 */
|
5209 6072 | impl Value {
|
5210 6073 | /// Extracts a string slice containing the entire underlying `String`.
|
5211 6074 | pub fn as_str(&self) -> &str {
|
5212 6075 | &self.0
|
5213 6076 | }
|
5214 6077 |
|
5215 6078 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
5216 6079 | pub fn inner(&self) -> &::std::string::String {
|
5217 6080 | &self.0
|
5218 6081 | }
|
5219 6082 |
|
5220 6083 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
5221 6084 | pub fn into_inner(self) -> ::std::string::String {
|
5222 6085 | self.0
|
5223 6086 | }
|
5224 6087 | }
|
6088 + | /* TraitInfo.kt:41 */
|
5225 6089 | impl Value {
|
5226 6090 | fn check_pattern(
|
5227 6091 | string: ::std::string::String,
|
5228 6092 | ) -> ::std::result::Result<
|
5229 6093 | ::std::string::String,
|
5230 6094 | crate::model::pattern_map_override::value::ConstraintViolation,
|
5231 6095 | > {
|
5232 6096 | let regex = Self::compile_regex();
|
5233 6097 |
|
5234 6098 | if regex.is_match(&string) {
|
5235 6099 | Ok(string)
|
5236 6100 | } else {
|
5237 6101 | Err(crate::model::pattern_map_override::value::ConstraintViolation::Pattern(string))
|
5238 6102 | }
|
5239 6103 | }
|
5240 6104 |
|
5241 6105 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
5242 6106 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
5243 6107 | pub fn compile_regex() -> &'static ::regex::Regex {
|
5244 6108 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
5245 6109 | ::regex::Regex::new(r#"^[g-m]+$"#).expect(r#"The regular expression ^[g-m]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
5246 6110 | });
|
5247 6111 |
|
5248 6112 | ®EX
|
5249 6113 | }
|
5250 6114 | }
|
6115 + | /* TraitInfo.kt:57 */
|
5251 6116 | impl ::std::convert::TryFrom<::std::string::String> for Value {
|
5252 6117 | type Error = crate::model::pattern_map_override::value::ConstraintViolation;
|
5253 6118 |
|
5254 6119 | /// Constructs a `Value` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
5255 6120 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
5256 6121 | let value = Self::check_pattern(value)?;
|
5257 6122 |
|
5258 6123 | Ok(Self(value))
|
5259 6124 | }
|
5260 6125 | }
|
6126 + | /* ConstrainedStringGenerator.kt:112 */
|
5261 6127 | impl crate::constrained::Constrained for Value {
|
5262 6128 | type Unconstrained = ::std::string::String;
|
5263 6129 | }
|
5264 6130 |
|
5265 6131 | impl ::std::convert::From<::std::string::String>
|
5266 6132 | for crate::constrained::MaybeConstrained<crate::model::pattern_map_override::Value>
|
5267 6133 | {
|
5268 6134 | fn from(value: ::std::string::String) -> Self {
|
5269 6135 | Self::Unconstrained(value)
|
5270 6136 | }
|
5271 6137 | }
|
5272 6138 |
|
5273 6139 | impl ::std::fmt::Display for Value {
|
5274 6140 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5275 6141 | self.0.fmt(f)
|
5276 6142 | }
|
5277 6143 | }
|
5278 6144 |
|
5279 6145 | impl ::std::convert::From<Value> for ::std::string::String {
|
5280 6146 | fn from(value: Value) -> Self {
|
5281 6147 | value.into_inner()
|
5282 6148 | }
|
5283 6149 | }
|
6150 + | /* RustType.kt:516 */
|
5284 6151 | #[cfg(test)]
|
6152 + | /* ConstrainedStringGenerator.kt:205 */
|
5285 6153 | mod test_value {
|
5286 6154 | #[test]
|
5287 6155 | fn regex_compiles() {
|
5288 6156 | crate::model::pattern_map_override::Value::compile_regex();
|
5289 6157 | }
|
6158 + |
|
6159 + | /* ConstrainedStringGenerator.kt:205 */
|
5290 6160 | }
|
6161 + | /* ConstrainedStringGenerator.kt:82 */
|
5291 6162 | #[allow(missing_docs)] // documentation missing in model
|
5292 - | ///
|
6163 + | /// /* ConstrainedStringGenerator.kt:83 */
|
5293 6164 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5294 6165 | /// [constraint traits]. Use [`Key::try_from`] to construct values of this type.
|
5295 6166 | ///
|
5296 6167 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5297 6168 | ///
|
6169 + | /* RustType.kt:516 */
|
5298 6170 | #[derive(
|
5299 6171 | ::std::clone::Clone,
|
5300 6172 | ::std::cmp::Eq,
|
5301 6173 | ::std::cmp::PartialEq,
|
5302 6174 | ::std::fmt::Debug,
|
5303 6175 | ::std::hash::Hash,
|
5304 6176 | )]
|
5305 - | pub struct Key(pub(crate) ::std::string::String);
|
6177 + | pub /* ConstrainedStringGenerator.kt:86 */ struct Key(pub(crate) ::std::string::String);
|
6178 + | /* ConstrainedStringGenerator.kt:90 */
|
5306 6179 | impl Key {
|
5307 6180 | /// Extracts a string slice containing the entire underlying `String`.
|
5308 6181 | pub fn as_str(&self) -> &str {
|
5309 6182 | &self.0
|
5310 6183 | }
|
5311 6184 |
|
5312 6185 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
5313 6186 | pub fn inner(&self) -> &::std::string::String {
|
5314 6187 | &self.0
|
5315 6188 | }
|
5316 6189 |
|
5317 6190 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
5318 6191 | pub fn into_inner(self) -> ::std::string::String {
|
5319 6192 | self.0
|
5320 6193 | }
|
5321 6194 | }
|
6195 + | /* TraitInfo.kt:41 */
|
5322 6196 | impl Key {
|
5323 6197 | fn check_pattern(
|
5324 6198 | string: ::std::string::String,
|
5325 6199 | ) -> ::std::result::Result<
|
5326 6200 | ::std::string::String,
|
5327 6201 | crate::model::pattern_map_override::key::ConstraintViolation,
|
5328 6202 | > {
|
5329 6203 | let regex = Self::compile_regex();
|
5330 6204 |
|
5331 6205 | if regex.is_match(&string) {
|
5332 6206 | Ok(string)
|
5333 6207 | } else {
|
5334 6208 | Err(crate::model::pattern_map_override::key::ConstraintViolation::Pattern(string))
|
5335 6209 | }
|
5336 6210 | }
|
5337 6211 |
|
5338 6212 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
5339 6213 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
5340 6214 | pub fn compile_regex() -> &'static ::regex::Regex {
|
5341 6215 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
5342 6216 | ::regex::Regex::new(r#"^[g-m]+$"#).expect(r#"The regular expression ^[g-m]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
5343 6217 | });
|
5344 6218 |
|
5345 6219 | ®EX
|
5346 6220 | }
|
5347 6221 | }
|
6222 + | /* TraitInfo.kt:57 */
|
5348 6223 | impl ::std::convert::TryFrom<::std::string::String> for Key {
|
5349 6224 | type Error = crate::model::pattern_map_override::key::ConstraintViolation;
|
5350 6225 |
|
5351 6226 | /// Constructs a `Key` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
5352 6227 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
5353 6228 | let value = Self::check_pattern(value)?;
|
5354 6229 |
|
5355 6230 | Ok(Self(value))
|
5356 6231 | }
|
5357 6232 | }
|
6233 + | /* ConstrainedStringGenerator.kt:112 */
|
5358 6234 | impl crate::constrained::Constrained for Key {
|
5359 6235 | type Unconstrained = ::std::string::String;
|
5360 6236 | }
|
5361 6237 |
|
5362 6238 | impl ::std::convert::From<::std::string::String>
|
5363 6239 | for crate::constrained::MaybeConstrained<crate::model::pattern_map_override::Key>
|
5364 6240 | {
|
5365 6241 | fn from(value: ::std::string::String) -> Self {
|
5366 6242 | Self::Unconstrained(value)
|
5367 6243 | }
|
5368 6244 | }
|
5369 6245 |
|
5370 6246 | impl ::std::fmt::Display for Key {
|
5371 6247 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5372 6248 | self.0.fmt(f)
|
5373 6249 | }
|
5374 6250 | }
|
5375 6251 |
|
5376 6252 | impl ::std::convert::From<Key> for ::std::string::String {
|
5377 6253 | fn from(value: Key) -> Self {
|
5378 6254 | value.into_inner()
|
5379 6255 | }
|
5380 6256 | }
|
6257 + | /* RustType.kt:516 */
|
5381 6258 | #[cfg(test)]
|
6259 + | /* ConstrainedStringGenerator.kt:205 */
|
5382 6260 | mod test_key {
|
5383 6261 | #[test]
|
5384 6262 | fn regex_compiles() {
|
5385 6263 | crate::model::pattern_map_override::Key::compile_regex();
|
5386 6264 | }
|
6265 + |
|
6266 + | /* ConstrainedStringGenerator.kt:205 */
|
5387 6267 | }
|
5388 6268 |
|
5389 6269 | /// See [`PatternMapOverrideValue`](crate::model::pattern_map_override::Value).
|
5390 6270 | pub mod value {
|
5391 6271 |
|
6272 + | /* ConstrainedStringGenerator.kt:155 */
|
5392 6273 | #[derive(Debug, PartialEq)]
|
5393 6274 | pub enum ConstraintViolation {
|
5394 6275 | /// Error when a string doesn't satisfy its `@pattern`.
|
5395 6276 | /// Contains the String that failed the pattern.
|
5396 6277 | Pattern(String),
|
5397 6278 | }
|
5398 6279 |
|
5399 6280 | impl ::std::fmt::Display for ConstraintViolation {
|
5400 6281 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5401 6282 | let message = match self {
|
5402 6283 | Self::Pattern(_) => {
|
5403 6284 | format!(
|
5404 6285 | r#"Value provided for `aws.protocoltests.restjson.validation#PatternMapOverrideValue` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
5405 6286 | r#"^[g-m]+$"#
|
5406 6287 | )
|
5407 6288 | }
|
5408 6289 | };
|
5409 6290 | write!(f, "{message}")
|
5410 6291 | }
|
5411 6292 | }
|
5412 6293 |
|
5413 6294 | impl ::std::error::Error for ConstraintViolation {}
|
6295 + | /* ConstrainedStringGenerator.kt:180 */
|
5414 6296 | impl ConstraintViolation {
|
5415 6297 | pub(crate) fn as_validation_exception_field(
|
5416 6298 | self,
|
5417 6299 | path: ::std::string::String,
|
5418 6300 | ) -> crate::model::ValidationExceptionField {
|
5419 6301 | match self {
|
5420 6302 | #[allow(unused_variables)]
|
5421 6303 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
5422 6304 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[g-m]+$"#),
|
5423 6305 | path
|
5424 6306 | },
|
5425 6307 | }
|
5426 6308 | }
|
5427 6309 | }
|
5428 6310 | }
|
5429 6311 | /// See [`PatternMapOverrideKey`](crate::model::pattern_map_override::Key).
|
5430 6312 | pub mod key {
|
5431 6313 |
|
6314 + | /* ConstrainedStringGenerator.kt:155 */
|
5432 6315 | #[derive(Debug, PartialEq)]
|
5433 6316 | pub enum ConstraintViolation {
|
5434 6317 | /// Error when a string doesn't satisfy its `@pattern`.
|
5435 6318 | /// Contains the String that failed the pattern.
|
5436 6319 | Pattern(String),
|
5437 6320 | }
|
5438 6321 |
|
5439 6322 | impl ::std::fmt::Display for ConstraintViolation {
|
5440 6323 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5441 6324 | let message = match self {
|
5442 6325 | Self::Pattern(_) => {
|
5443 6326 | format!(
|
5444 6327 | r#"Value provided for `aws.protocoltests.restjson.validation#PatternMapOverrideKey` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
5445 6328 | r#"^[g-m]+$"#
|
5446 6329 | )
|
5447 6330 | }
|
5448 6331 | };
|
5449 6332 | write!(f, "{message}")
|
5450 6333 | }
|
5451 6334 | }
|
5452 6335 |
|
5453 6336 | impl ::std::error::Error for ConstraintViolation {}
|
6337 + | /* ConstrainedStringGenerator.kt:180 */
|
5454 6338 | impl ConstraintViolation {
|
5455 6339 | pub(crate) fn as_validation_exception_field(
|
5456 6340 | self,
|
5457 6341 | path: ::std::string::String,
|
5458 6342 | ) -> crate::model::ValidationExceptionField {
|
5459 6343 | match self {
|
5460 6344 | #[allow(unused_variables)]
|
5461 6345 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
5462 6346 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[g-m]+$"#),
|
5463 6347 | path
|
5464 6348 | },
|
5465 6349 | }
|
5466 6350 | }
|
5467 6351 | }
|
5468 6352 | }
|
6353 + |
|
6354 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
5469 6355 | }
|
5470 6356 | pub mod pattern_list_override {
|
5471 6357 |
|
6358 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
5472 6359 | #[allow(clippy::enum_variant_names)]
|
5473 6360 | #[derive(Debug, PartialEq)]
|
5474 6361 | pub enum ConstraintViolation {
|
5475 6362 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5476 6363 | /// The first component of the tuple is the index in the collection where the
|
5477 6364 | /// first constraint violation was found.
|
5478 6365 | #[doc(hidden)]
|
5479 6366 | Member(
|
5480 6367 | usize,
|
5481 6368 | crate::model::pattern_list_override::member::ConstraintViolation,
|
5482 6369 | ),
|
5483 6370 | }
|
5484 6371 |
|
5485 6372 | impl ::std::fmt::Display for ConstraintViolation {
|
5486 6373 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5487 6374 | let message = match self {
|
5488 6375 | Self::Member(index, failing_member) => format!(
|
5489 6376 | "Value at index {index} failed to satisfy constraint. {}",
|
5490 6377 | failing_member
|
5491 6378 | ),
|
5492 6379 | };
|
5493 6380 | write!(f, "{message}")
|
5494 6381 | }
|
5495 6382 | }
|
5496 6383 |
|
5497 6384 | impl ::std::error::Error for ConstraintViolation {}
|
6385 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
5498 6386 | impl ConstraintViolation {
|
5499 6387 | pub(crate) fn as_validation_exception_field(
|
5500 6388 | self,
|
5501 6389 | path: ::std::string::String,
|
5502 6390 | ) -> crate::model::ValidationExceptionField {
|
5503 6391 | match self {
|
5504 6392 | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
5505 6393 | .as_validation_exception_field(path + "/" + &index.to_string()),
|
5506 6394 | }
|
5507 6395 | }
|
5508 6396 | }
|
6397 + | /* ConstrainedStringGenerator.kt:82 */
|
5509 6398 | #[allow(missing_docs)] // documentation missing in model
|
5510 - | ///
|
6399 + | /// /* ConstrainedStringGenerator.kt:83 */
|
5511 6400 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5512 6401 | /// [constraint traits]. Use [`Member::try_from`] to construct values of this type.
|
5513 6402 | ///
|
5514 6403 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
5515 6404 | ///
|
6405 + | /* RustType.kt:516 */
|
5516 6406 | #[derive(
|
5517 6407 | ::std::clone::Clone,
|
5518 6408 | ::std::cmp::Eq,
|
5519 6409 | ::std::cmp::PartialEq,
|
5520 6410 | ::std::fmt::Debug,
|
5521 6411 | ::std::hash::Hash,
|
5522 6412 | )]
|
5523 - | pub struct Member(pub(crate) ::std::string::String);
|
6413 + | pub /* ConstrainedStringGenerator.kt:86 */ struct Member(pub(crate) ::std::string::String);
|
6414 + | /* ConstrainedStringGenerator.kt:90 */
|
5524 6415 | impl Member {
|
5525 6416 | /// Extracts a string slice containing the entire underlying `String`.
|
5526 6417 | pub fn as_str(&self) -> &str {
|
5527 6418 | &self.0
|
5528 6419 | }
|
5529 6420 |
|
5530 6421 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
5531 6422 | pub fn inner(&self) -> &::std::string::String {
|
5532 6423 | &self.0
|
5533 6424 | }
|
5534 6425 |
|
5535 6426 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
5536 6427 | pub fn into_inner(self) -> ::std::string::String {
|
5537 6428 | self.0
|
5538 6429 | }
|
5539 6430 | }
|
6431 + | /* TraitInfo.kt:41 */
|
5540 6432 | impl Member {
|
5541 6433 | fn check_pattern(
|
5542 6434 | string: ::std::string::String,
|
5543 6435 | ) -> ::std::result::Result<
|
5544 6436 | ::std::string::String,
|
5545 6437 | crate::model::pattern_list_override::member::ConstraintViolation,
|
5546 6438 | > {
|
5547 6439 | let regex = Self::compile_regex();
|
5548 6440 |
|
5549 6441 | if regex.is_match(&string) {
|
5550 6442 | Ok(string)
|
5551 6443 | } else {
|
5552 6444 | Err(
|
5553 6445 | crate::model::pattern_list_override::member::ConstraintViolation::Pattern(
|
5554 6446 | string,
|
5555 6447 | ),
|
5556 6448 | )
|
5557 6449 | }
|
5558 6450 | }
|
5559 6451 |
|
5560 6452 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
5561 6453 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
5562 6454 | pub fn compile_regex() -> &'static ::regex::Regex {
|
5563 6455 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
5564 6456 | ::regex::Regex::new(r#"^[g-m]+$"#).expect(r#"The regular expression ^[g-m]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
5565 6457 | });
|
5566 6458 |
|
5567 6459 | ®EX
|
5568 6460 | }
|
5569 6461 | }
|
6462 + | /* TraitInfo.kt:57 */
|
5570 6463 | impl ::std::convert::TryFrom<::std::string::String> for Member {
|
5571 6464 | type Error = crate::model::pattern_list_override::member::ConstraintViolation;
|
5572 6465 |
|
5573 6466 | /// Constructs a `Member` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
5574 6467 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
5575 6468 | let value = Self::check_pattern(value)?;
|
5576 6469 |
|
5577 6470 | Ok(Self(value))
|
5578 6471 | }
|
5579 6472 | }
|
6473 + | /* ConstrainedStringGenerator.kt:112 */
|
5580 6474 | impl crate::constrained::Constrained for Member {
|
5581 6475 | type Unconstrained = ::std::string::String;
|
5582 6476 | }
|
5583 6477 |
|
5584 6478 | impl ::std::convert::From<::std::string::String>
|
5585 6479 | for crate::constrained::MaybeConstrained<crate::model::pattern_list_override::Member>
|
5586 6480 | {
|
5587 6481 | fn from(value: ::std::string::String) -> Self {
|
5588 6482 | Self::Unconstrained(value)
|
5589 6483 | }
|
5590 6484 | }
|
5591 6485 |
|
5592 6486 | impl ::std::fmt::Display for Member {
|
5593 6487 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5594 6488 | self.0.fmt(f)
|
5595 6489 | }
|
5596 6490 | }
|
5597 6491 |
|
5598 6492 | impl ::std::convert::From<Member> for ::std::string::String {
|
5599 6493 | fn from(value: Member) -> Self {
|
5600 6494 | value.into_inner()
|
5601 6495 | }
|
5602 6496 | }
|
6497 + | /* RustType.kt:516 */
|
5603 6498 | #[cfg(test)]
|
6499 + | /* ConstrainedStringGenerator.kt:205 */
|
5604 6500 | mod test_member {
|
5605 6501 | #[test]
|
5606 6502 | fn regex_compiles() {
|
5607 6503 | crate::model::pattern_list_override::Member::compile_regex();
|
5608 6504 | }
|
6505 + |
|
6506 + | /* ConstrainedStringGenerator.kt:205 */
|
5609 6507 | }
|
5610 6508 |
|
5611 6509 | /// See [`PatternListOverrideMember`](crate::model::pattern_list_override::Member).
|
5612 6510 | pub mod member {
|
5613 6511 |
|
6512 + | /* ConstrainedStringGenerator.kt:155 */
|
5614 6513 | #[derive(Debug, PartialEq)]
|
5615 6514 | pub enum ConstraintViolation {
|
5616 6515 | /// Error when a string doesn't satisfy its `@pattern`.
|
5617 6516 | /// Contains the String that failed the pattern.
|
5618 6517 | Pattern(String),
|
5619 6518 | }
|
5620 6519 |
|
5621 6520 | impl ::std::fmt::Display for ConstraintViolation {
|
5622 6521 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5623 6522 | let message = match self {
|
5624 6523 | Self::Pattern(_) => {
|
5625 6524 | format!(
|
5626 6525 | r#"Value provided for `aws.protocoltests.restjson.validation#PatternListOverrideMember` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
5627 6526 | r#"^[g-m]+$"#
|
5628 6527 | )
|
5629 6528 | }
|
5630 6529 | };
|
5631 6530 | write!(f, "{message}")
|
5632 6531 | }
|
5633 6532 | }
|
5634 6533 |
|
5635 6534 | impl ::std::error::Error for ConstraintViolation {}
|
6535 + | /* ConstrainedStringGenerator.kt:180 */
|
5636 6536 | impl ConstraintViolation {
|
5637 6537 | pub(crate) fn as_validation_exception_field(
|
5638 6538 | self,
|
5639 6539 | path: ::std::string::String,
|
5640 6540 | ) -> crate::model::ValidationExceptionField {
|
5641 6541 | match self {
|
5642 6542 | #[allow(unused_variables)]
|
5643 6543 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
5644 6544 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[g-m]+$"#),
|
5645 6545 | path
|
5646 6546 | },
|
5647 6547 | }
|
5648 6548 | }
|
5649 6549 | }
|
5650 6550 | }
|
6551 + |
|
6552 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
5651 6553 | }
|
5652 6554 | pub mod pattern_union {
|
5653 6555 |
|
6556 + | /* RustType.kt:516 */
|
5654 6557 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6558 + | /* UnconstrainedUnionGenerator.kt:150 */
|
5655 6559 | #[allow(clippy::enum_variant_names)]
|
5656 6560 | pub enum ConstraintViolation {
|
6561 + | /* UnconstrainedUnionGenerator.kt:218 */
|
5657 6562 | First(crate::model::pattern_string::ConstraintViolation),
|
6563 + | /* UnconstrainedUnionGenerator.kt:218 */
|
5658 6564 | Second(crate::model::pattern_string::ConstraintViolation),
|
6565 + | /* UnconstrainedUnionGenerator.kt:150 */
|
5659 6566 | }
|
6567 + | /* UnconstrainedUnionGenerator.kt:158 */
|
5660 6568 | impl ::std::fmt::Display for ConstraintViolation {
|
5661 6569 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5662 6570 | match self {
|
5663 6571 | Self::First(inner) => write!(f, "{inner}"),
|
5664 6572 | Self::Second(inner) => write!(f, "{inner}"),
|
5665 6573 | }
|
5666 6574 | }
|
5667 6575 | }
|
5668 6576 |
|
5669 6577 | impl ::std::error::Error for ConstraintViolation {}
|
6578 + | /* UnconstrainedUnionGenerator.kt:176 */
|
5670 6579 | impl ConstraintViolation {
|
5671 6580 | pub(crate) fn as_validation_exception_field(
|
5672 6581 | self,
|
5673 6582 | path: ::std::string::String,
|
5674 6583 | ) -> crate::model::ValidationExceptionField {
|
5675 6584 | match self {
|
5676 6585 | Self::First(inner) => inner.as_validation_exception_field(path + "/first"),
|
5677 6586 | Self::Second(inner) => inner.as_validation_exception_field(path + "/second"),
|
5678 6587 | }
|
5679 6588 | }
|
5680 6589 | }
|
6590 + |
|
6591 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
5681 6592 | }
|
5682 - | /// See [`PatternString`](crate::model::PatternString).
|
6593 + | /// /* CodegenDelegator.kt:51 */See [`PatternString`](crate::model::PatternString).
|
5683 6594 | pub mod pattern_string {
|
5684 6595 |
|
6596 + | /* ConstrainedStringGenerator.kt:155 */
|
5685 6597 | #[derive(Debug, PartialEq)]
|
5686 6598 | pub enum ConstraintViolation {
|
5687 6599 | /// Error when a string doesn't satisfy its `@pattern`.
|
5688 6600 | /// Contains the String that failed the pattern.
|
5689 6601 | Pattern(String),
|
5690 6602 | }
|
5691 6603 |
|
5692 6604 | impl ::std::fmt::Display for ConstraintViolation {
|
5693 6605 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5694 6606 | let message = match self {
|
5695 6607 | Self::Pattern(_) => {
|
5696 6608 | format!(
|
5697 6609 | r#"Value provided for `aws.protocoltests.restjson.validation#PatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
5698 6610 | r#"^[a-m]+$"#
|
5699 6611 | )
|
5700 6612 | }
|
5701 6613 | };
|
5702 6614 | write!(f, "{message}")
|
5703 6615 | }
|
5704 6616 | }
|
5705 6617 |
|
5706 6618 | impl ::std::error::Error for ConstraintViolation {}
|
6619 + | /* ConstrainedStringGenerator.kt:180 */
|
5707 6620 | impl ConstraintViolation {
|
5708 6621 | pub(crate) fn as_validation_exception_field(
|
5709 6622 | self,
|
5710 6623 | path: ::std::string::String,
|
5711 6624 | ) -> crate::model::ValidationExceptionField {
|
5712 6625 | match self {
|
5713 6626 | #[allow(unused_variables)]
|
5714 6627 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
5715 6628 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[a-m]+$"#),
|
5716 6629 | path
|
5717 6630 | },
|
5718 6631 | }
|
5719 6632 | }
|
5720 6633 | }
|
6634 + |
|
6635 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
5721 6636 | }
|
5722 6637 | pub mod pattern_map {
|
5723 6638 |
|
6639 + | /* MapConstraintViolationGenerator.kt:82 */
|
5724 6640 | #[allow(clippy::enum_variant_names)]
|
5725 6641 | #[derive(Debug, PartialEq)]
|
5726 6642 | pub enum ConstraintViolation {
|
5727 6643 | #[doc(hidden)]
|
5728 6644 | Key(crate::model::pattern_string::ConstraintViolation),
|
5729 6645 | #[doc(hidden)]
|
5730 6646 | Value(
|
5731 6647 | crate::model::PatternString,
|
5732 6648 | crate::model::pattern_string::ConstraintViolation,
|
5733 6649 | ),
|
5734 6650 | }
|
5735 6651 |
|
5736 6652 | impl ::std::fmt::Display for ConstraintViolation {
|
5737 6653 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5738 6654 | match self {
|
5739 6655 | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5740 6656 | Self::Value(_, value_constraint_violation) => {
|
5741 6657 | write!(f, "{}", value_constraint_violation)
|
5742 6658 | }
|
5743 6659 | }
|
5744 6660 | }
|
5745 6661 | }
|
5746 6662 |
|
5747 6663 | impl ::std::error::Error for ConstraintViolation {}
|
6664 + | /* MapConstraintViolationGenerator.kt:111 */
|
5748 6665 | impl ConstraintViolation {
|
5749 6666 | pub(crate) fn as_validation_exception_field(
|
5750 6667 | self,
|
5751 6668 | path: ::std::string::String,
|
5752 6669 | ) -> crate::model::ValidationExceptionField {
|
5753 6670 | match self {
|
5754 6671 | Self::Key(key_constraint_violation) => {
|
5755 6672 | key_constraint_violation.as_validation_exception_field(path)
|
5756 6673 | }
|
5757 6674 | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5758 6675 | .as_validation_exception_field(path + "/" + key.as_str()),
|
5759 6676 | }
|
5760 6677 | }
|
5761 6678 | }
|
6679 + |
|
6680 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
5762 6681 | }
|
5763 6682 | pub mod pattern_list {
|
5764 6683 |
|
6684 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
5765 6685 | #[allow(clippy::enum_variant_names)]
|
5766 6686 | #[derive(Debug, PartialEq)]
|
5767 6687 | pub enum ConstraintViolation {
|
5768 6688 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5769 6689 | /// The first component of the tuple is the index in the collection where the
|
5770 6690 | /// first constraint violation was found.
|
5771 6691 | #[doc(hidden)]
|
5772 6692 | Member(usize, crate::model::pattern_string::ConstraintViolation),
|
5773 6693 | }
|
5774 6694 |
|
5775 6695 | impl ::std::fmt::Display for ConstraintViolation {
|
5776 6696 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5777 6697 | let message = match self {
|
5778 6698 | Self::Member(index, failing_member) => format!(
|
5779 6699 | "Value at index {index} failed to satisfy constraint. {}",
|
5780 6700 | failing_member
|
5781 6701 | ),
|
5782 6702 | };
|
5783 6703 | write!(f, "{message}")
|
5784 6704 | }
|
5785 6705 | }
|
5786 6706 |
|
5787 6707 | impl ::std::error::Error for ConstraintViolation {}
|
6708 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
5788 6709 | impl ConstraintViolation {
|
5789 6710 | pub(crate) fn as_validation_exception_field(
|
5790 6711 | self,
|
5791 6712 | path: ::std::string::String,
|
5792 6713 | ) -> crate::model::ValidationExceptionField {
|
5793 6714 | match self {
|
5794 6715 | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
5795 6716 | .as_validation_exception_field(path + "/" + &index.to_string()),
|
5796 6717 | }
|
5797 6718 | }
|
5798 6719 | }
|
6720 + |
|
6721 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
5799 6722 | }
|
5800 - | /// See [`EvilString`](crate::model::EvilString).
|
6723 + | /// /* CodegenDelegator.kt:51 */See [`EvilString`](crate::model::EvilString).
|
5801 6724 | pub mod evil_string {
|
5802 6725 |
|
6726 + | /* ConstrainedStringGenerator.kt:155 */
|
5803 6727 | #[derive(Debug, PartialEq)]
|
5804 6728 | pub enum ConstraintViolation {
|
5805 6729 | /// Error when a string doesn't satisfy its `@pattern`.
|
5806 6730 | /// Contains the String that failed the pattern.
|
5807 6731 | Pattern(String),
|
5808 6732 | }
|
5809 6733 |
|
5810 6734 | impl ::std::fmt::Display for ConstraintViolation {
|
5811 6735 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5812 6736 | let message = match self {
|
5813 6737 | Self::Pattern(_) => {
|
5814 6738 | format!(
|
5815 6739 | r#"Value provided for `aws.protocoltests.restjson.validation#EvilString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
5816 6740 | r#"^([0-9]+)+$"#
|
5817 6741 | )
|
5818 6742 | }
|
5819 6743 | };
|
5820 6744 | write!(f, "{message}")
|
5821 6745 | }
|
5822 6746 | }
|
5823 6747 |
|
5824 6748 | impl ::std::error::Error for ConstraintViolation {}
|
6749 + | /* ConstrainedStringGenerator.kt:180 */
|
5825 6750 | impl ConstraintViolation {
|
5826 6751 | pub(crate) fn as_validation_exception_field(
|
5827 6752 | self,
|
5828 6753 | path: ::std::string::String,
|
5829 6754 | ) -> crate::model::ValidationExceptionField {
|
5830 6755 | match self {
|
5831 6756 | #[allow(unused_variables)]
|
5832 6757 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
5833 6758 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^([0-9]+)+$"#),
|
5834 6759 | path
|
5835 6760 | },
|
5836 6761 | }
|
5837 6762 | }
|
5838 6763 | }
|
6764 + |
|
6765 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
5839 6766 | }
|
5840 - | /// See [`LengthString`](crate::model::LengthString).
|
6767 + | /// /* CodegenDelegator.kt:51 */See [`LengthString`](crate::model::LengthString).
|
5841 6768 | pub mod length_string {
|
5842 6769 |
|
6770 + | /* ConstrainedStringGenerator.kt:155 */
|
5843 6771 | #[derive(Debug, PartialEq)]
|
5844 6772 | pub enum ConstraintViolation {
|
5845 6773 | /// Error when a string doesn't satisfy its `@length` requirements.
|
5846 6774 | Length(usize),
|
5847 6775 | }
|
5848 6776 |
|
5849 6777 | impl ::std::fmt::Display for ConstraintViolation {
|
5850 6778 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5851 6779 | let message = match self {
|
5852 6780 | Self::Length(length) => {
|
5853 6781 | format!("Value with length {} provided for 'aws.protocoltests.restjson.validation#LengthString' failed to satisfy constraint: Member must have length between 2 and 8, inclusive", length)
|
5854 6782 | }
|
5855 6783 | };
|
5856 6784 | write!(f, "{message}")
|
5857 6785 | }
|
5858 6786 | }
|
5859 6787 |
|
5860 6788 | impl ::std::error::Error for ConstraintViolation {}
|
6789 + | /* ConstrainedStringGenerator.kt:180 */
|
5861 6790 | impl ConstraintViolation {
|
5862 6791 | pub(crate) fn as_validation_exception_field(
|
5863 6792 | self,
|
5864 6793 | path: ::std::string::String,
|
5865 6794 | ) -> crate::model::ValidationExceptionField {
|
5866 6795 | match self {
|
5867 6796 | Self::Length(length) => crate::model::ValidationExceptionField {
|
5868 6797 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 8, inclusive", length, &path),
|
5869 6798 | path,
|
5870 6799 | },
|
5871 6800 | }
|
5872 6801 | }
|
5873 6802 | }
|
6803 + |
|
6804 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
5874 6805 | }
|
5875 - | /// See [`LengthList`](crate::model::LengthList).
|
6806 + | /// /* CodegenDelegator.kt:51 */See [`LengthList`](crate::model::LengthList).
|
5876 6807 | pub mod length_list {
|
5877 6808 |
|
6809 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
5878 6810 | #[allow(clippy::enum_variant_names)]
|
5879 6811 | #[derive(Debug, PartialEq)]
|
5880 6812 | pub enum ConstraintViolation {
|
5881 6813 | /// Constraint violation error when the list doesn't have the required length
|
5882 6814 | Length(usize),
|
5883 6815 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5884 6816 | /// The first component of the tuple is the index in the collection where the
|
5885 6817 | /// first constraint violation was found.
|
5886 6818 | #[doc(hidden)]
|
5887 6819 | Member(usize, crate::model::length_string::ConstraintViolation),
|
5888 6820 | }
|
5889 6821 |
|
5890 6822 | impl ::std::fmt::Display for ConstraintViolation {
|
5891 6823 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5892 6824 | let message = match self {
|
5893 6825 | Self::Length(length) => {
|
5894 6826 | format!("Value with length {} provided for 'aws.protocoltests.restjson.validation#LengthList' failed to satisfy constraint: Member must have length between 2 and 8, inclusive", length)
|
5895 6827 | }
|
5896 6828 | Self::Member(index, failing_member) => format!(
|
5897 6829 | "Value at index {index} failed to satisfy constraint. {}",
|
5898 6830 | failing_member
|
5899 6831 | ),
|
5900 6832 | };
|
5901 6833 | write!(f, "{message}")
|
5902 6834 | }
|
5903 6835 | }
|
5904 6836 |
|
5905 6837 | impl ::std::error::Error for ConstraintViolation {}
|
6838 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
5906 6839 | impl ConstraintViolation {
|
5907 6840 | pub(crate) fn as_validation_exception_field(
|
5908 6841 | self,
|
5909 6842 | path: ::std::string::String,
|
5910 6843 | ) -> crate::model::ValidationExceptionField {
|
5911 6844 | match self {
|
5912 6845 | Self::Length(length) => crate::model::ValidationExceptionField {
|
5913 6846 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 8, inclusive", length, &path),
|
5914 6847 | path,
|
5915 6848 | },
|
5916 6849 | Self::Member(index, member_constraint_violation) =>
|
5917 6850 | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
5918 6851 | }
|
5919 6852 | }
|
5920 6853 | }
|
6854 + |
|
6855 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
5921 6856 | }
|
5922 - | /// See [`LengthMap`](crate::model::LengthMap).
|
6857 + | /// /* CodegenDelegator.kt:51 */See [`LengthMap`](crate::model::LengthMap).
|
5923 6858 | pub mod length_map {
|
5924 6859 |
|
6860 + | /* MapConstraintViolationGenerator.kt:82 */
|
5925 6861 | #[allow(clippy::enum_variant_names)]
|
5926 6862 | #[derive(Debug, PartialEq)]
|
5927 6863 | pub enum ConstraintViolation {
|
5928 6864 | Length(usize),
|
5929 6865 | #[doc(hidden)]
|
5930 6866 | Key(crate::model::length_string::ConstraintViolation),
|
5931 6867 | #[doc(hidden)]
|
5932 6868 | Value(
|
5933 6869 | crate::model::LengthString,
|
5934 6870 | crate::model::length_list::ConstraintViolation,
|
5935 6871 | ),
|
5936 6872 | }
|
5937 6873 |
|
5938 6874 | impl ::std::fmt::Display for ConstraintViolation {
|
5939 6875 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5940 6876 | match self {
|
5941 6877 | Self::Length(length) => {
|
5942 6878 | write!(f, "Value with length {} provided for 'aws.protocoltests.restjson.validation#LengthMap' failed to satisfy constraint: Member must have length between 2 and 8, inclusive", length)
|
5943 6879 | }
|
5944 6880 | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5945 6881 | Self::Value(_, value_constraint_violation) => {
|
5946 6882 | write!(f, "{}", value_constraint_violation)
|
5947 6883 | }
|
5948 6884 | }
|
5949 6885 | }
|
5950 6886 | }
|
5951 6887 |
|
5952 6888 | impl ::std::error::Error for ConstraintViolation {}
|
6889 + | /* MapConstraintViolationGenerator.kt:111 */
|
5953 6890 | impl ConstraintViolation {
|
5954 6891 | pub(crate) fn as_validation_exception_field(
|
5955 6892 | self,
|
5956 6893 | path: ::std::string::String,
|
5957 6894 | ) -> crate::model::ValidationExceptionField {
|
5958 6895 | match self {
|
5959 6896 | Self::Length(length) => crate::model::ValidationExceptionField {
|
5960 6897 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 8, inclusive", length, &path),
|
5961 6898 | path,
|
5962 6899 | },
|
5963 6900 | Self::Key(key_constraint_violation) => key_constraint_violation.as_validation_exception_field(path),
|
5964 6901 | Self::Value(key, value_constraint_violation) => value_constraint_violation.as_validation_exception_field(path + "/" + key.as_str()),
|
5965 6902 | }
|
5966 6903 | }
|
5967 6904 | }
|
6905 + |
|
6906 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
5968 6907 | }
|
5969 - | /// See [`MaxLengthString`](crate::model::MaxLengthString).
|
6908 + | /// /* CodegenDelegator.kt:51 */See [`MaxLengthString`](crate::model::MaxLengthString).
|
5970 6909 | pub mod max_length_string {
|
5971 6910 |
|
6911 + | /* ConstrainedStringGenerator.kt:155 */
|
5972 6912 | #[derive(Debug, PartialEq)]
|
5973 6913 | pub enum ConstraintViolation {
|
5974 6914 | /// Error when a string doesn't satisfy its `@length` requirements.
|
5975 6915 | Length(usize),
|
5976 6916 | }
|
5977 6917 |
|
5978 6918 | impl ::std::fmt::Display for ConstraintViolation {
|
5979 6919 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5980 6920 | let message = match self {
|
5981 6921 | Self::Length(length) => {
|
5982 6922 | format!("Value with length {} provided for 'aws.protocoltests.restjson.validation#MaxLengthString' failed to satisfy constraint: Member must have length less than or equal to 8", length)
|
5983 6923 | }
|
5984 6924 | };
|
5985 6925 | write!(f, "{message}")
|
5986 6926 | }
|
5987 6927 | }
|
5988 6928 |
|
5989 6929 | impl ::std::error::Error for ConstraintViolation {}
|
6930 + | /* ConstrainedStringGenerator.kt:180 */
|
5990 6931 | impl ConstraintViolation {
|
5991 6932 | pub(crate) fn as_validation_exception_field(
|
5992 6933 | self,
|
5993 6934 | path: ::std::string::String,
|
5994 6935 | ) -> crate::model::ValidationExceptionField {
|
5995 6936 | match self {
|
5996 6937 | Self::Length(length) => crate::model::ValidationExceptionField {
|
5997 6938 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 8", length, &path),
|
5998 6939 | path,
|
5999 6940 | },
|
6000 6941 | }
|
6001 6942 | }
|
6002 6943 | }
|
6944 + |
|
6945 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
6003 6946 | }
|
6004 - | /// See [`MinLengthString`](crate::model::MinLengthString).
|
6947 + | /// /* CodegenDelegator.kt:51 */See [`MinLengthString`](crate::model::MinLengthString).
|
6005 6948 | pub mod min_length_string {
|
6006 6949 |
|
6950 + | /* ConstrainedStringGenerator.kt:155 */
|
6007 6951 | #[derive(Debug, PartialEq)]
|
6008 6952 | pub enum ConstraintViolation {
|
6009 6953 | /// Error when a string doesn't satisfy its `@length` requirements.
|
6010 6954 | Length(usize),
|
6011 6955 | }
|
6012 6956 |
|
6013 6957 | impl ::std::fmt::Display for ConstraintViolation {
|
6014 6958 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6015 6959 | let message = match self {
|
6016 6960 | Self::Length(length) => {
|
6017 6961 | format!("Value with length {} provided for 'aws.protocoltests.restjson.validation#MinLengthString' failed to satisfy constraint: Member must have length greater than or equal to 2", length)
|
6018 6962 | }
|
6019 6963 | };
|
6020 6964 | write!(f, "{message}")
|
6021 6965 | }
|
6022 6966 | }
|
6023 6967 |
|
6024 6968 | impl ::std::error::Error for ConstraintViolation {}
|
6969 + | /* ConstrainedStringGenerator.kt:180 */
|
6025 6970 | impl ConstraintViolation {
|
6026 6971 | pub(crate) fn as_validation_exception_field(
|
6027 6972 | self,
|
6028 6973 | path: ::std::string::String,
|
6029 6974 | ) -> crate::model::ValidationExceptionField {
|
6030 6975 | match self {
|
6031 6976 | Self::Length(length) => crate::model::ValidationExceptionField {
|
6032 6977 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
6033 6978 | path,
|
6034 6979 | },
|
6035 6980 | }
|
6036 6981 | }
|
6037 6982 | }
|
6983 + |
|
6984 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
6038 6985 | }
|
6039 - | /// See [`LengthBlob`](crate::model::LengthBlob).
|
6986 + | /// /* CodegenDelegator.kt:51 */See [`LengthBlob`](crate::model::LengthBlob).
|
6040 6987 | pub mod length_blob {
|
6041 6988 |
|
6989 + | /* ConstrainedBlobGenerator.kt:129 */
|
6042 6990 | #[derive(Debug, PartialEq)]
|
6043 6991 | pub enum ConstraintViolation {
|
6044 6992 | /// Error when a blob doesn't satisfy its `@length` requirements.
|
6045 6993 | Length(usize),
|
6046 6994 | }
|
6047 6995 |
|
6048 6996 | impl ::std::fmt::Display for ConstraintViolation {
|
6049 6997 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6050 6998 | let message = match self {
|
6051 6999 | Self::Length(length) => {
|
6052 7000 | format!("Value with length {} provided for 'aws.protocoltests.restjson.validation#LengthBlob' failed to satisfy constraint: Member must have length between 2 and 8, inclusive", length)
|
6053 7001 | }
|
6054 7002 | };
|
6055 7003 | write!(f, "{message}")
|
6056 7004 | }
|
6057 7005 | }
|
6058 7006 |
|
6059 7007 | impl ::std::error::Error for ConstraintViolation {}
|
7008 + | /* ConstrainedBlobGenerator.kt:154 */
|
6060 7009 | impl ConstraintViolation {
|
6061 7010 | pub(crate) fn as_validation_exception_field(
|
6062 7011 | self,
|
6063 7012 | path: ::std::string::String,
|
6064 7013 | ) -> crate::model::ValidationExceptionField {
|
6065 7014 | match self {
|
6066 7015 | Self::Length(length) => crate::model::ValidationExceptionField {
|
6067 7016 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 8, inclusive", length, &path),
|
6068 7017 | path,
|
6069 7018 | },
|
6070 7019 | }
|
6071 7020 | }
|
6072 7021 | }
|
7022 + |
|
7023 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
6073 7024 | }
|
6074 7025 | pub mod enum_union {
|
6075 7026 |
|
7027 + | /* RustType.kt:516 */
|
6076 7028 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
7029 + | /* UnconstrainedUnionGenerator.kt:150 */
|
6077 7030 | #[allow(clippy::enum_variant_names)]
|
6078 7031 | pub enum ConstraintViolation {
|
7032 + | /* UnconstrainedUnionGenerator.kt:218 */
|
6079 7033 | First(crate::model::enum_string::ConstraintViolation),
|
7034 + | /* UnconstrainedUnionGenerator.kt:218 */
|
6080 7035 | Second(crate::model::enum_string::ConstraintViolation),
|
7036 + | /* UnconstrainedUnionGenerator.kt:150 */
|
6081 7037 | }
|
7038 + | /* UnconstrainedUnionGenerator.kt:158 */
|
6082 7039 | impl ::std::fmt::Display for ConstraintViolation {
|
6083 7040 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6084 7041 | match self {
|
6085 7042 | Self::First(inner) => write!(f, "{inner}"),
|
6086 7043 | Self::Second(inner) => write!(f, "{inner}"),
|
6087 7044 | }
|
6088 7045 | }
|
6089 7046 | }
|
6090 7047 |
|
6091 7048 | impl ::std::error::Error for ConstraintViolation {}
|
7049 + | /* UnconstrainedUnionGenerator.kt:176 */
|
6092 7050 | impl ConstraintViolation {
|
6093 7051 | pub(crate) fn as_validation_exception_field(
|
6094 7052 | self,
|
6095 7053 | path: ::std::string::String,
|
6096 7054 | ) -> crate::model::ValidationExceptionField {
|
6097 7055 | match self {
|
6098 7056 | Self::First(inner) => inner.as_validation_exception_field(path + "/first"),
|
6099 7057 | Self::Second(inner) => inner.as_validation_exception_field(path + "/second"),
|
6100 7058 | }
|
6101 7059 | }
|
6102 7060 | }
|
7061 + |
|
7062 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
6103 7063 | }
|
6104 7064 | pub mod enum_map {
|
6105 7065 |
|
7066 + | /* MapConstraintViolationGenerator.kt:82 */
|
6106 7067 | #[allow(clippy::enum_variant_names)]
|
6107 7068 | #[derive(Debug, PartialEq)]
|
6108 7069 | pub enum ConstraintViolation {
|
6109 7070 | #[doc(hidden)]
|
6110 7071 | Key(crate::model::enum_string::ConstraintViolation),
|
6111 7072 | #[doc(hidden)]
|
6112 7073 | Value(
|
6113 7074 | crate::model::EnumString,
|
6114 7075 | crate::model::enum_string::ConstraintViolation,
|
6115 7076 | ),
|
6116 7077 | }
|
6117 7078 |
|
6118 7079 | impl ::std::fmt::Display for ConstraintViolation {
|
6119 7080 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6120 7081 | match self {
|
6121 7082 | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
6122 7083 | Self::Value(_, value_constraint_violation) => {
|
6123 7084 | write!(f, "{}", value_constraint_violation)
|
6124 7085 | }
|
6125 7086 | }
|
6126 7087 | }
|
6127 7088 | }
|
6128 7089 |
|
6129 7090 | impl ::std::error::Error for ConstraintViolation {}
|
7091 + | /* MapConstraintViolationGenerator.kt:111 */
|
6130 7092 | impl ConstraintViolation {
|
6131 7093 | pub(crate) fn as_validation_exception_field(
|
6132 7094 | self,
|
6133 7095 | path: ::std::string::String,
|
6134 7096 | ) -> crate::model::ValidationExceptionField {
|
6135 7097 | match self {
|
6136 7098 | Self::Key(key_constraint_violation) => {
|
6137 7099 | key_constraint_violation.as_validation_exception_field(path)
|
6138 7100 | }
|
6139 7101 | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
6140 7102 | .as_validation_exception_field(path + "/" + key.as_str()),
|
6141 7103 | }
|
6142 7104 | }
|
6143 7105 | }
|
7106 + |
|
7107 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
6144 7108 | }
|
6145 7109 | pub mod enum_list {
|
6146 7110 |
|
7111 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
6147 7112 | #[allow(clippy::enum_variant_names)]
|
6148 7113 | #[derive(Debug, PartialEq)]
|
6149 7114 | pub enum ConstraintViolation {
|
6150 7115 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
6151 7116 | /// The first component of the tuple is the index in the collection where the
|
6152 7117 | /// first constraint violation was found.
|
6153 7118 | #[doc(hidden)]
|
6154 7119 | Member(usize, crate::model::enum_string::ConstraintViolation),
|
6155 7120 | }
|
6156 7121 |
|
6157 7122 | impl ::std::fmt::Display for ConstraintViolation {
|
6158 7123 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6159 7124 | let message = match self {
|
6160 7125 | Self::Member(index, failing_member) => format!(
|
6161 7126 | "Value at index {index} failed to satisfy constraint. {}",
|
6162 7127 | failing_member
|
6163 7128 | ),
|
6164 7129 | };
|
6165 7130 | write!(f, "{message}")
|
6166 7131 | }
|
6167 7132 | }
|
6168 7133 |
|
6169 7134 | impl ::std::error::Error for ConstraintViolation {}
|
7135 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
6170 7136 | impl ConstraintViolation {
|
6171 7137 | pub(crate) fn as_validation_exception_field(
|
6172 7138 | self,
|
6173 7139 | path: ::std::string::String,
|
6174 7140 | ) -> crate::model::ValidationExceptionField {
|
6175 7141 | match self {
|
6176 7142 | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
6177 7143 | .as_validation_exception_field(path + "/" + &index.to_string()),
|
6178 7144 | }
|
6179 7145 | }
|
6180 7146 | }
|
7147 + |
|
7148 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
6181 7149 | }
|