1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// Describes one specific validation failure for an input member.
|
4 + | #[derive(
|
5 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
6 + | )]
|
7 + | pub struct ValidationExceptionField {
|
8 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
9 + | pub path: ::std::string::String,
|
10 + | /// A detailed description of the validation failure.
|
11 + | pub message: ::std::string::String,
|
12 + | }
|
13 + | impl ValidationExceptionField {
|
14 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
15 + | pub fn path(&self) -> &str {
|
16 + | use std::ops::Deref;
|
17 + | self.path.deref()
|
18 + | }
|
19 + | /// A detailed description of the validation failure.
|
20 + | pub fn message(&self) -> &str {
|
21 + | use std::ops::Deref;
|
22 + | self.message.deref()
|
23 + | }
|
24 + | }
|
25 + | impl ValidationExceptionField {
|
26 + | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
27 + | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
28 + | crate::model::validation_exception_field::Builder::default()
|
29 + | }
|
30 + | }
|
31 + |
|
32 + | /// A union with a representative set of types for members.
|
33 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
34 + | pub enum MyUnion {
|
35 + | #[allow(missing_docs)] // documentation missing in model
|
36 + | BlobValue(::aws_smithy_types::Blob),
|
37 + | #[allow(missing_docs)] // documentation missing in model
|
38 + | BooleanValue(bool),
|
39 + | #[allow(missing_docs)] // documentation missing in model
|
40 + | EnumValue(crate::model::FooEnum),
|
41 + | #[allow(missing_docs)] // documentation missing in model
|
42 + | ListValue(::std::vec::Vec<::std::string::String>),
|
43 + | #[allow(missing_docs)] // documentation missing in model
|
44 + | MapValue(::std::collections::HashMap<::std::string::String, ::std::string::String>),
|
45 + | #[allow(missing_docs)] // documentation missing in model
|
46 + | NumberValue(i32),
|
47 + | #[allow(missing_docs)] // documentation missing in model
|
48 + | StringValue(::std::string::String),
|
49 + | #[allow(missing_docs)] // documentation missing in model
|
50 + | StructureValue(crate::model::GreetingStruct),
|
51 + | #[allow(missing_docs)] // documentation missing in model
|
52 + | TimestampValue(::aws_smithy_types::DateTime),
|
53 + | }
|
54 + | impl MyUnion {
|
55 + | /// Tries to convert the enum instance into [`BlobValue`](crate::model::MyUnion::BlobValue), extracting the inner [`Blob`](::aws_smithy_types::Blob).
|
56 + | /// Returns `Err(&Self)` if it can't be converted.
|
57 + | pub fn as_blob_value(&self) -> ::std::result::Result<&::aws_smithy_types::Blob, &Self> {
|
58 + | if let MyUnion::BlobValue(val) = &self {
|
59 + | ::std::result::Result::Ok(val)
|
60 + | } else {
|
61 + | ::std::result::Result::Err(self)
|
62 + | }
|
63 + | }
|
64 + | /// Returns true if this is a [`BlobValue`](crate::model::MyUnion::BlobValue).
|
65 + | pub fn is_blob_value(&self) -> bool {
|
66 + | self.as_blob_value().is_ok()
|
67 + | }
|
68 + | /// Tries to convert the enum instance into [`BooleanValue`](crate::model::MyUnion::BooleanValue), extracting the inner [`bool`](bool).
|
69 + | /// Returns `Err(&Self)` if it can't be converted.
|
70 + | pub fn as_boolean_value(&self) -> ::std::result::Result<&bool, &Self> {
|
71 + | if let MyUnion::BooleanValue(val) = &self {
|
72 + | ::std::result::Result::Ok(val)
|
73 + | } else {
|
74 + | ::std::result::Result::Err(self)
|
75 + | }
|
76 + | }
|
77 + | /// Returns true if this is a [`BooleanValue`](crate::model::MyUnion::BooleanValue).
|
78 + | pub fn is_boolean_value(&self) -> bool {
|
79 + | self.as_boolean_value().is_ok()
|
80 + | }
|
81 + | /// Tries to convert the enum instance into [`EnumValue`](crate::model::MyUnion::EnumValue), extracting the inner [`FooEnum`](crate::model::FooEnum).
|
82 + | /// Returns `Err(&Self)` if it can't be converted.
|
83 + | pub fn as_enum_value(&self) -> ::std::result::Result<&crate::model::FooEnum, &Self> {
|
84 + | if let MyUnion::EnumValue(val) = &self {
|
85 + | ::std::result::Result::Ok(val)
|
86 + | } else {
|
87 + | ::std::result::Result::Err(self)
|
88 + | }
|
89 + | }
|
90 + | /// Returns true if this is a [`EnumValue`](crate::model::MyUnion::EnumValue).
|
91 + | pub fn is_enum_value(&self) -> bool {
|
92 + | self.as_enum_value().is_ok()
|
93 + | }
|
94 + | /// Tries to convert the enum instance into [`ListValue`](crate::model::MyUnion::ListValue), extracting the inner [`Vec`](::std::vec::Vec).
|
95 + | /// Returns `Err(&Self)` if it can't be converted.
|
96 + | pub fn as_list_value(
|
97 + | &self,
|
98 + | ) -> ::std::result::Result<&::std::vec::Vec<::std::string::String>, &Self> {
|
99 + | if let MyUnion::ListValue(val) = &self {
|
100 + | ::std::result::Result::Ok(val)
|
101 + | } else {
|
102 + | ::std::result::Result::Err(self)
|
103 + | }
|
104 + | }
|
105 + | /// Returns true if this is a [`ListValue`](crate::model::MyUnion::ListValue).
|
106 + | pub fn is_list_value(&self) -> bool {
|
107 + | self.as_list_value().is_ok()
|
108 + | }
|
109 + | /// Tries to convert the enum instance into [`MapValue`](crate::model::MyUnion::MapValue), extracting the inner [`HashMap`](::std::collections::HashMap).
|
110 + | /// Returns `Err(&Self)` if it can't be converted.
|
111 + | pub fn as_map_value(
|
112 + | &self,
|
113 + | ) -> ::std::result::Result<
|
114 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
115 + | &Self,
|
116 + | > {
|
117 + | if let MyUnion::MapValue(val) = &self {
|
118 + | ::std::result::Result::Ok(val)
|
119 + | } else {
|
120 + | ::std::result::Result::Err(self)
|
121 + | }
|
122 + | }
|
123 + | /// Returns true if this is a [`MapValue`](crate::model::MyUnion::MapValue).
|
124 + | pub fn is_map_value(&self) -> bool {
|
125 + | self.as_map_value().is_ok()
|
126 + | }
|
127 + | /// Tries to convert the enum instance into [`NumberValue`](crate::model::MyUnion::NumberValue), extracting the inner [`i32`](i32).
|
128 + | /// Returns `Err(&Self)` if it can't be converted.
|
129 + | pub fn as_number_value(&self) -> ::std::result::Result<&i32, &Self> {
|
130 + | if let MyUnion::NumberValue(val) = &self {
|
131 + | ::std::result::Result::Ok(val)
|
132 + | } else {
|
133 + | ::std::result::Result::Err(self)
|
134 + | }
|
135 + | }
|
136 + | /// Returns true if this is a [`NumberValue`](crate::model::MyUnion::NumberValue).
|
137 + | pub fn is_number_value(&self) -> bool {
|
138 + | self.as_number_value().is_ok()
|
139 + | }
|
140 + | /// Tries to convert the enum instance into [`StringValue`](crate::model::MyUnion::StringValue), extracting the inner [`String`](::std::string::String).
|
141 + | /// Returns `Err(&Self)` if it can't be converted.
|
142 + | pub fn as_string_value(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
143 + | if let MyUnion::StringValue(val) = &self {
|
144 + | ::std::result::Result::Ok(val)
|
145 + | } else {
|
146 + | ::std::result::Result::Err(self)
|
147 + | }
|
148 + | }
|
149 + | /// Returns true if this is a [`StringValue`](crate::model::MyUnion::StringValue).
|
150 + | pub fn is_string_value(&self) -> bool {
|
151 + | self.as_string_value().is_ok()
|
152 + | }
|
153 + | /// Tries to convert the enum instance into [`StructureValue`](crate::model::MyUnion::StructureValue), extracting the inner [`GreetingStruct`](crate::model::GreetingStruct).
|
154 + | /// Returns `Err(&Self)` if it can't be converted.
|
155 + | pub fn as_structure_value(
|
156 + | &self,
|
157 + | ) -> ::std::result::Result<&crate::model::GreetingStruct, &Self> {
|
158 + | if let MyUnion::StructureValue(val) = &self {
|
159 + | ::std::result::Result::Ok(val)
|
160 + | } else {
|
161 + | ::std::result::Result::Err(self)
|
162 + | }
|
163 + | }
|
164 + | /// Returns true if this is a [`StructureValue`](crate::model::MyUnion::StructureValue).
|
165 + | pub fn is_structure_value(&self) -> bool {
|
166 + | self.as_structure_value().is_ok()
|
167 + | }
|
168 + | /// Tries to convert the enum instance into [`TimestampValue`](crate::model::MyUnion::TimestampValue), extracting the inner [`DateTime`](::aws_smithy_types::DateTime).
|
169 + | /// Returns `Err(&Self)` if it can't be converted.
|
170 + | pub fn as_timestamp_value(
|
171 + | &self,
|
172 + | ) -> ::std::result::Result<&::aws_smithy_types::DateTime, &Self> {
|
173 + | if let MyUnion::TimestampValue(val) = &self {
|
174 + | ::std::result::Result::Ok(val)
|
175 + | } else {
|
176 + | ::std::result::Result::Err(self)
|
177 + | }
|
178 + | }
|
179 + | /// Returns true if this is a [`TimestampValue`](crate::model::MyUnion::TimestampValue).
|
180 + | pub fn is_timestamp_value(&self) -> bool {
|
181 + | self.as_timestamp_value().is_ok()
|
182 + | }
|
183 + | }
|
184 + |
|
185 + | #[allow(missing_docs)] // documentation missing in model
|
186 + | #[derive(
|
187 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
188 + | )]
|
189 + | pub struct GreetingStruct {
|
190 + | #[allow(missing_docs)] // documentation missing in model
|
191 + | pub hi: ::std::option::Option<::std::string::String>,
|
192 + | }
|
193 + | impl GreetingStruct {
|
194 + | #[allow(missing_docs)] // documentation missing in model
|
195 + | pub fn hi(&self) -> ::std::option::Option<&str> {
|
196 + | self.hi.as_deref()
|
197 + | }
|
198 + | }
|
199 + | impl GreetingStruct {
|
200 + | /// Creates a new builder-style object to manufacture [`GreetingStruct`](crate::model::GreetingStruct).
|
201 + | pub fn builder() -> crate::model::greeting_struct::Builder {
|
202 + | crate::model::greeting_struct::Builder::default()
|
203 + | }
|
204 + | }
|
205 + | impl crate::constrained::Constrained for crate::model::GreetingStruct {
|
206 + | type Unconstrained = crate::model::greeting_struct::Builder;
|
207 + | }
|
208 + |
|
209 + | #[allow(missing_docs)] // documentation missing in model
|
210 + | #[derive(
|
211 + | ::std::clone::Clone,
|
212 + | ::std::cmp::Eq,
|
213 + | ::std::cmp::Ord,
|
214 + | ::std::cmp::PartialEq,
|
215 + | ::std::cmp::PartialOrd,
|
216 + | ::std::fmt::Debug,
|
217 + | ::std::hash::Hash,
|
218 + | )]
|
219 + | pub enum FooEnum {
|
220 + | #[allow(missing_docs)] // documentation missing in model
|
221 + | Zero,
|
222 + | #[allow(missing_docs)] // documentation missing in model
|
223 + | One,
|
224 + | #[allow(missing_docs)] // documentation missing in model
|
225 + | Bar,
|
226 + | #[allow(missing_docs)] // documentation missing in model
|
227 + | Baz,
|
228 + | #[allow(missing_docs)] // documentation missing in model
|
229 + | Foo,
|
230 + | }
|
231 + | /// See [`FooEnum`](crate::model::FooEnum).
|
232 + | pub mod foo_enum {
|
233 + | #[derive(Debug, PartialEq)]
|
234 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
235 + |
|
236 + | impl ::std::fmt::Display for ConstraintViolation {
|
237 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
238 + | write!(
|
239 + | f,
|
240 + | r#"Value provided for 'aws.protocoltests.shared#FooEnum' failed to satisfy constraint: Member must satisfy enum value set: [Foo, Baz, Bar, 1, 0]"#
|
241 + | )
|
242 + | }
|
243 + | }
|
244 + |
|
245 + | impl ::std::error::Error for ConstraintViolation {}
|
246 + | impl ConstraintViolation {
|
247 + | pub(crate) fn as_validation_exception_field(
|
248 + | self,
|
249 + | path: ::std::string::String,
|
250 + | ) -> crate::model::ValidationExceptionField {
|
251 + | crate::model::ValidationExceptionField {
|
252 + | message: format!(
|
253 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [Foo, Baz, Bar, 1, 0]"#,
|
254 + | &path
|
255 + | ),
|
256 + | path,
|
257 + | }
|
258 + | }
|
259 + | }
|
260 + | }
|
261 + | impl ::std::convert::TryFrom<&str> for FooEnum {
|
262 + | type Error = crate::model::foo_enum::ConstraintViolation;
|
263 + | fn try_from(
|
264 + | s: &str,
|
265 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
266 + | match s {
|
267 + | "0" => Ok(FooEnum::Zero),
|
268 + | "1" => Ok(FooEnum::One),
|
269 + | "Bar" => Ok(FooEnum::Bar),
|
270 + | "Baz" => Ok(FooEnum::Baz),
|
271 + | "Foo" => Ok(FooEnum::Foo),
|
272 + | _ => Err(crate::model::foo_enum::ConstraintViolation(s.to_owned())),
|
273 + | }
|
274 + | }
|
275 + | }
|
276 + | impl ::std::convert::TryFrom<::std::string::String> for FooEnum {
|
277 + | type Error = crate::model::foo_enum::ConstraintViolation;
|
278 + | fn try_from(
|
279 + | s: ::std::string::String,
|
280 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
281 + | {
|
282 + | s.as_str().try_into()
|
283 + | }
|
284 + | }
|
285 + | impl std::str::FromStr for FooEnum {
|
286 + | type Err = crate::model::foo_enum::ConstraintViolation;
|
287 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
288 + | Self::try_from(s)
|
289 + | }
|
290 + | }
|
291 + | impl FooEnum {
|
292 + | /// Returns the `&str` value of the enum member.
|
293 + | pub fn as_str(&self) -> &str {
|
294 + | match self {
|
295 + | FooEnum::Zero => "0",
|
296 + | FooEnum::One => "1",
|
297 + | FooEnum::Bar => "Bar",
|
298 + | FooEnum::Baz => "Baz",
|
299 + | FooEnum::Foo => "Foo",
|
300 + | }
|
301 + | }
|
302 + | /// Returns all the `&str` representations of the enum members.
|
303 + | pub const fn values() -> &'static [&'static str] {
|
304 + | &["0", "1", "Bar", "Baz", "Foo"]
|
305 + | }
|
306 + | }
|
307 + | impl ::std::convert::AsRef<str> for FooEnum {
|
308 + | fn as_ref(&self) -> &str {
|
309 + | self.as_str()
|
310 + | }
|
311 + | }
|
312 + | impl crate::constrained::Constrained for FooEnum {
|
313 + | type Unconstrained = ::std::string::String;
|
314 + | }
|
315 + |
|
316 + | impl ::std::convert::From<::std::string::String>
|
317 + | for crate::constrained::MaybeConstrained<crate::model::FooEnum>
|
318 + | {
|
319 + | fn from(value: ::std::string::String) -> Self {
|
320 + | Self::Unconstrained(value)
|
321 + | }
|
322 + | }
|
323 + |
|
324 + | #[allow(missing_docs)] // documentation missing in model
|
325 + | #[derive(
|
326 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
327 + | )]
|
328 + | pub struct ComplexNestedErrorData {
|
329 + | #[allow(missing_docs)] // documentation missing in model
|
330 + | pub foo: ::std::option::Option<::std::string::String>,
|
331 + | }
|
332 + | impl ComplexNestedErrorData {
|
333 + | #[allow(missing_docs)] // documentation missing in model
|
334 + | pub fn foo(&self) -> ::std::option::Option<&str> {
|
335 + | self.foo.as_deref()
|
336 + | }
|
337 + | }
|
338 + | impl ComplexNestedErrorData {
|
339 + | /// Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
340 + | pub fn builder() -> crate::model::complex_nested_error_data::Builder {
|
341 + | crate::model::complex_nested_error_data::Builder::default()
|
342 + | }
|
343 + | }
|
344 + |
|
345 + | #[allow(missing_docs)] // documentation missing in model
|
346 + | ///
|
347 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
348 + | /// [constraint traits]. Use [`IntegerEnumSet::try_from`] to construct values of this type.
|
349 + | ///
|
350 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
351 + | ///
|
352 + | #[derive(
|
353 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
354 + | )]
|
355 + | pub struct IntegerEnumSet(pub(crate) ::std::vec::Vec<i32>);
|
356 + | impl IntegerEnumSet {
|
357 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<i32>`].
|
358 + | pub fn inner(&self) -> &::std::vec::Vec<i32> {
|
359 + | &self.0
|
360 + | }
|
361 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<i32>`].
|
362 + | pub fn into_inner(self) -> ::std::vec::Vec<i32> {
|
363 + | self.0
|
364 + | }
|
365 + |
|
366 + | fn check_unique_items(
|
367 + | items: ::std::vec::Vec<i32>,
|
368 + | ) -> ::std::result::Result<
|
369 + | ::std::vec::Vec<i32>,
|
370 + | crate::model::integer_enum_set::ConstraintViolation,
|
371 + | > {
|
372 + | let mut seen = ::std::collections::HashMap::new();
|
373 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
374 + | for (idx, item) in items.iter().enumerate() {
|
375 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
376 + | duplicate_indices.push(prev_idx);
|
377 + | }
|
378 + | }
|
379 + |
|
380 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
381 + | for idx in &duplicate_indices {
|
382 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
383 + | last_duplicate_indices.push(prev_idx);
|
384 + | }
|
385 + | }
|
386 + | duplicate_indices.extend(last_duplicate_indices);
|
387 + |
|
388 + | if !duplicate_indices.is_empty() {
|
389 + | debug_assert!(duplicate_indices.len() >= 2);
|
390 + | Err(
|
391 + | crate::model::integer_enum_set::ConstraintViolation::UniqueItems {
|
392 + | duplicate_indices,
|
393 + | original: items,
|
394 + | },
|
395 + | )
|
396 + | } else {
|
397 + | Ok(items)
|
398 + | }
|
399 + | }
|
400 + | }
|
401 + | impl ::std::convert::TryFrom<::std::vec::Vec<i32>> for IntegerEnumSet {
|
402 + | type Error = crate::model::integer_enum_set::ConstraintViolation;
|
403 + |
|
404 + | /// Constructs a `IntegerEnumSet` from an [`::std::vec::Vec<i32>`], failing when the provided value does not satisfy the modeled constraints.
|
405 + | fn try_from(value: ::std::vec::Vec<i32>) -> ::std::result::Result<Self, Self::Error> {
|
406 + | let value = Self::check_unique_items(value)?;
|
407 + |
|
408 + | Ok(Self(value))
|
409 + | }
|
410 + | }
|
411 + |
|
412 + | impl ::std::convert::From<IntegerEnumSet> for ::std::vec::Vec<i32> {
|
413 + | fn from(value: IntegerEnumSet) -> Self {
|
414 + | value.into_inner()
|
415 + | }
|
416 + | }
|
417 + | impl crate::constrained::Constrained for IntegerEnumSet {
|
418 + | type Unconstrained =
|
419 + | crate::unconstrained::integer_enum_set_unconstrained::IntegerEnumSetUnconstrained;
|
420 + | }
|
421 + |
|
422 + | #[allow(missing_docs)] // documentation missing in model
|
423 + | ///
|
424 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
425 + | /// [constraint traits]. Use [`FooEnumSet::try_from`] to construct values of this type.
|
426 + | ///
|
427 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
428 + | ///
|
429 + | #[derive(
|
430 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
431 + | )]
|
432 + | pub struct FooEnumSet(pub(crate) ::std::vec::Vec<crate::model::FooEnum>);
|
433 + | impl FooEnumSet {
|
434 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::FooEnum>`].
|
435 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::FooEnum> {
|
436 + | &self.0
|
437 + | }
|
438 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::FooEnum>`].
|
439 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::FooEnum> {
|
440 + | self.0
|
441 + | }
|
442 + |
|
443 + | fn check_unique_items(
|
444 + | items: ::std::vec::Vec<crate::model::FooEnum>,
|
445 + | ) -> ::std::result::Result<
|
446 + | ::std::vec::Vec<crate::model::FooEnum>,
|
447 + | crate::model::foo_enum_set::ConstraintViolation,
|
448 + | > {
|
449 + | let mut seen = ::std::collections::HashMap::new();
|
450 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
451 + | for (idx, item) in items.iter().enumerate() {
|
452 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
453 + | duplicate_indices.push(prev_idx);
|
454 + | }
|
455 + | }
|
456 + |
|
457 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
458 + | for idx in &duplicate_indices {
|
459 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
460 + | last_duplicate_indices.push(prev_idx);
|
461 + | }
|
462 + | }
|
463 + | duplicate_indices.extend(last_duplicate_indices);
|
464 + |
|
465 + | if !duplicate_indices.is_empty() {
|
466 + | debug_assert!(duplicate_indices.len() >= 2);
|
467 + | Err(
|
468 + | crate::model::foo_enum_set::ConstraintViolation::UniqueItems {
|
469 + | duplicate_indices,
|
470 + | original: items,
|
471 + | },
|
472 + | )
|
473 + | } else {
|
474 + | Ok(items)
|
475 + | }
|
476 + | }
|
477 + | }
|
478 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::FooEnum>> for FooEnumSet {
|
479 + | type Error = crate::model::foo_enum_set::ConstraintViolation;
|
480 + |
|
481 + | /// Constructs a `FooEnumSet` from an [`::std::vec::Vec<crate::model::FooEnum>`], failing when the provided value does not satisfy the modeled constraints.
|
482 + | fn try_from(
|
483 + | value: ::std::vec::Vec<crate::model::FooEnum>,
|
484 + | ) -> ::std::result::Result<Self, Self::Error> {
|
485 + | let value = Self::check_unique_items(value)?;
|
486 + |
|
487 + | Ok(Self(value))
|
488 + | }
|
489 + | }
|
490 + |
|
491 + | impl ::std::convert::From<FooEnumSet> for ::std::vec::Vec<crate::model::FooEnum> {
|
492 + | fn from(value: FooEnumSet) -> Self {
|
493 + | value.into_inner()
|
494 + | }
|
495 + | }
|
496 + | impl crate::constrained::Constrained for FooEnumSet {
|
497 + | type Unconstrained = crate::unconstrained::foo_enum_set_unconstrained::FooEnumSetUnconstrained;
|
498 + | }
|
499 + |
|
500 + | #[allow(missing_docs)] // documentation missing in model
|
501 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
502 + | pub struct KitchenSink {
|
503 + | #[allow(missing_docs)] // documentation missing in model
|
504 + | pub blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
505 + | #[allow(missing_docs)] // documentation missing in model
|
506 + | pub boolean: ::std::option::Option<bool>,
|
507 + | #[allow(missing_docs)] // documentation missing in model
|
508 + | pub double: ::std::option::Option<f64>,
|
509 + | #[allow(missing_docs)] // documentation missing in model
|
510 + | pub empty_struct: ::std::option::Option<crate::model::EmptyStruct>,
|
511 + | #[allow(missing_docs)] // documentation missing in model
|
512 + | pub float: ::std::option::Option<f32>,
|
513 + | #[allow(missing_docs)] // documentation missing in model
|
514 + | pub httpdate_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
515 + | #[allow(missing_docs)] // documentation missing in model
|
516 + | pub integer: ::std::option::Option<i32>,
|
517 + | #[allow(missing_docs)] // documentation missing in model
|
518 + | pub iso8601_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
519 + | #[allow(missing_docs)] // documentation missing in model
|
520 + | pub json_value: ::std::option::Option<::std::string::String>,
|
521 + | #[allow(missing_docs)] // documentation missing in model
|
522 + | pub list_of_lists:
|
523 + | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
524 + | #[allow(missing_docs)] // documentation missing in model
|
525 + | pub list_of_maps_of_strings: ::std::option::Option<
|
526 + | ::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
|
527 + | >,
|
528 + | #[allow(missing_docs)] // documentation missing in model
|
529 + | pub list_of_strings: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
530 + | #[allow(missing_docs)] // documentation missing in model
|
531 + | pub list_of_structs: ::std::option::Option<::std::vec::Vec<crate::model::SimpleStruct>>,
|
532 + | #[allow(missing_docs)] // documentation missing in model
|
533 + | pub long: ::std::option::Option<i64>,
|
534 + | #[allow(missing_docs)] // documentation missing in model
|
535 + | pub map_of_lists_of_strings: ::std::option::Option<
|
536 + | ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>,
|
537 + | >,
|
538 + | #[allow(missing_docs)] // documentation missing in model
|
539 + | pub map_of_maps: ::std::option::Option<
|
540 + | ::std::collections::HashMap<
|
541 + | ::std::string::String,
|
542 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
543 + | >,
|
544 + | >,
|
545 + | #[allow(missing_docs)] // documentation missing in model
|
546 + | pub map_of_strings: ::std::option::Option<
|
547 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
548 + | >,
|
549 + | #[allow(missing_docs)] // documentation missing in model
|
550 + | pub map_of_structs: ::std::option::Option<
|
551 + | ::std::collections::HashMap<::std::string::String, crate::model::SimpleStruct>,
|
552 + | >,
|
553 + | #[allow(missing_docs)] // documentation missing in model
|
554 + | pub recursive_list: ::std::option::Option<::std::vec::Vec<crate::model::KitchenSink>>,
|
555 + | #[allow(missing_docs)] // documentation missing in model
|
556 + | pub recursive_map: ::std::option::Option<
|
557 + | ::std::collections::HashMap<::std::string::String, crate::model::KitchenSink>,
|
558 + | >,
|
559 + | #[allow(missing_docs)] // documentation missing in model
|
560 + | pub recursive_struct: ::std::option::Option<::std::boxed::Box<crate::model::KitchenSink>>,
|
561 + | #[allow(missing_docs)] // documentation missing in model
|
562 + | pub simple_struct: ::std::option::Option<crate::model::SimpleStruct>,
|
563 + | #[allow(missing_docs)] // documentation missing in model
|
564 + | pub string: ::std::option::Option<::std::string::String>,
|
565 + | #[allow(missing_docs)] // documentation missing in model
|
566 + | pub struct_with_json_name: ::std::option::Option<crate::model::StructWithJsonName>,
|
567 + | #[allow(missing_docs)] // documentation missing in model
|
568 + | pub timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
569 + | #[allow(missing_docs)] // documentation missing in model
|
570 + | pub unix_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
571 + | }
|
572 + | impl KitchenSink {
|
573 + | #[allow(missing_docs)] // documentation missing in model
|
574 + | pub fn blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
575 + | self.blob.as_ref()
|
576 + | }
|
577 + | #[allow(missing_docs)] // documentation missing in model
|
578 + | pub fn boolean(&self) -> ::std::option::Option<bool> {
|
579 + | self.boolean
|
580 + | }
|
581 + | #[allow(missing_docs)] // documentation missing in model
|
582 + | pub fn double(&self) -> ::std::option::Option<f64> {
|
583 + | self.double
|
584 + | }
|
585 + | #[allow(missing_docs)] // documentation missing in model
|
586 + | pub fn empty_struct(&self) -> ::std::option::Option<&crate::model::EmptyStruct> {
|
587 + | self.empty_struct.as_ref()
|
588 + | }
|
589 + | #[allow(missing_docs)] // documentation missing in model
|
590 + | pub fn float(&self) -> ::std::option::Option<f32> {
|
591 + | self.float
|
592 + | }
|
593 + | #[allow(missing_docs)] // documentation missing in model
|
594 + | pub fn httpdate_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
595 + | self.httpdate_timestamp.as_ref()
|
596 + | }
|
597 + | #[allow(missing_docs)] // documentation missing in model
|
598 + | pub fn integer(&self) -> ::std::option::Option<i32> {
|
599 + | self.integer
|
600 + | }
|
601 + | #[allow(missing_docs)] // documentation missing in model
|
602 + | pub fn iso8601_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
603 + | self.iso8601_timestamp.as_ref()
|
604 + | }
|
605 + | #[allow(missing_docs)] // documentation missing in model
|
606 + | pub fn json_value(&self) -> ::std::option::Option<&str> {
|
607 + | self.json_value.as_deref()
|
608 + | }
|
609 + | #[allow(missing_docs)] // documentation missing in model
|
610 + | pub fn list_of_lists(
|
611 + | &self,
|
612 + | ) -> ::std::option::Option<&[::std::vec::Vec<::std::string::String>]> {
|
613 + | self.list_of_lists.as_deref()
|
614 + | }
|
615 + | #[allow(missing_docs)] // documentation missing in model
|
616 + | pub fn list_of_maps_of_strings(
|
617 + | &self,
|
618 + | ) -> ::std::option::Option<
|
619 + | &[::std::collections::HashMap<::std::string::String, ::std::string::String>],
|
620 + | > {
|
621 + | self.list_of_maps_of_strings.as_deref()
|
622 + | }
|
623 + | #[allow(missing_docs)] // documentation missing in model
|
624 + | pub fn list_of_strings(&self) -> ::std::option::Option<&[::std::string::String]> {
|
625 + | self.list_of_strings.as_deref()
|
626 + | }
|
627 + | #[allow(missing_docs)] // documentation missing in model
|
628 + | pub fn list_of_structs(&self) -> ::std::option::Option<&[crate::model::SimpleStruct]> {
|
629 + | self.list_of_structs.as_deref()
|
630 + | }
|
631 + | #[allow(missing_docs)] // documentation missing in model
|
632 + | pub fn long(&self) -> ::std::option::Option<i64> {
|
633 + | self.long
|
634 + | }
|
635 + | #[allow(missing_docs)] // documentation missing in model
|
636 + | pub fn map_of_lists_of_strings(
|
637 + | &self,
|
638 + | ) -> ::std::option::Option<
|
639 + | &::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>,
|
640 + | > {
|
641 + | self.map_of_lists_of_strings.as_ref()
|
642 + | }
|
643 + | #[allow(missing_docs)] // documentation missing in model
|
644 + | pub fn map_of_maps(
|
645 + | &self,
|
646 + | ) -> ::std::option::Option<
|
647 + | &::std::collections::HashMap<
|
648 + | ::std::string::String,
|
649 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
650 + | >,
|
651 + | > {
|
652 + | self.map_of_maps.as_ref()
|
653 + | }
|
654 + | #[allow(missing_docs)] // documentation missing in model
|
655 + | pub fn map_of_strings(
|
656 + | &self,
|
657 + | ) -> ::std::option::Option<
|
658 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
659 + | > {
|
660 + | self.map_of_strings.as_ref()
|
661 + | }
|
662 + | #[allow(missing_docs)] // documentation missing in model
|
663 + | pub fn map_of_structs(
|
664 + | &self,
|
665 + | ) -> ::std::option::Option<
|
666 + | &::std::collections::HashMap<::std::string::String, crate::model::SimpleStruct>,
|
667 + | > {
|
668 + | self.map_of_structs.as_ref()
|
669 + | }
|
670 + | #[allow(missing_docs)] // documentation missing in model
|
671 + | pub fn recursive_list(&self) -> ::std::option::Option<&[crate::model::KitchenSink]> {
|
672 + | self.recursive_list.as_deref()
|
673 + | }
|
674 + | #[allow(missing_docs)] // documentation missing in model
|
675 + | pub fn recursive_map(
|
676 + | &self,
|
677 + | ) -> ::std::option::Option<
|
678 + | &::std::collections::HashMap<::std::string::String, crate::model::KitchenSink>,
|
679 + | > {
|
680 + | self.recursive_map.as_ref()
|
681 + | }
|
682 + | #[allow(missing_docs)] // documentation missing in model
|
683 + | pub fn recursive_struct(&self) -> ::std::option::Option<&crate::model::KitchenSink> {
|
684 + | self.recursive_struct.as_deref()
|
685 + | }
|
686 + | #[allow(missing_docs)] // documentation missing in model
|
687 + | pub fn simple_struct(&self) -> ::std::option::Option<&crate::model::SimpleStruct> {
|
688 + | self.simple_struct.as_ref()
|
689 + | }
|
690 + | #[allow(missing_docs)] // documentation missing in model
|
691 + | pub fn string(&self) -> ::std::option::Option<&str> {
|
692 + | self.string.as_deref()
|
693 + | }
|
694 + | #[allow(missing_docs)] // documentation missing in model
|
695 + | pub fn struct_with_json_name(
|
696 + | &self,
|
697 + | ) -> ::std::option::Option<&crate::model::StructWithJsonName> {
|
698 + | self.struct_with_json_name.as_ref()
|
699 + | }
|
700 + | #[allow(missing_docs)] // documentation missing in model
|
701 + | pub fn timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
702 + | self.timestamp.as_ref()
|
703 + | }
|
704 + | #[allow(missing_docs)] // documentation missing in model
|
705 + | pub fn unix_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
706 + | self.unix_timestamp.as_ref()
|
707 + | }
|
708 + | }
|
709 + | impl KitchenSink {
|
710 + | /// Creates a new builder-style object to manufacture [`KitchenSink`](crate::model::KitchenSink).
|
711 + | pub fn builder() -> crate::model::kitchen_sink::Builder {
|
712 + | crate::model::kitchen_sink::Builder::default()
|
713 + | }
|
714 + | }
|
715 + | impl crate::constrained::Constrained for crate::model::KitchenSink {
|
716 + | type Unconstrained = crate::model::kitchen_sink::Builder;
|
717 + | }
|
718 + |
|
719 + | #[allow(missing_docs)] // documentation missing in model
|
720 + | #[derive(
|
721 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
722 + | )]
|
723 + | pub struct StructWithJsonName {
|
724 + | #[allow(missing_docs)] // documentation missing in model
|
725 + | pub value: ::std::option::Option<::std::string::String>,
|
726 + | }
|
727 + | impl StructWithJsonName {
|
728 + | #[allow(missing_docs)] // documentation missing in model
|
729 + | pub fn value(&self) -> ::std::option::Option<&str> {
|
730 + | self.value.as_deref()
|
731 + | }
|
732 + | }
|
733 + | impl StructWithJsonName {
|
734 + | /// Creates a new builder-style object to manufacture [`StructWithJsonName`](crate::model::StructWithJsonName).
|
735 + | pub fn builder() -> crate::model::struct_with_json_name::Builder {
|
736 + | crate::model::struct_with_json_name::Builder::default()
|
737 + | }
|
738 + | }
|
739 + | impl crate::constrained::Constrained for crate::model::StructWithJsonName {
|
740 + | type Unconstrained = crate::model::struct_with_json_name::Builder;
|
741 + | }
|
742 + |
|
743 + | #[allow(missing_docs)] // documentation missing in model
|
744 + | #[derive(
|
745 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
746 + | )]
|
747 + | pub struct SimpleStruct {
|
748 + | #[allow(missing_docs)] // documentation missing in model
|
749 + | pub value: ::std::option::Option<::std::string::String>,
|
750 + | }
|
751 + | impl SimpleStruct {
|
752 + | #[allow(missing_docs)] // documentation missing in model
|
753 + | pub fn value(&self) -> ::std::option::Option<&str> {
|
754 + | self.value.as_deref()
|
755 + | }
|
756 + | }
|
757 + | impl SimpleStruct {
|
758 + | /// Creates a new builder-style object to manufacture [`SimpleStruct`](crate::model::SimpleStruct).
|
759 + | pub fn builder() -> crate::model::simple_struct::Builder {
|
760 + | crate::model::simple_struct::Builder::default()
|
761 + | }
|
762 + | }
|
763 + | impl crate::constrained::Constrained for crate::model::SimpleStruct {
|
764 + | type Unconstrained = crate::model::simple_struct::Builder;
|
765 + | }
|
766 + |
|
767 + | #[allow(missing_docs)] // documentation missing in model
|
768 + | #[derive(
|
769 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
770 + | )]
|
771 + | pub struct EmptyStruct {}
|
772 + | impl EmptyStruct {
|
773 + | /// Creates a new builder-style object to manufacture [`EmptyStruct`](crate::model::EmptyStruct).
|
774 + | pub fn builder() -> crate::model::empty_struct::Builder {
|
775 + | crate::model::empty_struct::Builder::default()
|
776 + | }
|
777 + | }
|
778 + | impl crate::constrained::Constrained for crate::model::EmptyStruct {
|
779 + | type Unconstrained = crate::model::empty_struct::Builder;
|
780 + | }
|
781 + | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
782 + | pub mod validation_exception_field {
|
783 + |
|
784 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
785 + | /// Holds one variant for each of the ways the builder can fail.
|
786 + | #[non_exhaustive]
|
787 + | #[allow(clippy::enum_variant_names)]
|
788 + | pub enum ConstraintViolation {
|
789 + | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
790 + | MissingPath,
|
791 + | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
792 + | MissingMessage,
|
793 + | }
|
794 + | impl ::std::fmt::Display for ConstraintViolation {
|
795 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
796 + | match self {
|
797 + | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
798 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
799 + | }
|
800 + | }
|
801 + | }
|
802 + | impl ::std::error::Error for ConstraintViolation {}
|
803 + | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
804 + | type Error = ConstraintViolation;
|
805 + |
|
806 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
807 + | builder.build()
|
808 + | }
|
809 + | }
|
810 + | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
811 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
812 + | pub struct Builder {
|
813 + | pub(crate) path: ::std::option::Option<::std::string::String>,
|
814 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
815 + | }
|
816 + | impl Builder {
|
817 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
818 + | pub fn path(mut self, input: ::std::string::String) -> Self {
|
819 + | self.path = Some(input);
|
820 + | self
|
821 + | }
|
822 + | /// A detailed description of the validation failure.
|
823 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
824 + | self.message = Some(input);
|
825 + | self
|
826 + | }
|
827 + | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
828 + | ///
|
829 + | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
|
830 + | ///
|
831 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
832 + | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
833 + | self.build_enforcing_all_constraints()
|
834 + | }
|
835 + | fn build_enforcing_all_constraints(
|
836 + | self,
|
837 + | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
838 + | Ok(crate::model::ValidationExceptionField {
|
839 + | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
840 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
841 + | })
|
842 + | }
|
843 + | }
|
844 + | }
|
845 + | pub mod my_union {
|
846 + |
|
847 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
848 + | #[allow(clippy::enum_variant_names)]
|
849 + | pub enum ConstraintViolation {
|
850 + | EnumValue(crate::model::foo_enum::ConstraintViolation),
|
851 + | }
|
852 + | impl ::std::fmt::Display for ConstraintViolation {
|
853 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
854 + | match self {
|
855 + | Self::EnumValue(inner) => write!(f, "{inner}"),
|
856 + | }
|
857 + | }
|
858 + | }
|
859 + |
|
860 + | impl ::std::error::Error for ConstraintViolation {}
|
861 + | impl ConstraintViolation {
|
862 + | pub(crate) fn as_validation_exception_field(
|
863 + | self,
|
864 + | path: ::std::string::String,
|
865 + | ) -> crate::model::ValidationExceptionField {
|
866 + | match self {
|
867 + | Self::EnumValue(inner) => inner.as_validation_exception_field(path + "/enumValue"),
|
868 + | }
|
869 + | }
|
870 + | }
|
871 + | }
|
872 + | /// See [`GreetingStruct`](crate::model::GreetingStruct).
|
873 + | pub mod greeting_struct {
|
874 + |
|
875 + | impl ::std::convert::From<Builder> for crate::model::GreetingStruct {
|
876 + | fn from(builder: Builder) -> Self {
|
877 + | builder.build()
|
878 + | }
|
879 + | }
|
880 + | /// A builder for [`GreetingStruct`](crate::model::GreetingStruct).
|
881 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
882 + | pub struct Builder {
|
883 + | pub(crate) hi: ::std::option::Option<::std::string::String>,
|
884 + | }
|
885 + | impl Builder {
|
886 + | #[allow(missing_docs)] // documentation missing in model
|
887 + | pub fn hi(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
888 + | self.hi = input;
|
889 + | self
|
890 + | }
|
891 + | #[allow(missing_docs)] // documentation missing in model
|
892 + | pub(crate) fn set_hi(
|
893 + | mut self,
|
894 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
895 + | ) -> Self {
|
896 + | self.hi = input.map(|v| v.into());
|
897 + | self
|
898 + | }
|
899 + | /// Consumes the builder and constructs a [`GreetingStruct`](crate::model::GreetingStruct).
|
900 + | pub fn build(self) -> crate::model::GreetingStruct {
|
901 + | self.build_enforcing_all_constraints()
|
902 + | }
|
903 + | fn build_enforcing_all_constraints(self) -> crate::model::GreetingStruct {
|
904 + | crate::model::GreetingStruct { hi: self.hi }
|
905 + | }
|
906 + | }
|
907 + | }
|
908 + | /// See [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
909 + | pub mod complex_nested_error_data {
|
910 + |
|
911 + | impl ::std::convert::From<Builder> for crate::model::ComplexNestedErrorData {
|
912 + | fn from(builder: Builder) -> Self {
|
913 + | builder.build()
|
914 + | }
|
915 + | }
|
916 + | /// A builder for [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
917 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
918 + | pub struct Builder {
|
919 + | pub(crate) foo: ::std::option::Option<::std::string::String>,
|
920 + | }
|
921 + | impl Builder {
|
922 + | #[allow(missing_docs)] // documentation missing in model
|
923 + | pub fn foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
924 + | self.foo = input;
|
925 + | self
|
926 + | }
|
927 + | /// Consumes the builder and constructs a [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
928 + | pub fn build(self) -> crate::model::ComplexNestedErrorData {
|
929 + | self.build_enforcing_all_constraints()
|
930 + | }
|
931 + | fn build_enforcing_all_constraints(self) -> crate::model::ComplexNestedErrorData {
|
932 + | crate::model::ComplexNestedErrorData { foo: self.foo }
|
933 + | }
|
934 + | }
|
935 + | }
|
936 + | /// See [`IntegerEnumSet`](crate::model::IntegerEnumSet).
|
937 + | pub mod integer_enum_set {
|
938 + |
|
939 + | #[allow(clippy::enum_variant_names)]
|
940 + | #[derive(Debug, PartialEq)]
|
941 + | pub enum ConstraintViolation {
|
942 + | /// Constraint violation error when the list does not contain unique items
|
943 + | UniqueItems {
|
944 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
945 + | /// at least two elements.
|
946 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
947 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
948 + | /// Nothing is guaranteed about the order of the indices.
|
949 + | duplicate_indices: ::std::vec::Vec<usize>,
|
950 + | /// The original vector, that contains duplicate items.
|
951 + | original: ::std::vec::Vec<i32>,
|
952 + | },
|
953 + | }
|
954 + |
|
955 + | impl ::std::fmt::Display for ConstraintViolation {
|
956 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
957 + | let message = match self {
|
958 + | Self::UniqueItems { duplicate_indices, .. } =>
|
959 + | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#IntegerEnumSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
960 + | };
|
961 + | write!(f, "{message}")
|
962 + | }
|
963 + | }
|
964 + |
|
965 + | impl ::std::error::Error for ConstraintViolation {}
|
966 + | impl ConstraintViolation {
|
967 + | pub(crate) fn as_validation_exception_field(
|
968 + | self,
|
969 + | path: ::std::string::String,
|
970 + | ) -> crate::model::ValidationExceptionField {
|
971 + | match self {
|
972 + | Self::UniqueItems { duplicate_indices, .. } =>
|
973 + | crate::model::ValidationExceptionField {
|
974 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
975 + | path,
|
976 + | },
|
977 + | }
|
978 + | }
|
979 + | }
|
980 + | }
|
981 + | pub mod foo_enum_map {
|
982 + |
|
983 + | #[allow(clippy::enum_variant_names)]
|
984 + | #[derive(Debug, PartialEq)]
|
985 + | pub enum ConstraintViolation {
|
986 + | #[doc(hidden)]
|
987 + | Value(
|
988 + | ::std::string::String,
|
989 + | crate::model::foo_enum::ConstraintViolation,
|
990 + | ),
|
991 + | }
|
992 + |
|
993 + | impl ::std::fmt::Display for ConstraintViolation {
|
994 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
995 + | match self {
|
996 + | Self::Value(_, value_constraint_violation) => {
|
997 + | write!(f, "{}", value_constraint_violation)
|
998 + | }
|
999 + | }
|
1000 + | }
|
1001 + | }
|
1002 + |
|
1003 + | impl ::std::error::Error for ConstraintViolation {}
|
1004 + | impl ConstraintViolation {
|
1005 + | pub(crate) fn as_validation_exception_field(
|
1006 + | self,
|
1007 + | path: ::std::string::String,
|
1008 + | ) -> crate::model::ValidationExceptionField {
|
1009 + | match self {
|
1010 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
1011 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
1012 + | }
|
1013 + | }
|
1014 + | }
|
1015 + | }
|
1016 + | /// See [`FooEnumSet`](crate::model::FooEnumSet).
|
1017 + | pub mod foo_enum_set {
|
1018 + |
|
1019 + | #[allow(clippy::enum_variant_names)]
|
1020 + | #[derive(Debug, PartialEq)]
|
1021 + | pub enum ConstraintViolation {
|
1022 + | /// Constraint violation error when the list does not contain unique items
|
1023 + | UniqueItems {
|
1024 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
1025 + | /// at least two elements.
|
1026 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
1027 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
1028 + | /// Nothing is guaranteed about the order of the indices.
|
1029 + | duplicate_indices: ::std::vec::Vec<usize>,
|
1030 + | /// The original vector, that contains duplicate items.
|
1031 + | original: ::std::vec::Vec<crate::model::FooEnum>,
|
1032 + | },
|
1033 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
1034 + | /// The first component of the tuple is the index in the collection where the
|
1035 + | /// first constraint violation was found.
|
1036 + | #[doc(hidden)]
|
1037 + | Member(usize, crate::model::foo_enum::ConstraintViolation),
|
1038 + | }
|
1039 + |
|
1040 + | impl ::std::fmt::Display for ConstraintViolation {
|
1041 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1042 + | let message = match self {
|
1043 + | Self::UniqueItems { duplicate_indices, .. } =>
|
1044 + | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#FooEnumSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
1045 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
1046 + | failing_member)
|
1047 + | };
|
1048 + | write!(f, "{message}")
|
1049 + | }
|
1050 + | }
|
1051 + |
|
1052 + | impl ::std::error::Error for ConstraintViolation {}
|
1053 + | impl ConstraintViolation {
|
1054 + | pub(crate) fn as_validation_exception_field(
|
1055 + | self,
|
1056 + | path: ::std::string::String,
|
1057 + | ) -> crate::model::ValidationExceptionField {
|
1058 + | match self {
|
1059 + | Self::UniqueItems { duplicate_indices, .. } =>
|
1060 + | crate::model::ValidationExceptionField {
|
1061 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
1062 + | path,
|
1063 + | },
|
1064 + | Self::Member(index, member_constraint_violation) =>
|
1065 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
1066 + | }
|
1067 + | }
|
1068 + | }
|
1069 + | }
|
1070 + | pub mod foo_enum_list {
|
1071 + |
|
1072 + | #[allow(clippy::enum_variant_names)]
|
1073 + | #[derive(Debug, PartialEq)]
|
1074 + | pub enum ConstraintViolation {
|
1075 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
1076 + | /// The first component of the tuple is the index in the collection where the
|
1077 + | /// first constraint violation was found.
|
1078 + | #[doc(hidden)]
|
1079 + | Member(usize, crate::model::foo_enum::ConstraintViolation),
|
1080 + | }
|
1081 + |
|
1082 + | impl ::std::fmt::Display for ConstraintViolation {
|
1083 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1084 + | let message = match self {
|
1085 + | Self::Member(index, failing_member) => format!(
|
1086 + | "Value at index {index} failed to satisfy constraint. {}",
|
1087 + | failing_member
|
1088 + | ),
|
1089 + | };
|
1090 + | write!(f, "{message}")
|
1091 + | }
|
1092 + | }
|
1093 + |
|
1094 + | impl ::std::error::Error for ConstraintViolation {}
|
1095 + | impl ConstraintViolation {
|
1096 + | pub(crate) fn as_validation_exception_field(
|
1097 + | self,
|
1098 + | path: ::std::string::String,
|
1099 + | ) -> crate::model::ValidationExceptionField {
|
1100 + | match self {
|
1101 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
1102 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
1103 + | }
|
1104 + | }
|
1105 + | }
|
1106 + | }
|
1107 + | /// See [`KitchenSink`](crate::model::KitchenSink).
|
1108 + | pub mod kitchen_sink {
|
1109 + |
|
1110 + | impl ::std::convert::From<Builder> for crate::model::KitchenSink {
|
1111 + | fn from(builder: Builder) -> Self {
|
1112 + | builder.build()
|
1113 + | }
|
1114 + | }
|
1115 + | /// A builder for [`KitchenSink`](crate::model::KitchenSink).
|
1116 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1117 + | pub struct Builder {
|
1118 + | pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
1119 + | pub(crate) boolean: ::std::option::Option<bool>,
|
1120 + | pub(crate) double: ::std::option::Option<f64>,
|
1121 + | pub(crate) empty_struct: ::std::option::Option<crate::model::EmptyStruct>,
|
1122 + | pub(crate) float: ::std::option::Option<f32>,
|
1123 + | pub(crate) httpdate_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1124 + | pub(crate) integer: ::std::option::Option<i32>,
|
1125 + | pub(crate) iso8601_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1126 + | pub(crate) json_value: ::std::option::Option<::std::string::String>,
|
1127 + | pub(crate) list_of_lists:
|
1128 + | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
1129 + | pub(crate) list_of_maps_of_strings: ::std::option::Option<
|
1130 + | ::std::vec::Vec<
|
1131 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1132 + | >,
|
1133 + | >,
|
1134 + | pub(crate) list_of_strings: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1135 + | pub(crate) list_of_structs:
|
1136 + | ::std::option::Option<::std::vec::Vec<crate::model::SimpleStruct>>,
|
1137 + | pub(crate) long: ::std::option::Option<i64>,
|
1138 + | pub(crate) map_of_lists_of_strings: ::std::option::Option<
|
1139 + | ::std::collections::HashMap<
|
1140 + | ::std::string::String,
|
1141 + | ::std::vec::Vec<::std::string::String>,
|
1142 + | >,
|
1143 + | >,
|
1144 + | pub(crate) map_of_maps: ::std::option::Option<
|
1145 + | ::std::collections::HashMap<
|
1146 + | ::std::string::String,
|
1147 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1148 + | >,
|
1149 + | >,
|
1150 + | pub(crate) map_of_strings: ::std::option::Option<
|
1151 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1152 + | >,
|
1153 + | pub(crate) map_of_structs: ::std::option::Option<
|
1154 + | ::std::collections::HashMap<::std::string::String, crate::model::SimpleStruct>,
|
1155 + | >,
|
1156 + | pub(crate) recursive_list:
|
1157 + | ::std::option::Option<::std::vec::Vec<crate::model::KitchenSink>>,
|
1158 + | pub(crate) recursive_map: ::std::option::Option<
|
1159 + | ::std::collections::HashMap<::std::string::String, crate::model::KitchenSink>,
|
1160 + | >,
|
1161 + | pub(crate) recursive_struct:
|
1162 + | ::std::option::Option<::std::boxed::Box<crate::model::KitchenSink>>,
|
1163 + | pub(crate) simple_struct: ::std::option::Option<crate::model::SimpleStruct>,
|
1164 + | pub(crate) string: ::std::option::Option<::std::string::String>,
|
1165 + | pub(crate) struct_with_json_name: ::std::option::Option<crate::model::StructWithJsonName>,
|
1166 + | pub(crate) timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1167 + | pub(crate) unix_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1168 + | }
|
1169 + | impl Builder {
|
1170 + | #[allow(missing_docs)] // documentation missing in model
|
1171 + | pub fn blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
|
1172 + | self.blob = input;
|
1173 + | self
|
1174 + | }
|
1175 + | #[allow(missing_docs)] // documentation missing in model
|
1176 + | pub(crate) fn set_blob(
|
1177 + | mut self,
|
1178 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::Blob>>,
|
1179 + | ) -> Self {
|
1180 + | self.blob = input.map(|v| v.into());
|
1181 + | self
|
1182 + | }
|
1183 + | #[allow(missing_docs)] // documentation missing in model
|
1184 + | pub fn boolean(mut self, input: ::std::option::Option<bool>) -> Self {
|
1185 + | self.boolean = input;
|
1186 + | self
|
1187 + | }
|
1188 + | #[allow(missing_docs)] // documentation missing in model
|
1189 + | pub(crate) fn set_boolean(
|
1190 + | mut self,
|
1191 + | input: Option<impl ::std::convert::Into<bool>>,
|
1192 + | ) -> Self {
|
1193 + | self.boolean = input.map(|v| v.into());
|
1194 + | self
|
1195 + | }
|
1196 + | #[allow(missing_docs)] // documentation missing in model
|
1197 + | pub fn double(mut self, input: ::std::option::Option<f64>) -> Self {
|
1198 + | self.double = input;
|
1199 + | self
|
1200 + | }
|
1201 + | #[allow(missing_docs)] // documentation missing in model
|
1202 + | pub(crate) fn set_double(mut self, input: Option<impl ::std::convert::Into<f64>>) -> Self {
|
1203 + | self.double = input.map(|v| v.into());
|
1204 + | self
|
1205 + | }
|
1206 + | #[allow(missing_docs)] // documentation missing in model
|
1207 + | pub fn empty_struct(
|
1208 + | mut self,
|
1209 + | input: ::std::option::Option<crate::model::EmptyStruct>,
|
1210 + | ) -> Self {
|
1211 + | self.empty_struct = input;
|
1212 + | self
|
1213 + | }
|
1214 + | #[allow(missing_docs)] // documentation missing in model
|
1215 + | pub(crate) fn set_empty_struct(
|
1216 + | mut self,
|
1217 + | input: Option<impl ::std::convert::Into<crate::model::EmptyStruct>>,
|
1218 + | ) -> Self {
|
1219 + | self.empty_struct = input.map(|v| v.into());
|
1220 + | self
|
1221 + | }
|
1222 + | #[allow(missing_docs)] // documentation missing in model
|
1223 + | pub fn float(mut self, input: ::std::option::Option<f32>) -> Self {
|
1224 + | self.float = input;
|
1225 + | self
|
1226 + | }
|
1227 + | #[allow(missing_docs)] // documentation missing in model
|
1228 + | pub(crate) fn set_float(mut self, input: Option<impl ::std::convert::Into<f32>>) -> Self {
|
1229 + | self.float = input.map(|v| v.into());
|
1230 + | self
|
1231 + | }
|
1232 + | #[allow(missing_docs)] // documentation missing in model
|
1233 + | pub fn httpdate_timestamp(
|
1234 + | mut self,
|
1235 + | input: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1236 + | ) -> Self {
|
1237 + | self.httpdate_timestamp = input;
|
1238 + | self
|
1239 + | }
|
1240 + | #[allow(missing_docs)] // documentation missing in model
|
1241 + | pub(crate) fn set_httpdate_timestamp(
|
1242 + | mut self,
|
1243 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::DateTime>>,
|
1244 + | ) -> Self {
|
1245 + | self.httpdate_timestamp = input.map(|v| v.into());
|
1246 + | self
|
1247 + | }
|
1248 + | #[allow(missing_docs)] // documentation missing in model
|
1249 + | pub fn integer(mut self, input: ::std::option::Option<i32>) -> Self {
|
1250 + | self.integer = input;
|
1251 + | self
|
1252 + | }
|
1253 + | #[allow(missing_docs)] // documentation missing in model
|
1254 + | pub(crate) fn set_integer(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
1255 + | self.integer = input.map(|v| v.into());
|
1256 + | self
|
1257 + | }
|
1258 + | #[allow(missing_docs)] // documentation missing in model
|
1259 + | pub fn iso8601_timestamp(
|
1260 + | mut self,
|
1261 + | input: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1262 + | ) -> Self {
|
1263 + | self.iso8601_timestamp = input;
|
1264 + | self
|
1265 + | }
|
1266 + | #[allow(missing_docs)] // documentation missing in model
|
1267 + | pub(crate) fn set_iso8601_timestamp(
|
1268 + | mut self,
|
1269 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::DateTime>>,
|
1270 + | ) -> Self {
|
1271 + | self.iso8601_timestamp = input.map(|v| v.into());
|
1272 + | self
|
1273 + | }
|
1274 + | #[allow(missing_docs)] // documentation missing in model
|
1275 + | pub fn json_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1276 + | self.json_value = input;
|
1277 + | self
|
1278 + | }
|
1279 + | #[allow(missing_docs)] // documentation missing in model
|
1280 + | pub(crate) fn set_json_value(
|
1281 + | mut self,
|
1282 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1283 + | ) -> Self {
|
1284 + | self.json_value = input.map(|v| v.into());
|
1285 + | self
|
1286 + | }
|
1287 + | #[allow(missing_docs)] // documentation missing in model
|
1288 + | pub fn list_of_lists(
|
1289 + | mut self,
|
1290 + | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
1291 + | ) -> Self {
|
1292 + | self.list_of_lists = input;
|
1293 + | self
|
1294 + | }
|
1295 + | #[allow(missing_docs)] // documentation missing in model
|
1296 + | pub(crate) fn set_list_of_lists(
|
1297 + | mut self,
|
1298 + | input: Option<
|
1299 + | impl ::std::convert::Into<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
1300 + | >,
|
1301 + | ) -> Self {
|
1302 + | self.list_of_lists = input.map(|v| v.into());
|
1303 + | self
|
1304 + | }
|
1305 + | #[allow(missing_docs)] // documentation missing in model
|
1306 + | pub fn list_of_maps_of_strings(
|
1307 + | mut self,
|
1308 + | input: ::std::option::Option<
|
1309 + | ::std::vec::Vec<
|
1310 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1311 + | >,
|
1312 + | >,
|
1313 + | ) -> Self {
|
1314 + | self.list_of_maps_of_strings = input;
|
1315 + | self
|
1316 + | }
|
1317 + | #[allow(missing_docs)] // documentation missing in model
|
1318 + | pub(crate) fn set_list_of_maps_of_strings(
|
1319 + | mut self,
|
1320 + | input: Option<
|
1321 + | impl ::std::convert::Into<
|
1322 + | ::std::vec::Vec<
|
1323 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1324 + | >,
|
1325 + | >,
|
1326 + | >,
|
1327 + | ) -> Self {
|
1328 + | self.list_of_maps_of_strings = input.map(|v| v.into());
|
1329 + | self
|
1330 + | }
|
1331 + | #[allow(missing_docs)] // documentation missing in model
|
1332 + | pub fn list_of_strings(
|
1333 + | mut self,
|
1334 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1335 + | ) -> Self {
|
1336 + | self.list_of_strings = input;
|
1337 + | self
|
1338 + | }
|
1339 + | #[allow(missing_docs)] // documentation missing in model
|
1340 + | pub(crate) fn set_list_of_strings(
|
1341 + | mut self,
|
1342 + | input: Option<impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>>,
|
1343 + | ) -> Self {
|
1344 + | self.list_of_strings = input.map(|v| v.into());
|
1345 + | self
|
1346 + | }
|
1347 + | #[allow(missing_docs)] // documentation missing in model
|
1348 + | pub fn list_of_structs(
|
1349 + | mut self,
|
1350 + | input: ::std::option::Option<::std::vec::Vec<crate::model::SimpleStruct>>,
|
1351 + | ) -> Self {
|
1352 + | self.list_of_structs = input;
|
1353 + | self
|
1354 + | }
|
1355 + | #[allow(missing_docs)] // documentation missing in model
|
1356 + | pub(crate) fn set_list_of_structs(
|
1357 + | mut self,
|
1358 + | input: Option<impl ::std::convert::Into<::std::vec::Vec<crate::model::SimpleStruct>>>,
|
1359 + | ) -> Self {
|
1360 + | self.list_of_structs = input.map(|v| v.into());
|
1361 + | self
|
1362 + | }
|
1363 + | #[allow(missing_docs)] // documentation missing in model
|
1364 + | pub fn long(mut self, input: ::std::option::Option<i64>) -> Self {
|
1365 + | self.long = input;
|
1366 + | self
|
1367 + | }
|
1368 + | #[allow(missing_docs)] // documentation missing in model
|
1369 + | pub(crate) fn set_long(mut self, input: Option<impl ::std::convert::Into<i64>>) -> Self {
|
1370 + | self.long = input.map(|v| v.into());
|
1371 + | self
|
1372 + | }
|
1373 + | #[allow(missing_docs)] // documentation missing in model
|
1374 + | pub fn map_of_lists_of_strings(
|
1375 + | mut self,
|
1376 + | input: ::std::option::Option<
|
1377 + | ::std::collections::HashMap<
|
1378 + | ::std::string::String,
|
1379 + | ::std::vec::Vec<::std::string::String>,
|
1380 + | >,
|
1381 + | >,
|
1382 + | ) -> Self {
|
1383 + | self.map_of_lists_of_strings = input;
|
1384 + | self
|
1385 + | }
|
1386 + | #[allow(missing_docs)] // documentation missing in model
|
1387 + | pub(crate) fn set_map_of_lists_of_strings(
|
1388 + | mut self,
|
1389 + | input: Option<
|
1390 + | impl ::std::convert::Into<
|
1391 + | ::std::collections::HashMap<
|
1392 + | ::std::string::String,
|
1393 + | ::std::vec::Vec<::std::string::String>,
|
1394 + | >,
|
1395 + | >,
|
1396 + | >,
|
1397 + | ) -> Self {
|
1398 + | self.map_of_lists_of_strings = input.map(|v| v.into());
|
1399 + | self
|
1400 + | }
|
1401 + | #[allow(missing_docs)] // documentation missing in model
|
1402 + | pub fn map_of_maps(
|
1403 + | mut self,
|
1404 + | input: ::std::option::Option<
|
1405 + | ::std::collections::HashMap<
|
1406 + | ::std::string::String,
|
1407 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1408 + | >,
|
1409 + | >,
|
1410 + | ) -> Self {
|
1411 + | self.map_of_maps = input;
|
1412 + | self
|
1413 + | }
|
1414 + | #[allow(missing_docs)] // documentation missing in model
|
1415 + | pub(crate) fn set_map_of_maps(
|
1416 + | mut self,
|
1417 + | input: Option<
|
1418 + | impl ::std::convert::Into<
|
1419 + | ::std::collections::HashMap<
|
1420 + | ::std::string::String,
|
1421 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1422 + | >,
|
1423 + | >,
|
1424 + | >,
|
1425 + | ) -> Self {
|
1426 + | self.map_of_maps = input.map(|v| v.into());
|
1427 + | self
|
1428 + | }
|
1429 + | #[allow(missing_docs)] // documentation missing in model
|
1430 + | pub fn map_of_strings(
|
1431 + | mut self,
|
1432 + | input: ::std::option::Option<
|
1433 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1434 + | >,
|
1435 + | ) -> Self {
|
1436 + | self.map_of_strings = input;
|
1437 + | self
|
1438 + | }
|
1439 + | #[allow(missing_docs)] // documentation missing in model
|
1440 + | pub(crate) fn set_map_of_strings(
|
1441 + | mut self,
|
1442 + | input: Option<
|
1443 + | impl ::std::convert::Into<
|
1444 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1445 + | >,
|
1446 + | >,
|
1447 + | ) -> Self {
|
1448 + | self.map_of_strings = input.map(|v| v.into());
|
1449 + | self
|
1450 + | }
|
1451 + | #[allow(missing_docs)] // documentation missing in model
|
1452 + | pub fn map_of_structs(
|
1453 + | mut self,
|
1454 + | input: ::std::option::Option<
|
1455 + | ::std::collections::HashMap<::std::string::String, crate::model::SimpleStruct>,
|
1456 + | >,
|
1457 + | ) -> Self {
|
1458 + | self.map_of_structs = input;
|
1459 + | self
|
1460 + | }
|
1461 + | #[allow(missing_docs)] // documentation missing in model
|
1462 + | pub(crate) fn set_map_of_structs(
|
1463 + | mut self,
|
1464 + | input: Option<
|
1465 + | impl ::std::convert::Into<
|
1466 + | ::std::collections::HashMap<::std::string::String, crate::model::SimpleStruct>,
|
1467 + | >,
|
1468 + | >,
|
1469 + | ) -> Self {
|
1470 + | self.map_of_structs = input.map(|v| v.into());
|
1471 + | self
|
1472 + | }
|
1473 + | #[allow(missing_docs)] // documentation missing in model
|
1474 + | pub fn recursive_list(
|
1475 + | mut self,
|
1476 + | input: ::std::option::Option<::std::vec::Vec<crate::model::KitchenSink>>,
|
1477 + | ) -> Self {
|
1478 + | self.recursive_list = input;
|
1479 + | self
|
1480 + | }
|
1481 + | #[allow(missing_docs)] // documentation missing in model
|
1482 + | pub(crate) fn set_recursive_list(
|
1483 + | mut self,
|
1484 + | input: Option<impl ::std::convert::Into<::std::vec::Vec<crate::model::KitchenSink>>>,
|
1485 + | ) -> Self {
|
1486 + | self.recursive_list = input.map(|v| v.into());
|
1487 + | self
|
1488 + | }
|
1489 + | #[allow(missing_docs)] // documentation missing in model
|
1490 + | pub fn recursive_map(
|
1491 + | mut self,
|
1492 + | input: ::std::option::Option<
|
1493 + | ::std::collections::HashMap<::std::string::String, crate::model::KitchenSink>,
|
1494 + | >,
|
1495 + | ) -> Self {
|
1496 + | self.recursive_map = input;
|
1497 + | self
|
1498 + | }
|
1499 + | #[allow(missing_docs)] // documentation missing in model
|
1500 + | pub(crate) fn set_recursive_map(
|
1501 + | mut self,
|
1502 + | input: Option<
|
1503 + | impl ::std::convert::Into<
|
1504 + | ::std::collections::HashMap<::std::string::String, crate::model::KitchenSink>,
|
1505 + | >,
|
1506 + | >,
|
1507 + | ) -> Self {
|
1508 + | self.recursive_map = input.map(|v| v.into());
|
1509 + | self
|
1510 + | }
|
1511 + | #[allow(missing_docs)] // documentation missing in model
|
1512 + | pub fn recursive_struct(
|
1513 + | mut self,
|
1514 + | input: ::std::option::Option<::std::boxed::Box<crate::model::KitchenSink>>,
|
1515 + | ) -> Self {
|
1516 + | self.recursive_struct = input;
|
1517 + | self
|
1518 + | }
|
1519 + | #[allow(missing_docs)] // documentation missing in model
|
1520 + | pub(crate) fn set_recursive_struct(
|
1521 + | mut self,
|
1522 + | input: Option<impl ::std::convert::Into<::std::boxed::Box<crate::model::KitchenSink>>>,
|
1523 + | ) -> Self {
|
1524 + | self.recursive_struct = input.map(|v| v.into());
|
1525 + | self
|
1526 + | }
|
1527 + | #[allow(missing_docs)] // documentation missing in model
|
1528 + | pub fn simple_struct(
|
1529 + | mut self,
|
1530 + | input: ::std::option::Option<crate::model::SimpleStruct>,
|
1531 + | ) -> Self {
|
1532 + | self.simple_struct = input;
|
1533 + | self
|
1534 + | }
|
1535 + | #[allow(missing_docs)] // documentation missing in model
|
1536 + | pub(crate) fn set_simple_struct(
|
1537 + | mut self,
|
1538 + | input: Option<impl ::std::convert::Into<crate::model::SimpleStruct>>,
|
1539 + | ) -> Self {
|
1540 + | self.simple_struct = input.map(|v| v.into());
|
1541 + | self
|
1542 + | }
|
1543 + | #[allow(missing_docs)] // documentation missing in model
|
1544 + | pub fn string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1545 + | self.string = input;
|
1546 + | self
|
1547 + | }
|
1548 + | #[allow(missing_docs)] // documentation missing in model
|
1549 + | pub(crate) fn set_string(
|
1550 + | mut self,
|
1551 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1552 + | ) -> Self {
|
1553 + | self.string = input.map(|v| v.into());
|
1554 + | self
|
1555 + | }
|
1556 + | #[allow(missing_docs)] // documentation missing in model
|
1557 + | pub fn struct_with_json_name(
|
1558 + | mut self,
|
1559 + | input: ::std::option::Option<crate::model::StructWithJsonName>,
|
1560 + | ) -> Self {
|
1561 + | self.struct_with_json_name = input;
|
1562 + | self
|
1563 + | }
|
1564 + | #[allow(missing_docs)] // documentation missing in model
|
1565 + | pub(crate) fn set_struct_with_json_name(
|
1566 + | mut self,
|
1567 + | input: Option<impl ::std::convert::Into<crate::model::StructWithJsonName>>,
|
1568 + | ) -> Self {
|
1569 + | self.struct_with_json_name = input.map(|v| v.into());
|
1570 + | self
|
1571 + | }
|
1572 + | #[allow(missing_docs)] // documentation missing in model
|
1573 + | pub fn timestamp(
|
1574 + | mut self,
|
1575 + | input: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1576 + | ) -> Self {
|
1577 + | self.timestamp = input;
|
1578 + | self
|
1579 + | }
|
1580 + | #[allow(missing_docs)] // documentation missing in model
|
1581 + | pub(crate) fn set_timestamp(
|
1582 + | mut self,
|
1583 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::DateTime>>,
|
1584 + | ) -> Self {
|
1585 + | self.timestamp = input.map(|v| v.into());
|
1586 + | self
|
1587 + | }
|
1588 + | #[allow(missing_docs)] // documentation missing in model
|
1589 + | pub fn unix_timestamp(
|
1590 + | mut self,
|
1591 + | input: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1592 + | ) -> Self {
|
1593 + | self.unix_timestamp = input;
|
1594 + | self
|
1595 + | }
|
1596 + | #[allow(missing_docs)] // documentation missing in model
|
1597 + | pub(crate) fn set_unix_timestamp(
|
1598 + | mut self,
|
1599 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::DateTime>>,
|
1600 + | ) -> Self {
|
1601 + | self.unix_timestamp = input.map(|v| v.into());
|
1602 + | self
|
1603 + | }
|
1604 + | /// Consumes the builder and constructs a [`KitchenSink`](crate::model::KitchenSink).
|
1605 + | pub fn build(self) -> crate::model::KitchenSink {
|
1606 + | self.build_enforcing_all_constraints()
|
1607 + | }
|
1608 + | fn build_enforcing_all_constraints(self) -> crate::model::KitchenSink {
|
1609 + | crate::model::KitchenSink {
|
1610 + | blob: self.blob,
|
1611 + | boolean: self.boolean,
|
1612 + | double: self.double,
|
1613 + | empty_struct: self.empty_struct,
|
1614 + | float: self.float,
|
1615 + | httpdate_timestamp: self.httpdate_timestamp,
|
1616 + | integer: self.integer,
|
1617 + | iso8601_timestamp: self.iso8601_timestamp,
|
1618 + | json_value: self.json_value,
|
1619 + | list_of_lists: self.list_of_lists,
|
1620 + | list_of_maps_of_strings: self.list_of_maps_of_strings,
|
1621 + | list_of_strings: self.list_of_strings,
|
1622 + | list_of_structs: self.list_of_structs,
|
1623 + | long: self.long,
|
1624 + | map_of_lists_of_strings: self.map_of_lists_of_strings,
|
1625 + | map_of_maps: self.map_of_maps,
|
1626 + | map_of_strings: self.map_of_strings,
|
1627 + | map_of_structs: self.map_of_structs,
|
1628 + | recursive_list: self.recursive_list,
|
1629 + | recursive_map: self.recursive_map,
|
1630 + | recursive_struct: self.recursive_struct,
|
1631 + | simple_struct: self.simple_struct,
|
1632 + | string: self.string,
|
1633 + | struct_with_json_name: self.struct_with_json_name,
|
1634 + | timestamp: self.timestamp,
|
1635 + | unix_timestamp: self.unix_timestamp,
|
1636 + | }
|
1637 + | }
|
1638 + | }
|
1639 + | }
|
1640 + | /// See [`StructWithJsonName`](crate::model::StructWithJsonName).
|
1641 + | pub mod struct_with_json_name {
|
1642 + |
|
1643 + | impl ::std::convert::From<Builder> for crate::model::StructWithJsonName {
|
1644 + | fn from(builder: Builder) -> Self {
|
1645 + | builder.build()
|
1646 + | }
|
1647 + | }
|
1648 + | /// A builder for [`StructWithJsonName`](crate::model::StructWithJsonName).
|
1649 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1650 + | pub struct Builder {
|
1651 + | pub(crate) value: ::std::option::Option<::std::string::String>,
|
1652 + | }
|
1653 + | impl Builder {
|
1654 + | #[allow(missing_docs)] // documentation missing in model
|
1655 + | pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1656 + | self.value = input;
|
1657 + | self
|
1658 + | }
|
1659 + | #[allow(missing_docs)] // documentation missing in model
|
1660 + | pub(crate) fn set_value(
|
1661 + | mut self,
|
1662 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1663 + | ) -> Self {
|
1664 + | self.value = input.map(|v| v.into());
|
1665 + | self
|
1666 + | }
|
1667 + | /// Consumes the builder and constructs a [`StructWithJsonName`](crate::model::StructWithJsonName).
|
1668 + | pub fn build(self) -> crate::model::StructWithJsonName {
|
1669 + | self.build_enforcing_all_constraints()
|
1670 + | }
|
1671 + | fn build_enforcing_all_constraints(self) -> crate::model::StructWithJsonName {
|
1672 + | crate::model::StructWithJsonName { value: self.value }
|
1673 + | }
|
1674 + | }
|
1675 + | }
|
1676 + | /// See [`SimpleStruct`](crate::model::SimpleStruct).
|
1677 + | pub mod simple_struct {
|
1678 + |
|
1679 + | impl ::std::convert::From<Builder> for crate::model::SimpleStruct {
|
1680 + | fn from(builder: Builder) -> Self {
|
1681 + | builder.build()
|
1682 + | }
|
1683 + | }
|
1684 + | /// A builder for [`SimpleStruct`](crate::model::SimpleStruct).
|
1685 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1686 + | pub struct Builder {
|
1687 + | pub(crate) value: ::std::option::Option<::std::string::String>,
|
1688 + | }
|
1689 + | impl Builder {
|
1690 + | #[allow(missing_docs)] // documentation missing in model
|
1691 + | pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1692 + | self.value = input;
|
1693 + | self
|
1694 + | }
|
1695 + | #[allow(missing_docs)] // documentation missing in model
|
1696 + | pub(crate) fn set_value(
|
1697 + | mut self,
|
1698 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1699 + | ) -> Self {
|
1700 + | self.value = input.map(|v| v.into());
|
1701 + | self
|
1702 + | }
|
1703 + | /// Consumes the builder and constructs a [`SimpleStruct`](crate::model::SimpleStruct).
|
1704 + | pub fn build(self) -> crate::model::SimpleStruct {
|
1705 + | self.build_enforcing_all_constraints()
|
1706 + | }
|
1707 + | fn build_enforcing_all_constraints(self) -> crate::model::SimpleStruct {
|
1708 + | crate::model::SimpleStruct { value: self.value }
|
1709 + | }
|
1710 + | }
|
1711 + | }
|
1712 + | /// See [`EmptyStruct`](crate::model::EmptyStruct).
|
1713 + | pub mod empty_struct {
|
1714 + |
|
1715 + | impl ::std::convert::From<Builder> for crate::model::EmptyStruct {
|
1716 + | fn from(builder: Builder) -> Self {
|
1717 + | builder.build()
|
1718 + | }
|
1719 + | }
|
1720 + | /// A builder for [`EmptyStruct`](crate::model::EmptyStruct).
|
1721 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1722 + | pub struct Builder {}
|
1723 + | impl Builder {
|
1724 + | /// Consumes the builder and constructs a [`EmptyStruct`](crate::model::EmptyStruct).
|
1725 + | pub fn build(self) -> crate::model::EmptyStruct {
|
1726 + | self.build_enforcing_all_constraints()
|
1727 + | }
|
1728 + | fn build_enforcing_all_constraints(self) -> crate::model::EmptyStruct {
|
1729 + | crate::model::EmptyStruct {}
|
1730 + | }
|
1731 + | }
|
1732 + | }
|