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