1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | #[allow(missing_docs)] // documentation missing in model
|
3 - | #[derive(::std::fmt::Debug)]
|
4 - | pub struct StreamingOperationWithOptionalDataInput {
|
3 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4 + | pub struct SimpleStructOperationInput {
|
5 5 | #[allow(missing_docs)] // documentation missing in model
|
6 - | pub optional_data: ::std::option::Option<::std::string::String>,
|
6 + | pub blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
7 7 | #[allow(missing_docs)] // documentation missing in model
|
8 - | pub events: crate::sigv4_event_stream::SigV4Receiver<
|
9 - | crate::model::Events,
|
10 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
11 - | >,
|
12 - | }
|
13 - | impl StreamingOperationWithOptionalDataInput {
|
8 + | pub boolean: ::std::option::Option<bool>,
|
14 9 | #[allow(missing_docs)] // documentation missing in model
|
15 - | pub fn optional_data(&self) -> ::std::option::Option<&str> {
|
16 - | self.optional_data.as_deref()
|
17 - | }
|
10 + | pub string: ::std::option::Option<::std::string::String>,
|
18 11 | #[allow(missing_docs)] // documentation missing in model
|
19 - | pub fn events(
|
20 - | &self,
|
21 - | ) -> &crate::sigv4_event_stream::SigV4Receiver<
|
22 - | crate::model::Events,
|
23 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
24 - | > {
|
25 - | &self.events
|
26 - | }
|
27 - | }
|
28 - | impl StreamingOperationWithOptionalDataInput {
|
29 - | /// Creates a new builder-style object to manufacture [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
|
30 - | pub fn builder() -> crate::input::streaming_operation_with_optional_data_input::Builder {
|
31 - | crate::input::streaming_operation_with_optional_data_input::Builder::default()
|
32 - | }
|
33 - | }
|
34 - | impl crate::constrained::Constrained for crate::input::StreamingOperationWithOptionalDataInput {
|
35 - | type Unconstrained = crate::input::streaming_operation_with_optional_data_input::Builder;
|
36 - | }
|
37 - |
|
38 - | #[allow(missing_docs)] // documentation missing in model
|
39 - | #[derive(::std::fmt::Debug)]
|
40 - | pub struct StreamingOperationWithInitialResponseInput {
|
12 + | pub byte: ::std::option::Option<i8>,
|
41 13 | #[allow(missing_docs)] // documentation missing in model
|
42 - | pub events: crate::sigv4_event_stream::SigV4Receiver<
|
43 - | crate::model::Events,
|
44 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
45 - | >,
|
46 - | }
|
47 - | impl StreamingOperationWithInitialResponseInput {
|
14 + | pub short: ::std::option::Option<i16>,
|
48 15 | #[allow(missing_docs)] // documentation missing in model
|
49 - | pub fn events(
|
50 - | &self,
|
51 - | ) -> &crate::sigv4_event_stream::SigV4Receiver<
|
52 - | crate::model::Events,
|
53 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
54 - | > {
|
55 - | &self.events
|
56 - | }
|
57 - | }
|
58 - | impl StreamingOperationWithInitialResponseInput {
|
59 - | /// Creates a new builder-style object to manufacture [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
|
60 - | pub fn builder() -> crate::input::streaming_operation_with_initial_response_input::Builder {
|
61 - | crate::input::streaming_operation_with_initial_response_input::Builder::default()
|
62 - | }
|
63 - | }
|
64 - | impl crate::constrained::Constrained for crate::input::StreamingOperationWithInitialResponseInput {
|
65 - | type Unconstrained = crate::input::streaming_operation_with_initial_response_input::Builder;
|
66 - | }
|
67 - |
|
68 - | #[allow(missing_docs)] // documentation missing in model
|
69 - | #[derive(::std::fmt::Debug)]
|
70 - | pub struct StreamingOperationWithInitialDataInput {
|
16 + | pub integer: ::std::option::Option<i32>,
|
71 17 | #[allow(missing_docs)] // documentation missing in model
|
72 - | pub initial_data: ::std::string::String,
|
18 + | pub long: ::std::option::Option<i64>,
|
73 19 | #[allow(missing_docs)] // documentation missing in model
|
74 - | pub events: crate::sigv4_event_stream::SigV4Receiver<
|
75 - | crate::model::Events,
|
76 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
77 - | >,
|
78 - | }
|
79 - | impl StreamingOperationWithInitialDataInput {
|
20 + | pub float: ::std::option::Option<f32>,
|
80 21 | #[allow(missing_docs)] // documentation missing in model
|
81 - | pub fn initial_data(&self) -> &str {
|
82 - | use std::ops::Deref;
|
83 - | self.initial_data.deref()
|
84 - | }
|
22 + | pub double: ::std::option::Option<f64>,
|
85 23 | #[allow(missing_docs)] // documentation missing in model
|
86 - | pub fn events(
|
87 - | &self,
|
88 - | ) -> &crate::sigv4_event_stream::SigV4Receiver<
|
89 - | crate::model::Events,
|
90 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
91 - | > {
|
92 - | &self.events
|
93 - | }
|
94 - | }
|
95 - | impl StreamingOperationWithInitialDataInput {
|
96 - | /// Creates a new builder-style object to manufacture [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
|
97 - | pub fn builder() -> crate::input::streaming_operation_with_initial_data_input::Builder {
|
98 - | crate::input::streaming_operation_with_initial_data_input::Builder::default()
|
99 - | }
|
100 - | }
|
101 - | impl crate::constrained::Constrained for crate::input::StreamingOperationWithInitialDataInput {
|
102 - | type Unconstrained = crate::input::streaming_operation_with_initial_data_input::Builder;
|
103 - | }
|
104 - |
|
105 - | #[allow(missing_docs)] // documentation missing in model
|
106 - | #[derive(::std::fmt::Debug)]
|
107 - | pub struct StreamingOperationInput {
|
24 + | pub timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
108 25 | #[allow(missing_docs)] // documentation missing in model
|
109 - | pub events: crate::sigv4_event_stream::SigV4Receiver<
|
110 - | crate::model::Events,
|
111 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
112 - | >,
|
113 - | }
|
114 - | impl StreamingOperationInput {
|
26 + | pub r#enum: ::std::option::Option<crate::model::Suit>,
|
115 27 | #[allow(missing_docs)] // documentation missing in model
|
116 - | pub fn events(
|
117 - | &self,
|
118 - | ) -> &crate::sigv4_event_stream::SigV4Receiver<
|
119 - | crate::model::Events,
|
120 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
121 - | > {
|
122 - | &self.events
|
123 - | }
|
124 - | }
|
125 - | impl StreamingOperationInput {
|
126 - | /// Creates a new builder-style object to manufacture [`StreamingOperationInput`](crate::input::StreamingOperationInput).
|
127 - | pub fn builder() -> crate::input::streaming_operation_input::Builder {
|
128 - | crate::input::streaming_operation_input::Builder::default()
|
129 - | }
|
130 - | }
|
131 - | impl crate::constrained::Constrained for crate::input::StreamingOperationInput {
|
132 - | type Unconstrained = crate::input::streaming_operation_input::Builder;
|
133 - | }
|
134 - |
|
135 - | #[allow(missing_docs)] // documentation missing in model
|
136 - | #[derive(
|
137 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
138 - | )]
|
139 - | pub struct RecursiveUnionOperationInput {
|
28 + | pub required_blob: ::aws_smithy_types::Blob,
|
140 29 | #[allow(missing_docs)] // documentation missing in model
|
141 - | pub nested: ::std::option::Option<crate::model::RecursiveOperationInputOutputNested1>,
|
142 - | }
|
143 - | impl RecursiveUnionOperationInput {
|
30 + | pub required_boolean: bool,
|
144 31 | #[allow(missing_docs)] // documentation missing in model
|
145 - | pub fn nested(
|
146 - | &self,
|
147 - | ) -> ::std::option::Option<&crate::model::RecursiveOperationInputOutputNested1> {
|
148 - | self.nested.as_ref()
|
149 - | }
|
150 - | }
|
151 - | impl RecursiveUnionOperationInput {
|
152 - | /// Creates a new builder-style object to manufacture [`RecursiveUnionOperationInput`](crate::input::RecursiveUnionOperationInput).
|
153 - | pub fn builder() -> crate::input::recursive_union_operation_input::Builder {
|
154 - | crate::input::recursive_union_operation_input::Builder::default()
|
155 - | }
|
156 - | }
|
157 - | impl crate::constrained::Constrained for crate::input::RecursiveUnionOperationInput {
|
158 - | type Unconstrained = crate::input::recursive_union_operation_input::Builder;
|
159 - | }
|
160 - |
|
161 - | #[allow(missing_docs)] // documentation missing in model
|
162 - | #[derive(
|
163 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
164 - | )]
|
165 - | pub struct SingleMemberStructOperationInput {
|
32 + | pub required_string: ::std::string::String,
|
166 33 | #[allow(missing_docs)] // documentation missing in model
|
167 - | pub message: ::std::option::Option<::std::string::String>,
|
168 - | }
|
169 - | impl SingleMemberStructOperationInput {
|
34 + | pub required_byte: i8,
|
170 35 | #[allow(missing_docs)] // documentation missing in model
|
171 - | pub fn message(&self) -> ::std::option::Option<&str> {
|
172 - | self.message.as_deref()
|
173 - | }
|
36 + | pub required_short: i16,
|
37 + | #[allow(missing_docs)] // documentation missing in model
|
38 + | pub required_integer: i32,
|
39 + | #[allow(missing_docs)] // documentation missing in model
|
40 + | pub required_long: i64,
|
41 + | #[allow(missing_docs)] // documentation missing in model
|
42 + | pub required_float: f32,
|
43 + | #[allow(missing_docs)] // documentation missing in model
|
44 + | pub required_double: f64,
|
45 + | #[allow(missing_docs)] // documentation missing in model
|
46 + | pub required_timestamp: ::aws_smithy_types::DateTime,
|
47 + | #[allow(missing_docs)] // documentation missing in model
|
48 + | pub required_enum: crate::model::Suit,
|
174 49 | }
|
175 - | impl SingleMemberStructOperationInput {
|
176 - | /// Creates a new builder-style object to manufacture [`SingleMemberStructOperationInput`](crate::input::SingleMemberStructOperationInput).
|
177 - | pub fn builder() -> crate::input::single_member_struct_operation_input::Builder {
|
178 - | crate::input::single_member_struct_operation_input::Builder::default()
|
50 + | impl SimpleStructOperationInput {
|
51 + | #[allow(missing_docs)] // documentation missing in model
|
52 + | pub fn blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
53 + | self.blob.as_ref()
|
179 54 | }
|
180 - | }
|
181 - | impl crate::constrained::Constrained for crate::input::SingleMemberStructOperationInput {
|
182 - | type Unconstrained = crate::input::single_member_struct_operation_input::Builder;
|
183 - | }
|
184 - |
|
185 - | #[allow(missing_docs)] // documentation missing in model
|
186 - | #[derive(
|
187 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
188 - | )]
|
189 - | pub struct EmptyStructOperationInput {}
|
190 - | impl EmptyStructOperationInput {
|
191 - | /// Creates a new builder-style object to manufacture [`EmptyStructOperationInput`](crate::input::EmptyStructOperationInput).
|
192 - | pub fn builder() -> crate::input::empty_struct_operation_input::Builder {
|
193 - | crate::input::empty_struct_operation_input::Builder::default()
|
55 + | #[allow(missing_docs)] // documentation missing in model
|
56 + | pub fn boolean(&self) -> ::std::option::Option<bool> {
|
57 + | self.boolean
|
194 58 | }
|
195 - | }
|
196 - | impl crate::constrained::Constrained for crate::input::EmptyStructOperationInput {
|
197 - | type Unconstrained = crate::input::empty_struct_operation_input::Builder;
|
198 - | }
|
199 - |
|
200 - | #[allow(missing_docs)] // documentation missing in model
|
201 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
202 - | pub struct ComplexStructOperationInput {
|
203 59 | #[allow(missing_docs)] // documentation missing in model
|
204 - | pub structure: ::std::option::Option<crate::model::SimpleStruct>,
|
60 + | pub fn string(&self) -> ::std::option::Option<&str> {
|
61 + | self.string.as_deref()
|
62 + | }
|
205 63 | #[allow(missing_docs)] // documentation missing in model
|
206 - | pub empty_structure: ::std::option::Option<crate::model::EmptyStruct>,
|
64 + | pub fn byte(&self) -> ::std::option::Option<i8> {
|
65 + | self.byte
|
66 + | }
|
207 67 | #[allow(missing_docs)] // documentation missing in model
|
208 - | pub list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
68 + | pub fn short(&self) -> ::std::option::Option<i16> {
|
69 + | self.short
|
70 + | }
|
209 71 | #[allow(missing_docs)] // documentation missing in model
|
210 - | pub map: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
72 + | pub fn integer(&self) -> ::std::option::Option<i32> {
|
73 + | self.integer
|
74 + | }
|
211 75 | #[allow(missing_docs)] // documentation missing in model
|
212 - | pub union: ::std::option::Option<crate::model::SimpleUnion>,
|
76 + | pub fn long(&self) -> ::std::option::Option<i64> {
|
77 + | self.long
|
78 + | }
|
213 79 | #[allow(missing_docs)] // documentation missing in model
|
214 - | pub unit_union: ::std::option::Option<crate::model::UnitUnion>,
|
80 + | pub fn float(&self) -> ::std::option::Option<f32> {
|
81 + | self.float
|
82 + | }
|
215 83 | #[allow(missing_docs)] // documentation missing in model
|
216 - | pub structure_list: ::std::option::Option<::std::vec::Vec<crate::model::SimpleStruct>>,
|
84 + | pub fn double(&self) -> ::std::option::Option<f64> {
|
85 + | self.double
|
86 + | }
|
217 87 | #[allow(missing_docs)] // documentation missing in model
|
218 - | pub complex_list: ::std::vec::Vec<
|
219 - | ::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>,
|
220 - | >,
|
88 + | pub fn timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
89 + | self.timestamp.as_ref()
|
90 + | }
|
221 91 | #[allow(missing_docs)] // documentation missing in model
|
222 - | pub complex_map: ::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>,
|
92 + | pub fn r#enum(&self) -> ::std::option::Option<&crate::model::Suit> {
|
93 + | self.r#enum.as_ref()
|
94 + | }
|
223 95 | #[allow(missing_docs)] // documentation missing in model
|
224 - | pub complex_union: ::std::boxed::Box<crate::model::ComplexUnion>,
|
225 - | }
|
226 - | impl ComplexStructOperationInput {
|
96 + | pub fn required_blob(&self) -> &::aws_smithy_types::Blob {
|
97 + | &self.required_blob
|
98 + | }
|
227 99 | #[allow(missing_docs)] // documentation missing in model
|
228 - | pub fn structure(&self) -> ::std::option::Option<&crate::model::SimpleStruct> {
|
229 - | self.structure.as_ref()
|
100 + | pub fn required_boolean(&self) -> bool {
|
101 + | self.required_boolean
|
230 102 | }
|
231 103 | #[allow(missing_docs)] // documentation missing in model
|
232 - | pub fn empty_structure(&self) -> ::std::option::Option<&crate::model::EmptyStruct> {
|
233 - | self.empty_structure.as_ref()
|
104 + | pub fn required_string(&self) -> &str {
|
105 + | use std::ops::Deref;
|
106 + | self.required_string.deref()
|
234 107 | }
|
235 108 | #[allow(missing_docs)] // documentation missing in model
|
236 - | pub fn list(&self) -> ::std::option::Option<&[::std::string::String]> {
|
237 - | self.list.as_deref()
|
109 + | pub fn required_byte(&self) -> i8 {
|
110 + | self.required_byte
|
238 111 | }
|
239 112 | #[allow(missing_docs)] // documentation missing in model
|
240 - | pub fn map(
|
241 - | &self,
|
242 - | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i32>> {
|
243 - | self.map.as_ref()
|
113 + | pub fn required_short(&self) -> i16 {
|
114 + | self.required_short
|
244 115 | }
|
245 116 | #[allow(missing_docs)] // documentation missing in model
|
246 - | pub fn union(&self) -> ::std::option::Option<&crate::model::SimpleUnion> {
|
247 - | self.union.as_ref()
|
117 + | pub fn required_integer(&self) -> i32 {
|
118 + | self.required_integer
|
248 119 | }
|
249 120 | #[allow(missing_docs)] // documentation missing in model
|
250 - | pub fn unit_union(&self) -> ::std::option::Option<&crate::model::UnitUnion> {
|
251 - | self.unit_union.as_ref()
|
121 + | pub fn required_long(&self) -> i64 {
|
122 + | self.required_long
|
252 123 | }
|
253 124 | #[allow(missing_docs)] // documentation missing in model
|
254 - | pub fn structure_list(&self) -> ::std::option::Option<&[crate::model::SimpleStruct]> {
|
255 - | self.structure_list.as_deref()
|
125 + | pub fn required_float(&self) -> f32 {
|
126 + | self.required_float
|
256 127 | }
|
257 128 | #[allow(missing_docs)] // documentation missing in model
|
258 - | pub fn complex_list(
|
259 - | &self,
|
260 - | ) -> &[::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>] {
|
261 - | use std::ops::Deref;
|
262 - | self.complex_list.deref()
|
129 + | pub fn required_double(&self) -> f64 {
|
130 + | self.required_double
|
263 131 | }
|
264 132 | #[allow(missing_docs)] // documentation missing in model
|
265 - | pub fn complex_map(
|
266 - | &self,
|
267 - | ) -> &::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion> {
|
268 - | &self.complex_map
|
133 + | pub fn required_timestamp(&self) -> &::aws_smithy_types::DateTime {
|
134 + | &self.required_timestamp
|
269 135 | }
|
270 136 | #[allow(missing_docs)] // documentation missing in model
|
271 - | pub fn complex_union(&self) -> &crate::model::ComplexUnion {
|
272 - | use std::ops::Deref;
|
273 - | self.complex_union.deref()
|
137 + | pub fn required_enum(&self) -> &crate::model::Suit {
|
138 + | &self.required_enum
|
274 139 | }
|
275 140 | }
|
276 - | impl ComplexStructOperationInput {
|
277 - | /// Creates a new builder-style object to manufacture [`ComplexStructOperationInput`](crate::input::ComplexStructOperationInput).
|
278 - | pub fn builder() -> crate::input::complex_struct_operation_input::Builder {
|
279 - | crate::input::complex_struct_operation_input::Builder::default()
|
141 + | impl SimpleStructOperationInput {
|
142 + | /// Creates a new builder-style object to manufacture [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput).
|
143 + | pub fn builder() -> crate::input::simple_struct_operation_input::Builder {
|
144 + | crate::input::simple_struct_operation_input::Builder::default()
|
280 145 | }
|
281 146 | }
|
282 - | impl crate::constrained::Constrained for crate::input::ComplexStructOperationInput {
|
283 - | type Unconstrained = crate::input::complex_struct_operation_input::Builder;
|
147 + | impl crate::constrained::Constrained for crate::input::SimpleStructOperationInput {
|
148 + | type Unconstrained = crate::input::simple_struct_operation_input::Builder;
|
284 149 | }
|
285 150 |
|
286 151 | #[allow(missing_docs)] // documentation missing in model
|
287 152 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
288 153 | pub struct ErrorSerializationOperationInput {
|
289 154 | #[allow(missing_docs)] // documentation missing in model
|
290 155 | pub blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
291 156 | #[allow(missing_docs)] // documentation missing in model
|
292 157 | pub boolean: ::std::option::Option<bool>,
|
293 158 | #[allow(missing_docs)] // documentation missing in model
|
427 292 | pub fn builder() -> crate::input::error_serialization_operation_input::Builder {
|
428 293 | crate::input::error_serialization_operation_input::Builder::default()
|
429 294 | }
|
430 295 | }
|
431 296 | impl crate::constrained::Constrained for crate::input::ErrorSerializationOperationInput {
|
432 297 | type Unconstrained = crate::input::error_serialization_operation_input::Builder;
|
433 298 | }
|
434 299 |
|
435 300 | #[allow(missing_docs)] // documentation missing in model
|
436 301 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
437 - | pub struct SimpleStructOperationInput {
|
438 - | #[allow(missing_docs)] // documentation missing in model
|
439 - | pub blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
440 - | #[allow(missing_docs)] // documentation missing in model
|
441 - | pub boolean: ::std::option::Option<bool>,
|
302 + | pub struct ComplexStructOperationInput {
|
442 303 | #[allow(missing_docs)] // documentation missing in model
|
443 - | pub string: ::std::option::Option<::std::string::String>,
|
304 + | pub structure: ::std::option::Option<crate::model::SimpleStruct>,
|
444 305 | #[allow(missing_docs)] // documentation missing in model
|
445 - | pub byte: ::std::option::Option<i8>,
|
306 + | pub empty_structure: ::std::option::Option<crate::model::EmptyStruct>,
|
446 307 | #[allow(missing_docs)] // documentation missing in model
|
447 - | pub short: ::std::option::Option<i16>,
|
308 + | pub list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
448 309 | #[allow(missing_docs)] // documentation missing in model
|
449 - | pub integer: ::std::option::Option<i32>,
|
310 + | pub map: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
450 311 | #[allow(missing_docs)] // documentation missing in model
|
451 - | pub long: ::std::option::Option<i64>,
|
312 + | pub union: ::std::option::Option<crate::model::SimpleUnion>,
|
452 313 | #[allow(missing_docs)] // documentation missing in model
|
453 - | pub float: ::std::option::Option<f32>,
|
314 + | pub unit_union: ::std::option::Option<crate::model::UnitUnion>,
|
454 315 | #[allow(missing_docs)] // documentation missing in model
|
455 - | pub double: ::std::option::Option<f64>,
|
316 + | pub structure_list: ::std::option::Option<::std::vec::Vec<crate::model::SimpleStruct>>,
|
456 317 | #[allow(missing_docs)] // documentation missing in model
|
457 - | pub timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
318 + | pub complex_list: ::std::vec::Vec<
|
319 + | ::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>,
|
320 + | >,
|
458 321 | #[allow(missing_docs)] // documentation missing in model
|
459 - | pub r#enum: ::std::option::Option<crate::model::Suit>,
|
322 + | pub complex_map: ::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>,
|
460 323 | #[allow(missing_docs)] // documentation missing in model
|
461 - | pub required_blob: ::aws_smithy_types::Blob,
|
324 + | pub complex_union: ::std::boxed::Box<crate::model::ComplexUnion>,
|
325 + | }
|
326 + | impl ComplexStructOperationInput {
|
462 327 | #[allow(missing_docs)] // documentation missing in model
|
463 - | pub required_boolean: bool,
|
328 + | pub fn structure(&self) -> ::std::option::Option<&crate::model::SimpleStruct> {
|
329 + | self.structure.as_ref()
|
330 + | }
|
464 331 | #[allow(missing_docs)] // documentation missing in model
|
465 - | pub required_string: ::std::string::String,
|
332 + | pub fn empty_structure(&self) -> ::std::option::Option<&crate::model::EmptyStruct> {
|
333 + | self.empty_structure.as_ref()
|
334 + | }
|
466 335 | #[allow(missing_docs)] // documentation missing in model
|
467 - | pub required_byte: i8,
|
336 + | pub fn list(&self) -> ::std::option::Option<&[::std::string::String]> {
|
337 + | self.list.as_deref()
|
338 + | }
|
468 339 | #[allow(missing_docs)] // documentation missing in model
|
469 - | pub required_short: i16,
|
340 + | pub fn map(
|
341 + | &self,
|
342 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i32>> {
|
343 + | self.map.as_ref()
|
344 + | }
|
470 345 | #[allow(missing_docs)] // documentation missing in model
|
471 - | pub required_integer: i32,
|
346 + | pub fn union(&self) -> ::std::option::Option<&crate::model::SimpleUnion> {
|
347 + | self.union.as_ref()
|
348 + | }
|
472 349 | #[allow(missing_docs)] // documentation missing in model
|
473 - | pub required_long: i64,
|
350 + | pub fn unit_union(&self) -> ::std::option::Option<&crate::model::UnitUnion> {
|
351 + | self.unit_union.as_ref()
|
352 + | }
|
474 353 | #[allow(missing_docs)] // documentation missing in model
|
475 - | pub required_float: f32,
|
354 + | pub fn structure_list(&self) -> ::std::option::Option<&[crate::model::SimpleStruct]> {
|
355 + | self.structure_list.as_deref()
|
356 + | }
|
476 357 | #[allow(missing_docs)] // documentation missing in model
|
477 - | pub required_double: f64,
|
358 + | pub fn complex_list(
|
359 + | &self,
|
360 + | ) -> &[::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>] {
|
361 + | use std::ops::Deref;
|
362 + | self.complex_list.deref()
|
363 + | }
|
478 364 | #[allow(missing_docs)] // documentation missing in model
|
479 - | pub required_timestamp: ::aws_smithy_types::DateTime,
|
365 + | pub fn complex_map(
|
366 + | &self,
|
367 + | ) -> &::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion> {
|
368 + | &self.complex_map
|
369 + | }
|
480 370 | #[allow(missing_docs)] // documentation missing in model
|
481 - | pub required_enum: crate::model::Suit,
|
371 + | pub fn complex_union(&self) -> &crate::model::ComplexUnion {
|
372 + | use std::ops::Deref;
|
373 + | self.complex_union.deref()
|
374 + | }
|
482 375 | }
|
483 - | impl SimpleStructOperationInput {
|
484 - | #[allow(missing_docs)] // documentation missing in model
|
485 - | pub fn blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
486 - | self.blob.as_ref()
|
376 + | impl ComplexStructOperationInput {
|
377 + | /// Creates a new builder-style object to manufacture [`ComplexStructOperationInput`](crate::input::ComplexStructOperationInput).
|
378 + | pub fn builder() -> crate::input::complex_struct_operation_input::Builder {
|
379 + | crate::input::complex_struct_operation_input::Builder::default()
|
487 380 | }
|
488 - | #[allow(missing_docs)] // documentation missing in model
|
489 - | pub fn boolean(&self) -> ::std::option::Option<bool> {
|
490 - | self.boolean
|
381 + | }
|
382 + | impl crate::constrained::Constrained for crate::input::ComplexStructOperationInput {
|
383 + | type Unconstrained = crate::input::complex_struct_operation_input::Builder;
|
384 + | }
|
385 + |
|
386 + | #[allow(missing_docs)] // documentation missing in model
|
387 + | #[derive(
|
388 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
389 + | )]
|
390 + | pub struct EmptyStructOperationInput {}
|
391 + | impl EmptyStructOperationInput {
|
392 + | /// Creates a new builder-style object to manufacture [`EmptyStructOperationInput`](crate::input::EmptyStructOperationInput).
|
393 + | pub fn builder() -> crate::input::empty_struct_operation_input::Builder {
|
394 + | crate::input::empty_struct_operation_input::Builder::default()
|
491 395 | }
|
396 + | }
|
397 + | impl crate::constrained::Constrained for crate::input::EmptyStructOperationInput {
|
398 + | type Unconstrained = crate::input::empty_struct_operation_input::Builder;
|
399 + | }
|
400 + |
|
401 + | #[allow(missing_docs)] // documentation missing in model
|
402 + | #[derive(
|
403 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
404 + | )]
|
405 + | pub struct SingleMemberStructOperationInput {
|
492 406 | #[allow(missing_docs)] // documentation missing in model
|
493 - | pub fn string(&self) -> ::std::option::Option<&str> {
|
494 - | self.string.as_deref()
|
495 - | }
|
407 + | pub message: ::std::option::Option<::std::string::String>,
|
408 + | }
|
409 + | impl SingleMemberStructOperationInput {
|
496 410 | #[allow(missing_docs)] // documentation missing in model
|
497 - | pub fn byte(&self) -> ::std::option::Option<i8> {
|
498 - | self.byte
|
411 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
412 + | self.message.as_deref()
|
499 413 | }
|
500 - | #[allow(missing_docs)] // documentation missing in model
|
501 - | pub fn short(&self) -> ::std::option::Option<i16> {
|
502 - | self.short
|
414 + | }
|
415 + | impl SingleMemberStructOperationInput {
|
416 + | /// Creates a new builder-style object to manufacture [`SingleMemberStructOperationInput`](crate::input::SingleMemberStructOperationInput).
|
417 + | pub fn builder() -> crate::input::single_member_struct_operation_input::Builder {
|
418 + | crate::input::single_member_struct_operation_input::Builder::default()
|
503 419 | }
|
420 + | }
|
421 + | impl crate::constrained::Constrained for crate::input::SingleMemberStructOperationInput {
|
422 + | type Unconstrained = crate::input::single_member_struct_operation_input::Builder;
|
423 + | }
|
424 + |
|
425 + | #[allow(missing_docs)] // documentation missing in model
|
426 + | #[derive(
|
427 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
428 + | )]
|
429 + | pub struct RecursiveUnionOperationInput {
|
504 430 | #[allow(missing_docs)] // documentation missing in model
|
505 - | pub fn integer(&self) -> ::std::option::Option<i32> {
|
506 - | self.integer
|
507 - | }
|
431 + | pub nested: ::std::option::Option<crate::model::RecursiveOperationInputOutputNested1>,
|
432 + | }
|
433 + | impl RecursiveUnionOperationInput {
|
508 434 | #[allow(missing_docs)] // documentation missing in model
|
509 - | pub fn long(&self) -> ::std::option::Option<i64> {
|
510 - | self.long
|
435 + | pub fn nested(
|
436 + | &self,
|
437 + | ) -> ::std::option::Option<&crate::model::RecursiveOperationInputOutputNested1> {
|
438 + | self.nested.as_ref()
|
511 439 | }
|
512 - | #[allow(missing_docs)] // documentation missing in model
|
513 - | pub fn float(&self) -> ::std::option::Option<f32> {
|
514 - | self.float
|
440 + | }
|
441 + | impl RecursiveUnionOperationInput {
|
442 + | /// Creates a new builder-style object to manufacture [`RecursiveUnionOperationInput`](crate::input::RecursiveUnionOperationInput).
|
443 + | pub fn builder() -> crate::input::recursive_union_operation_input::Builder {
|
444 + | crate::input::recursive_union_operation_input::Builder::default()
|
515 445 | }
|
446 + | }
|
447 + | impl crate::constrained::Constrained for crate::input::RecursiveUnionOperationInput {
|
448 + | type Unconstrained = crate::input::recursive_union_operation_input::Builder;
|
449 + | }
|
450 + |
|
451 + | #[allow(missing_docs)] // documentation missing in model
|
452 + | #[derive(::std::fmt::Debug)]
|
453 + | pub struct StreamingOperationInput {
|
516 454 | #[allow(missing_docs)] // documentation missing in model
|
517 - | pub fn double(&self) -> ::std::option::Option<f64> {
|
518 - | self.double
|
519 - | }
|
455 + | pub events: crate::sigv4_event_stream::SigV4Receiver<
|
456 + | crate::model::Events,
|
457 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
458 + | >,
|
459 + | }
|
460 + | impl StreamingOperationInput {
|
520 461 | #[allow(missing_docs)] // documentation missing in model
|
521 - | pub fn timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
522 - | self.timestamp.as_ref()
|
462 + | pub fn events(
|
463 + | &self,
|
464 + | ) -> &crate::sigv4_event_stream::SigV4Receiver<
|
465 + | crate::model::Events,
|
466 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
467 + | > {
|
468 + | &self.events
|
523 469 | }
|
524 - | #[allow(missing_docs)] // documentation missing in model
|
525 - | pub fn r#enum(&self) -> ::std::option::Option<&crate::model::Suit> {
|
526 - | self.r#enum.as_ref()
|
470 + | }
|
471 + | impl StreamingOperationInput {
|
472 + | /// Creates a new builder-style object to manufacture [`StreamingOperationInput`](crate::input::StreamingOperationInput).
|
473 + | pub fn builder() -> crate::input::streaming_operation_input::Builder {
|
474 + | crate::input::streaming_operation_input::Builder::default()
|
527 475 | }
|
476 + | }
|
477 + | impl crate::constrained::Constrained for crate::input::StreamingOperationInput {
|
478 + | type Unconstrained = crate::input::streaming_operation_input::Builder;
|
479 + | }
|
480 + |
|
481 + | #[allow(missing_docs)] // documentation missing in model
|
482 + | #[derive(::std::fmt::Debug)]
|
483 + | pub struct StreamingOperationWithInitialDataInput {
|
528 484 | #[allow(missing_docs)] // documentation missing in model
|
529 - | pub fn required_blob(&self) -> &::aws_smithy_types::Blob {
|
530 - | &self.required_blob
|
531 - | }
|
485 + | pub initial_data: ::std::string::String,
|
532 486 | #[allow(missing_docs)] // documentation missing in model
|
533 - | pub fn required_boolean(&self) -> bool {
|
534 - | self.required_boolean
|
535 - | }
|
487 + | pub events: crate::sigv4_event_stream::SigV4Receiver<
|
488 + | crate::model::Events,
|
489 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
490 + | >,
|
491 + | }
|
492 + | impl StreamingOperationWithInitialDataInput {
|
536 493 | #[allow(missing_docs)] // documentation missing in model
|
537 - | pub fn required_string(&self) -> &str {
|
494 + | pub fn initial_data(&self) -> &str {
|
538 495 | use std::ops::Deref;
|
539 - | self.required_string.deref()
|
496 + | self.initial_data.deref()
|
540 497 | }
|
541 498 | #[allow(missing_docs)] // documentation missing in model
|
542 - | pub fn required_byte(&self) -> i8 {
|
543 - | self.required_byte
|
499 + | pub fn events(
|
500 + | &self,
|
501 + | ) -> &crate::sigv4_event_stream::SigV4Receiver<
|
502 + | crate::model::Events,
|
503 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
504 + | > {
|
505 + | &self.events
|
544 506 | }
|
545 - | #[allow(missing_docs)] // documentation missing in model
|
546 - | pub fn required_short(&self) -> i16 {
|
547 - | self.required_short
|
507 + | }
|
508 + | impl StreamingOperationWithInitialDataInput {
|
509 + | /// Creates a new builder-style object to manufacture [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
|
510 + | pub fn builder() -> crate::input::streaming_operation_with_initial_data_input::Builder {
|
511 + | crate::input::streaming_operation_with_initial_data_input::Builder::default()
|
548 512 | }
|
513 + | }
|
514 + | impl crate::constrained::Constrained for crate::input::StreamingOperationWithInitialDataInput {
|
515 + | type Unconstrained = crate::input::streaming_operation_with_initial_data_input::Builder;
|
516 + | }
|
517 + |
|
518 + | #[allow(missing_docs)] // documentation missing in model
|
519 + | #[derive(::std::fmt::Debug)]
|
520 + | pub struct StreamingOperationWithInitialResponseInput {
|
549 521 | #[allow(missing_docs)] // documentation missing in model
|
550 - | pub fn required_integer(&self) -> i32 {
|
551 - | self.required_integer
|
552 - | }
|
522 + | pub events: crate::sigv4_event_stream::SigV4Receiver<
|
523 + | crate::model::Events,
|
524 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
525 + | >,
|
526 + | }
|
527 + | impl StreamingOperationWithInitialResponseInput {
|
553 528 | #[allow(missing_docs)] // documentation missing in model
|
554 - | pub fn required_long(&self) -> i64 {
|
555 - | self.required_long
|
529 + | pub fn events(
|
530 + | &self,
|
531 + | ) -> &crate::sigv4_event_stream::SigV4Receiver<
|
532 + | crate::model::Events,
|
533 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
534 + | > {
|
535 + | &self.events
|
556 536 | }
|
557 - | #[allow(missing_docs)] // documentation missing in model
|
558 - | pub fn required_float(&self) -> f32 {
|
559 - | self.required_float
|
537 + | }
|
538 + | impl StreamingOperationWithInitialResponseInput {
|
539 + | /// Creates a new builder-style object to manufacture [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
|
540 + | pub fn builder() -> crate::input::streaming_operation_with_initial_response_input::Builder {
|
541 + | crate::input::streaming_operation_with_initial_response_input::Builder::default()
|
560 542 | }
|
543 + | }
|
544 + | impl crate::constrained::Constrained for crate::input::StreamingOperationWithInitialResponseInput {
|
545 + | type Unconstrained = crate::input::streaming_operation_with_initial_response_input::Builder;
|
546 + | }
|
547 + |
|
548 + | #[allow(missing_docs)] // documentation missing in model
|
549 + | #[derive(::std::fmt::Debug)]
|
550 + | pub struct StreamingOperationWithOptionalDataInput {
|
561 551 | #[allow(missing_docs)] // documentation missing in model
|
562 - | pub fn required_double(&self) -> f64 {
|
563 - | self.required_double
|
564 - | }
|
552 + | pub optional_data: ::std::option::Option<::std::string::String>,
|
565 553 | #[allow(missing_docs)] // documentation missing in model
|
566 - | pub fn required_timestamp(&self) -> &::aws_smithy_types::DateTime {
|
567 - | &self.required_timestamp
|
554 + | pub events: crate::sigv4_event_stream::SigV4Receiver<
|
555 + | crate::model::Events,
|
556 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
557 + | >,
|
558 + | }
|
559 + | impl StreamingOperationWithOptionalDataInput {
|
560 + | #[allow(missing_docs)] // documentation missing in model
|
561 + | pub fn optional_data(&self) -> ::std::option::Option<&str> {
|
562 + | self.optional_data.as_deref()
|
568 563 | }
|
569 564 | #[allow(missing_docs)] // documentation missing in model
|
570 - | pub fn required_enum(&self) -> &crate::model::Suit {
|
571 - | &self.required_enum
|
565 + | pub fn events(
|
566 + | &self,
|
567 + | ) -> &crate::sigv4_event_stream::SigV4Receiver<
|
568 + | crate::model::Events,
|
569 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
570 + | > {
|
571 + | &self.events
|
572 572 | }
|
573 573 | }
|
574 - | impl SimpleStructOperationInput {
|
575 - | /// Creates a new builder-style object to manufacture [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput).
|
576 - | pub fn builder() -> crate::input::simple_struct_operation_input::Builder {
|
577 - | crate::input::simple_struct_operation_input::Builder::default()
|
574 + | impl StreamingOperationWithOptionalDataInput {
|
575 + | /// Creates a new builder-style object to manufacture [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
|
576 + | pub fn builder() -> crate::input::streaming_operation_with_optional_data_input::Builder {
|
577 + | crate::input::streaming_operation_with_optional_data_input::Builder::default()
|
578 578 | }
|
579 579 | }
|
580 - | impl crate::constrained::Constrained for crate::input::SimpleStructOperationInput {
|
581 - | type Unconstrained = crate::input::simple_struct_operation_input::Builder;
|
580 + | impl crate::constrained::Constrained for crate::input::StreamingOperationWithOptionalDataInput {
|
581 + | type Unconstrained = crate::input::streaming_operation_with_optional_data_input::Builder;
|
582 582 | }
|
583 - | /// See [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
|
584 - | pub mod streaming_operation_with_optional_data_input {
|
583 + | /// See [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput).
|
584 + | pub mod simple_struct_operation_input {
|
585 585 |
|
586 586 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
587 587 | /// Holds one variant for each of the ways the builder can fail.
|
588 588 | #[non_exhaustive]
|
589 589 | #[allow(clippy::enum_variant_names)]
|
590 590 | pub enum ConstraintViolation {
|
591 - | /// `events` was not provided but it is required when building `StreamingOperationWithOptionalDataInput`.
|
592 - | MissingEvents,
|
591 + | /// Constraint violation occurred building member `r#enum` when building `SimpleStructOperationInput`.
|
592 + | #[doc(hidden)]
|
593 + | Enum(crate::model::suit::ConstraintViolation),
|
594 + | /// `required_blob` was not provided but it is required when building `SimpleStructOperationInput`.
|
595 + | MissingRequiredBlob,
|
596 + | /// `required_boolean` was not provided but it is required when building `SimpleStructOperationInput`.
|
597 + | MissingRequiredBoolean,
|
598 + | /// `required_string` was not provided but it is required when building `SimpleStructOperationInput`.
|
599 + | MissingRequiredString,
|
600 + | /// `required_byte` was not provided but it is required when building `SimpleStructOperationInput`.
|
601 + | MissingRequiredByte,
|
602 + | /// `required_short` was not provided but it is required when building `SimpleStructOperationInput`.
|
603 + | MissingRequiredShort,
|
604 + | /// `required_integer` was not provided but it is required when building `SimpleStructOperationInput`.
|
605 + | MissingRequiredInteger,
|
606 + | /// `required_long` was not provided but it is required when building `SimpleStructOperationInput`.
|
607 + | MissingRequiredLong,
|
608 + | /// `required_float` was not provided but it is required when building `SimpleStructOperationInput`.
|
609 + | MissingRequiredFloat,
|
610 + | /// `required_double` was not provided but it is required when building `SimpleStructOperationInput`.
|
611 + | MissingRequiredDouble,
|
612 + | /// `required_timestamp` was not provided but it is required when building `SimpleStructOperationInput`.
|
613 + | MissingRequiredTimestamp,
|
614 + | /// `required_enum` was not provided but it is required when building `SimpleStructOperationInput`.
|
615 + | MissingRequiredEnum,
|
616 + | /// Constraint violation occurred building member `required_enum` when building `SimpleStructOperationInput`.
|
617 + | #[doc(hidden)]
|
618 + | RequiredEnum(crate::model::suit::ConstraintViolation),
|
593 619 | }
|
594 620 | impl ::std::fmt::Display for ConstraintViolation {
|
595 621 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
596 622 | match self {
|
597 - | ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `StreamingOperationWithOptionalDataInput`"),
|
623 + | ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `SimpleStructOperationInput`"),
|
624 + | ConstraintViolation::MissingRequiredBlob => write!(f, "`required_blob` was not provided but it is required when building `SimpleStructOperationInput`"),
|
625 + | ConstraintViolation::MissingRequiredBoolean => write!(f, "`required_boolean` was not provided but it is required when building `SimpleStructOperationInput`"),
|
626 + | ConstraintViolation::MissingRequiredString => write!(f, "`required_string` was not provided but it is required when building `SimpleStructOperationInput`"),
|
627 + | ConstraintViolation::MissingRequiredByte => write!(f, "`required_byte` was not provided but it is required when building `SimpleStructOperationInput`"),
|
628 + | ConstraintViolation::MissingRequiredShort => write!(f, "`required_short` was not provided but it is required when building `SimpleStructOperationInput`"),
|
629 + | ConstraintViolation::MissingRequiredInteger => write!(f, "`required_integer` was not provided but it is required when building `SimpleStructOperationInput`"),
|
630 + | ConstraintViolation::MissingRequiredLong => write!(f, "`required_long` was not provided but it is required when building `SimpleStructOperationInput`"),
|
631 + | ConstraintViolation::MissingRequiredFloat => write!(f, "`required_float` was not provided but it is required when building `SimpleStructOperationInput`"),
|
632 + | ConstraintViolation::MissingRequiredDouble => write!(f, "`required_double` was not provided but it is required when building `SimpleStructOperationInput`"),
|
633 + | ConstraintViolation::MissingRequiredTimestamp => write!(f, "`required_timestamp` was not provided but it is required when building `SimpleStructOperationInput`"),
|
634 + | ConstraintViolation::MissingRequiredEnum => write!(f, "`required_enum` was not provided but it is required when building `SimpleStructOperationInput`"),
|
635 + | ConstraintViolation::RequiredEnum(_) => write!(f, "constraint violation occurred building member `required_enum` when building `SimpleStructOperationInput`"),
|
598 636 | }
|
599 637 | }
|
600 638 | }
|
601 639 | impl ::std::error::Error for ConstraintViolation {}
|
602 640 | impl ConstraintViolation {
|
603 641 | pub(crate) fn as_validation_exception_field(
|
604 642 | self,
|
605 643 | path: ::std::string::String,
|
606 644 | ) -> crate::model::ValidationExceptionField {
|
607 645 | match self {
|
608 - | ConstraintViolation::MissingEvents => crate::model::ValidationExceptionField {
|
609 - | message: format!("Value at '{}/events' failed to satisfy constraint: Member must not be null", path),
|
610 - | path: path + "/events",
|
646 + | ConstraintViolation::Enum(inner) => inner.as_validation_exception_field(path + "/enum"),
|
647 + | ConstraintViolation::MissingRequiredBlob => crate::model::ValidationExceptionField {
|
648 + | message: format!("Value at '{}/requiredBlob' failed to satisfy constraint: Member must not be null", path),
|
649 + | path: path + "/requiredBlob",
|
650 + | },
|
651 + | ConstraintViolation::MissingRequiredBoolean => crate::model::ValidationExceptionField {
|
652 + | message: format!("Value at '{}/requiredBoolean' failed to satisfy constraint: Member must not be null", path),
|
653 + | path: path + "/requiredBoolean",
|
654 + | },
|
655 + | ConstraintViolation::MissingRequiredString => crate::model::ValidationExceptionField {
|
656 + | message: format!("Value at '{}/requiredString' failed to satisfy constraint: Member must not be null", path),
|
657 + | path: path + "/requiredString",
|
658 + | },
|
659 + | ConstraintViolation::MissingRequiredByte => crate::model::ValidationExceptionField {
|
660 + | message: format!("Value at '{}/requiredByte' failed to satisfy constraint: Member must not be null", path),
|
661 + | path: path + "/requiredByte",
|
662 + | },
|
663 + | ConstraintViolation::MissingRequiredShort => crate::model::ValidationExceptionField {
|
664 + | message: format!("Value at '{}/requiredShort' failed to satisfy constraint: Member must not be null", path),
|
665 + | path: path + "/requiredShort",
|
666 + | },
|
667 + | ConstraintViolation::MissingRequiredInteger => crate::model::ValidationExceptionField {
|
668 + | message: format!("Value at '{}/requiredInteger' failed to satisfy constraint: Member must not be null", path),
|
669 + | path: path + "/requiredInteger",
|
670 + | },
|
671 + | ConstraintViolation::MissingRequiredLong => crate::model::ValidationExceptionField {
|
672 + | message: format!("Value at '{}/requiredLong' failed to satisfy constraint: Member must not be null", path),
|
673 + | path: path + "/requiredLong",
|
674 + | },
|
675 + | ConstraintViolation::MissingRequiredFloat => crate::model::ValidationExceptionField {
|
676 + | message: format!("Value at '{}/requiredFloat' failed to satisfy constraint: Member must not be null", path),
|
677 + | path: path + "/requiredFloat",
|
678 + | },
|
679 + | ConstraintViolation::MissingRequiredDouble => crate::model::ValidationExceptionField {
|
680 + | message: format!("Value at '{}/requiredDouble' failed to satisfy constraint: Member must not be null", path),
|
681 + | path: path + "/requiredDouble",
|
682 + | },
|
683 + | ConstraintViolation::MissingRequiredTimestamp => crate::model::ValidationExceptionField {
|
684 + | message: format!("Value at '{}/requiredTimestamp' failed to satisfy constraint: Member must not be null", path),
|
685 + | path: path + "/requiredTimestamp",
|
686 + | },
|
687 + | ConstraintViolation::MissingRequiredEnum => crate::model::ValidationExceptionField {
|
688 + | message: format!("Value at '{}/requiredEnum' failed to satisfy constraint: Member must not be null", path),
|
689 + | path: path + "/requiredEnum",
|
611 690 | },
|
691 + | ConstraintViolation::RequiredEnum(inner) => inner.as_validation_exception_field(path + "/requiredEnum"),
|
612 692 | }
|
613 693 | }
|
614 694 | }
|
615 695 | impl ::std::convert::From<ConstraintViolation>
|
616 696 | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
617 697 | {
|
618 698 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
619 699 | let first_validation_exception_field =
|
620 700 | constraint_violation.as_validation_exception_field("".to_owned());
|
621 701 | let validation_exception = crate::error::ValidationException {
|
622 702 | message: format!(
|
623 703 | "1 validation error detected. {}",
|
624 704 | &first_validation_exception_field.message
|
625 705 | ),
|
626 706 | field_list: Some(vec![first_validation_exception_field]),
|
627 707 | };
|
628 708 | Self::ConstraintViolation(
|
629 709 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
630 710 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
631 711 | )
|
632 712 | }
|
633 713 | }
|
634 714 | impl ::std::convert::From<Builder>
|
635 - | for crate::constrained::MaybeConstrained<
|
636 - | crate::input::StreamingOperationWithOptionalDataInput,
|
637 - | >
|
715 + | for crate::constrained::MaybeConstrained<crate::input::SimpleStructOperationInput>
|
638 716 | {
|
639 717 | fn from(builder: Builder) -> Self {
|
640 718 | Self::Unconstrained(builder)
|
641 719 | }
|
642 720 | }
|
643 - | impl ::std::convert::TryFrom<Builder> for crate::input::StreamingOperationWithOptionalDataInput {
|
721 + | impl ::std::convert::TryFrom<Builder> for crate::input::SimpleStructOperationInput {
|
644 722 | type Error = ConstraintViolation;
|
645 723 |
|
646 724 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
647 725 | builder.build()
|
648 726 | }
|
649 727 | }
|
650 - | /// A builder for [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
|
651 - | #[derive(::std::default::Default, ::std::fmt::Debug)]
|
728 + | /// A builder for [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput).
|
729 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
652 730 | pub struct Builder {
|
653 - | pub(crate) optional_data: ::std::option::Option<::std::string::String>,
|
654 - | pub(crate) events: ::std::option::Option<
|
655 - | crate::sigv4_event_stream::SigV4Receiver<
|
656 - | crate::model::Events,
|
657 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
658 - | >,
|
659 - | >,
|
731 + | pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
732 + | pub(crate) boolean: ::std::option::Option<bool>,
|
733 + | pub(crate) string: ::std::option::Option<::std::string::String>,
|
734 + | pub(crate) byte: ::std::option::Option<i8>,
|
735 + | pub(crate) short: ::std::option::Option<i16>,
|
736 + | pub(crate) integer: ::std::option::Option<i32>,
|
737 + | pub(crate) long: ::std::option::Option<i64>,
|
738 + | pub(crate) float: ::std::option::Option<f32>,
|
739 + | pub(crate) double: ::std::option::Option<f64>,
|
740 + | pub(crate) timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
741 + | pub(crate) r#enum:
|
742 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
743 + | pub(crate) required_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
744 + | pub(crate) required_boolean: ::std::option::Option<bool>,
|
745 + | pub(crate) required_string: ::std::option::Option<::std::string::String>,
|
746 + | pub(crate) required_byte: ::std::option::Option<i8>,
|
747 + | pub(crate) required_short: ::std::option::Option<i16>,
|
748 + | pub(crate) required_integer: ::std::option::Option<i32>,
|
749 + | pub(crate) required_long: ::std::option::Option<i64>,
|
750 + | pub(crate) required_float: ::std::option::Option<f32>,
|
751 + | pub(crate) required_double: ::std::option::Option<f64>,
|
752 + | pub(crate) required_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
753 + | pub(crate) required_enum:
|
754 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
660 755 | }
|
661 756 | impl Builder {
|
662 757 | #[allow(missing_docs)] // documentation missing in model
|
663 - | pub fn optional_data(
|
758 + | pub fn blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
|
759 + | self.blob = input;
|
760 + | self
|
761 + | }
|
762 + | #[allow(missing_docs)] // documentation missing in model
|
763 + | pub(crate) fn set_blob(
|
664 764 | mut self,
|
665 - | input: ::std::option::Option<::std::string::String>,
|
765 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::Blob>>,
|
666 766 | ) -> Self {
|
667 - | self.optional_data = input;
|
767 + | self.blob = input.map(|v| v.into());
|
668 768 | self
|
669 769 | }
|
670 770 | #[allow(missing_docs)] // documentation missing in model
|
671 - | pub(crate) fn set_optional_data(
|
771 + | pub fn boolean(mut self, input: ::std::option::Option<bool>) -> Self {
|
772 + | self.boolean = input;
|
773 + | self
|
774 + | }
|
775 + | #[allow(missing_docs)] // documentation missing in model
|
776 + | pub(crate) fn set_boolean(
|
777 + | mut self,
|
778 + | input: Option<impl ::std::convert::Into<bool>>,
|
779 + | ) -> Self {
|
780 + | self.boolean = input.map(|v| v.into());
|
781 + | self
|
782 + | }
|
783 + | #[allow(missing_docs)] // documentation missing in model
|
784 + | pub fn string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
785 + | self.string = input;
|
786 + | self
|
787 + | }
|
788 + | #[allow(missing_docs)] // documentation missing in model
|
789 + | pub(crate) fn set_string(
|
672 790 | mut self,
|
673 791 | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
674 792 | ) -> Self {
|
675 - | self.optional_data = input.map(|v| v.into());
|
793 + | self.string = input.map(|v| v.into());
|
676 794 | self
|
677 795 | }
|
678 796 | #[allow(missing_docs)] // documentation missing in model
|
679 - | pub fn events(
|
797 + | pub fn byte(mut self, input: ::std::option::Option<i8>) -> Self {
|
798 + | self.byte = input;
|
799 + | self
|
800 + | }
|
801 + | #[allow(missing_docs)] // documentation missing in model
|
802 + | pub(crate) fn set_byte(mut self, input: Option<impl ::std::convert::Into<i8>>) -> Self {
|
803 + | self.byte = input.map(|v| v.into());
|
804 + | self
|
805 + | }
|
806 + | #[allow(missing_docs)] // documentation missing in model
|
807 + | pub fn short(mut self, input: ::std::option::Option<i16>) -> Self {
|
808 + | self.short = input;
|
809 + | self
|
810 + | }
|
811 + | #[allow(missing_docs)] // documentation missing in model
|
812 + | pub(crate) fn set_short(mut self, input: Option<impl ::std::convert::Into<i16>>) -> Self {
|
813 + | self.short = input.map(|v| v.into());
|
814 + | self
|
815 + | }
|
816 + | #[allow(missing_docs)] // documentation missing in model
|
817 + | pub fn integer(mut self, input: ::std::option::Option<i32>) -> Self {
|
818 + | self.integer = input;
|
819 + | self
|
820 + | }
|
821 + | #[allow(missing_docs)] // documentation missing in model
|
822 + | pub(crate) fn set_integer(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
823 + | self.integer = input.map(|v| v.into());
|
824 + | self
|
825 + | }
|
826 + | #[allow(missing_docs)] // documentation missing in model
|
827 + | pub fn long(mut self, input: ::std::option::Option<i64>) -> Self {
|
828 + | self.long = input;
|
829 + | self
|
830 + | }
|
831 + | #[allow(missing_docs)] // documentation missing in model
|
832 + | pub(crate) fn set_long(mut self, input: Option<impl ::std::convert::Into<i64>>) -> Self {
|
833 + | self.long = input.map(|v| v.into());
|
834 + | self
|
835 + | }
|
836 + | #[allow(missing_docs)] // documentation missing in model
|
837 + | pub fn float(mut self, input: ::std::option::Option<f32>) -> Self {
|
838 + | self.float = input;
|
839 + | self
|
840 + | }
|
841 + | #[allow(missing_docs)] // documentation missing in model
|
842 + | pub(crate) fn set_float(mut self, input: Option<impl ::std::convert::Into<f32>>) -> Self {
|
843 + | self.float = input.map(|v| v.into());
|
844 + | self
|
845 + | }
|
846 + | #[allow(missing_docs)] // documentation missing in model
|
847 + | pub fn double(mut self, input: ::std::option::Option<f64>) -> Self {
|
848 + | self.double = input;
|
849 + | self
|
850 + | }
|
851 + | #[allow(missing_docs)] // documentation missing in model
|
852 + | pub(crate) fn set_double(mut self, input: Option<impl ::std::convert::Into<f64>>) -> Self {
|
853 + | self.double = input.map(|v| v.into());
|
854 + | self
|
855 + | }
|
856 + | #[allow(missing_docs)] // documentation missing in model
|
857 + | pub fn timestamp(
|
680 858 | mut self,
|
681 - | input: crate::sigv4_event_stream::SigV4Receiver<
|
682 - | crate::model::Events,
|
683 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
684 - | >,
|
859 + | input: ::std::option::Option<::aws_smithy_types::DateTime>,
|
685 860 | ) -> Self {
|
686 - | self.events = Some(input);
|
861 + | self.timestamp = input;
|
687 862 | self
|
688 863 | }
|
689 864 | #[allow(missing_docs)] // documentation missing in model
|
690 - | pub(crate) fn set_events(
|
865 + | pub(crate) fn set_timestamp(
|
691 866 | mut self,
|
692 - | input: impl ::std::convert::Into<
|
693 - | crate::sigv4_event_stream::SigV4Receiver<
|
694 - | crate::model::Events,
|
695 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
696 - | >,
|
867 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::DateTime>>,
|
868 + | ) -> Self {
|
869 + | self.timestamp = input.map(|v| v.into());
|
870 + | self
|
871 + | }
|
872 + | #[allow(missing_docs)] // documentation missing in model
|
873 + | pub fn r#enum(mut self, input: ::std::option::Option<crate::model::Suit>) -> Self {
|
874 + | self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
|
875 + | self
|
876 + | }
|
877 + | #[allow(missing_docs)] // documentation missing in model
|
878 + | pub(crate) fn set_enum(
|
879 + | mut self,
|
880 + | input: Option<
|
881 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
697 882 | >,
|
698 883 | ) -> Self {
|
699 - | self.events = Some(input.into());
|
884 + | self.r#enum = input.map(|v| v.into());
|
700 885 | self
|
701 886 | }
|
702 - | /// Consumes the builder and constructs a [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
|
703 - | ///
|
704 - | /// The builder fails to construct a [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput) if a [`ConstraintViolation`] occurs.
|
705 - | ///
|
706 - | pub fn build(
|
707 - | self,
|
708 - | ) -> Result<crate::input::StreamingOperationWithOptionalDataInput, ConstraintViolation>
|
709 - | {
|
710 - | self.build_enforcing_all_constraints()
|
887 + | #[allow(missing_docs)] // documentation missing in model
|
888 + | pub fn required_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
|
889 + | self.required_blob = Some(input);
|
890 + | self
|
711 891 | }
|
712 - | fn build_enforcing_all_constraints(
|
713 - | self,
|
714 - | ) -> Result<crate::input::StreamingOperationWithOptionalDataInput, ConstraintViolation>
|
715 - | {
|
716 - | Ok(crate::input::StreamingOperationWithOptionalDataInput {
|
717 - | optional_data: self.optional_data,
|
718 - | events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
|
719 - | })
|
892 + | #[allow(missing_docs)] // documentation missing in model
|
893 + | pub(crate) fn set_required_blob(
|
894 + | mut self,
|
895 + | input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
|
896 + | ) -> Self {
|
897 + | self.required_blob = Some(input.into());
|
898 + | self
|
899 + | }
|
900 + | #[allow(missing_docs)] // documentation missing in model
|
901 + | pub fn required_boolean(mut self, input: bool) -> Self {
|
902 + | self.required_boolean = Some(input);
|
903 + | self
|
904 + | }
|
905 + | #[allow(missing_docs)] // documentation missing in model
|
906 + | pub(crate) fn set_required_boolean(
|
907 + | mut self,
|
908 + | input: impl ::std::convert::Into<bool>,
|
909 + | ) -> Self {
|
910 + | self.required_boolean = Some(input.into());
|
911 + | self
|
720 912 | }
|
913 + | #[allow(missing_docs)] // documentation missing in model
|
914 + | pub fn required_string(mut self, input: ::std::string::String) -> Self {
|
915 + | self.required_string = Some(input);
|
916 + | self
|
721 917 | }
|
722 - | }
|
723 - | /// See [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
|
724 - | pub mod streaming_operation_with_initial_response_input {
|
725 - |
|
726 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
727 - | /// Holds one variant for each of the ways the builder can fail.
|
728 - | #[non_exhaustive]
|
729 - | #[allow(clippy::enum_variant_names)]
|
730 - | pub enum ConstraintViolation {
|
731 - | /// `events` was not provided but it is required when building `StreamingOperationWithInitialResponseInput`.
|
732 - | MissingEvents,
|
918 + | #[allow(missing_docs)] // documentation missing in model
|
919 + | pub(crate) fn set_required_string(
|
920 + | mut self,
|
921 + | input: impl ::std::convert::Into<::std::string::String>,
|
922 + | ) -> Self {
|
923 + | self.required_string = Some(input.into());
|
924 + | self
|
733 925 | }
|
734 - | impl ::std::fmt::Display for ConstraintViolation {
|
735 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
736 - | match self {
|
737 - | ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `StreamingOperationWithInitialResponseInput`"),
|
926 + | #[allow(missing_docs)] // documentation missing in model
|
927 + | pub fn required_byte(mut self, input: i8) -> Self {
|
928 + | self.required_byte = Some(input);
|
929 + | self
|
738 930 | }
|
931 + | #[allow(missing_docs)] // documentation missing in model
|
932 + | pub(crate) fn set_required_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
|
933 + | self.required_byte = Some(input.into());
|
934 + | self
|
739 935 | }
|
936 + | #[allow(missing_docs)] // documentation missing in model
|
937 + | pub fn required_short(mut self, input: i16) -> Self {
|
938 + | self.required_short = Some(input);
|
939 + | self
|
740 940 | }
|
741 - | impl ::std::error::Error for ConstraintViolation {}
|
742 - | impl ConstraintViolation {
|
743 - | pub(crate) fn as_validation_exception_field(
|
744 - | self,
|
745 - | path: ::std::string::String,
|
746 - | ) -> crate::model::ValidationExceptionField {
|
747 - | match self {
|
748 - | ConstraintViolation::MissingEvents => crate::model::ValidationExceptionField {
|
749 - | message: format!("Value at '{}/events' failed to satisfy constraint: Member must not be null", path),
|
750 - | path: path + "/events",
|
751 - | },
|
941 + | #[allow(missing_docs)] // documentation missing in model
|
942 + | pub(crate) fn set_required_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
|
943 + | self.required_short = Some(input.into());
|
944 + | self
|
752 945 | }
|
946 + | #[allow(missing_docs)] // documentation missing in model
|
947 + | pub fn required_integer(mut self, input: i32) -> Self {
|
948 + | self.required_integer = Some(input);
|
949 + | self
|
753 950 | }
|
951 + | #[allow(missing_docs)] // documentation missing in model
|
952 + | pub(crate) fn set_required_integer(
|
953 + | mut self,
|
954 + | input: impl ::std::convert::Into<i32>,
|
955 + | ) -> Self {
|
956 + | self.required_integer = Some(input.into());
|
957 + | self
|
754 958 | }
|
755 - | impl ::std::convert::From<ConstraintViolation>
|
756 - | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
757 - | {
|
758 - | fn from(constraint_violation: ConstraintViolation) -> Self {
|
759 - | let first_validation_exception_field =
|
760 - | constraint_violation.as_validation_exception_field("".to_owned());
|
761 - | let validation_exception = crate::error::ValidationException {
|
762 - | message: format!(
|
763 - | "1 validation error detected. {}",
|
764 - | &first_validation_exception_field.message
|
765 - | ),
|
766 - | field_list: Some(vec![first_validation_exception_field]),
|
767 - | };
|
768 - | Self::ConstraintViolation(
|
769 - | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
770 - | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
771 - | )
|
959 + | #[allow(missing_docs)] // documentation missing in model
|
960 + | pub fn required_long(mut self, input: i64) -> Self {
|
961 + | self.required_long = Some(input);
|
962 + | self
|
772 963 | }
|
964 + | #[allow(missing_docs)] // documentation missing in model
|
965 + | pub(crate) fn set_required_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
|
966 + | self.required_long = Some(input.into());
|
967 + | self
|
773 968 | }
|
774 - | impl ::std::convert::From<Builder>
|
775 - | for crate::constrained::MaybeConstrained<
|
776 - | crate::input::StreamingOperationWithInitialResponseInput,
|
777 - | >
|
778 - | {
|
779 - | fn from(builder: Builder) -> Self {
|
780 - | Self::Unconstrained(builder)
|
969 + | #[allow(missing_docs)] // documentation missing in model
|
970 + | pub fn required_float(mut self, input: f32) -> Self {
|
971 + | self.required_float = Some(input);
|
972 + | self
|
781 973 | }
|
974 + | #[allow(missing_docs)] // documentation missing in model
|
975 + | pub(crate) fn set_required_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
|
976 + | self.required_float = Some(input.into());
|
977 + | self
|
782 978 | }
|
783 - | impl ::std::convert::TryFrom<Builder> for crate::input::StreamingOperationWithInitialResponseInput {
|
784 - | type Error = ConstraintViolation;
|
785 - |
|
786 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
787 - | builder.build()
|
979 + | #[allow(missing_docs)] // documentation missing in model
|
980 + | pub fn required_double(mut self, input: f64) -> Self {
|
981 + | self.required_double = Some(input);
|
982 + | self
|
788 983 | }
|
984 + | #[allow(missing_docs)] // documentation missing in model
|
985 + | pub(crate) fn set_required_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
|
986 + | self.required_double = Some(input.into());
|
987 + | self
|
789 988 | }
|
790 - | /// A builder for [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
|
791 - | #[derive(::std::default::Default, ::std::fmt::Debug)]
|
792 - | pub struct Builder {
|
793 - | pub(crate) events: ::std::option::Option<
|
794 - | crate::sigv4_event_stream::SigV4Receiver<
|
795 - | crate::model::Events,
|
796 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
797 - | >,
|
798 - | >,
|
989 + | #[allow(missing_docs)] // documentation missing in model
|
990 + | pub fn required_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
|
991 + | self.required_timestamp = Some(input);
|
992 + | self
|
799 993 | }
|
800 - | impl Builder {
|
801 994 | #[allow(missing_docs)] // documentation missing in model
|
802 - | pub fn events(
|
995 + | pub(crate) fn set_required_timestamp(
|
803 996 | mut self,
|
804 - | input: crate::sigv4_event_stream::SigV4Receiver<
|
805 - | crate::model::Events,
|
806 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
807 - | >,
|
997 + | input: impl ::std::convert::Into<::aws_smithy_types::DateTime>,
|
808 998 | ) -> Self {
|
809 - | self.events = Some(input);
|
999 + | self.required_timestamp = Some(input.into());
|
810 1000 | self
|
811 1001 | }
|
812 1002 | #[allow(missing_docs)] // documentation missing in model
|
813 - | pub(crate) fn set_events(
|
1003 + | pub fn required_enum(mut self, input: crate::model::Suit) -> Self {
|
1004 + | self.required_enum = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1005 + | self
|
1006 + | }
|
1007 + | #[allow(missing_docs)] // documentation missing in model
|
1008 + | pub(crate) fn set_required_enum(
|
814 1009 | mut self,
|
815 - | input: impl ::std::convert::Into<
|
816 - | crate::sigv4_event_stream::SigV4Receiver<
|
817 - | crate::model::Events,
|
818 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
819 - | >,
|
820 - | >,
|
1010 + | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
821 1011 | ) -> Self {
|
822 - | self.events = Some(input.into());
|
1012 + | self.required_enum = Some(input.into());
|
823 1013 | self
|
824 1014 | }
|
825 - | /// Consumes the builder and constructs a [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
|
1015 + | /// Consumes the builder and constructs a [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput).
|
826 1016 | ///
|
827 - | /// The builder fails to construct a [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput) if a [`ConstraintViolation`] occurs.
|
1017 + | /// The builder fails to construct a [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput) if a [`ConstraintViolation`] occurs.
|
828 1018 | ///
|
1019 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
829 1020 | pub fn build(
|
830 1021 | self,
|
831 - | ) -> Result<crate::input::StreamingOperationWithInitialResponseInput, ConstraintViolation>
|
832 - | {
|
1022 + | ) -> Result<crate::input::SimpleStructOperationInput, ConstraintViolation> {
|
833 1023 | self.build_enforcing_all_constraints()
|
834 1024 | }
|
835 1025 | fn build_enforcing_all_constraints(
|
836 1026 | self,
|
837 - | ) -> Result<crate::input::StreamingOperationWithInitialResponseInput, ConstraintViolation>
|
838 - | {
|
839 - | Ok(crate::input::StreamingOperationWithInitialResponseInput {
|
840 - | events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
|
1027 + | ) -> Result<crate::input::SimpleStructOperationInput, ConstraintViolation> {
|
1028 + | Ok(crate::input::SimpleStructOperationInput {
|
1029 + | blob: self.blob,
|
1030 + | boolean: self.boolean,
|
1031 + | string: self.string,
|
1032 + | byte: self.byte,
|
1033 + | short: self.short,
|
1034 + | integer: self.integer,
|
1035 + | long: self.long,
|
1036 + | float: self.float,
|
1037 + | double: self.double,
|
1038 + | timestamp: self.timestamp,
|
1039 + | r#enum: self
|
1040 + | .r#enum
|
1041 + | .map(|v| match v {
|
1042 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1043 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1044 + | })
|
1045 + | .map(|res| res.map_err(ConstraintViolation::Enum))
|
1046 + | .transpose()?,
|
1047 + | required_blob: self
|
1048 + | .required_blob
|
1049 + | .ok_or(ConstraintViolation::MissingRequiredBlob)?,
|
1050 + | required_boolean: self
|
1051 + | .required_boolean
|
1052 + | .ok_or(ConstraintViolation::MissingRequiredBoolean)?,
|
1053 + | required_string: self
|
1054 + | .required_string
|
1055 + | .ok_or(ConstraintViolation::MissingRequiredString)?,
|
1056 + | required_byte: self
|
1057 + | .required_byte
|
1058 + | .ok_or(ConstraintViolation::MissingRequiredByte)?,
|
1059 + | required_short: self
|
1060 + | .required_short
|
1061 + | .ok_or(ConstraintViolation::MissingRequiredShort)?,
|
1062 + | required_integer: self
|
1063 + | .required_integer
|
1064 + | .ok_or(ConstraintViolation::MissingRequiredInteger)?,
|
1065 + | required_long: self
|
1066 + | .required_long
|
1067 + | .ok_or(ConstraintViolation::MissingRequiredLong)?,
|
1068 + | required_float: self
|
1069 + | .required_float
|
1070 + | .ok_or(ConstraintViolation::MissingRequiredFloat)?,
|
1071 + | required_double: self
|
1072 + | .required_double
|
1073 + | .ok_or(ConstraintViolation::MissingRequiredDouble)?,
|
1074 + | required_timestamp: self
|
1075 + | .required_timestamp
|
1076 + | .ok_or(ConstraintViolation::MissingRequiredTimestamp)?,
|
1077 + | required_enum: self
|
1078 + | .required_enum
|
1079 + | .map(|v| match v {
|
1080 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1081 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1082 + | })
|
1083 + | .map(|res| res.map_err(ConstraintViolation::RequiredEnum))
|
1084 + | .transpose()?
|
1085 + | .ok_or(ConstraintViolation::MissingRequiredEnum)?,
|
841 1086 | })
|
842 1087 | }
|
843 1088 | }
|
844 1089 | }
|
845 - | /// See [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
|
846 - | pub mod streaming_operation_with_initial_data_input {
|
1090 + | /// See [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput).
|
1091 + | pub mod error_serialization_operation_input {
|
847 1092 |
|
848 1093 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
849 1094 | /// Holds one variant for each of the ways the builder can fail.
|
850 1095 | #[non_exhaustive]
|
851 1096 | #[allow(clippy::enum_variant_names)]
|
852 1097 | pub enum ConstraintViolation {
|
853 - | /// `initial_data` was not provided but it is required when building `StreamingOperationWithInitialDataInput`.
|
854 - | MissingInitialData,
|
855 - | /// `events` was not provided but it is required when building `StreamingOperationWithInitialDataInput`.
|
856 - | MissingEvents,
|
1098 + | /// Constraint violation occurred building member `r#enum` when building `ErrorSerializationOperationInput`.
|
1099 + | #[doc(hidden)]
|
1100 + | Enum(crate::model::suit::ConstraintViolation),
|
1101 + | /// `required_blob` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1102 + | MissingRequiredBlob,
|
1103 + | /// `required_boolean` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1104 + | MissingRequiredBoolean,
|
1105 + | /// `required_string` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1106 + | MissingRequiredString,
|
1107 + | /// `required_byte` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1108 + | MissingRequiredByte,
|
1109 + | /// `required_short` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1110 + | MissingRequiredShort,
|
1111 + | /// `required_integer` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1112 + | MissingRequiredInteger,
|
1113 + | /// `required_long` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1114 + | MissingRequiredLong,
|
1115 + | /// `required_float` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1116 + | MissingRequiredFloat,
|
1117 + | /// `required_double` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1118 + | MissingRequiredDouble,
|
1119 + | /// `required_timestamp` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1120 + | MissingRequiredTimestamp,
|
1121 + | /// `required_enum` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1122 + | MissingRequiredEnum,
|
1123 + | /// Constraint violation occurred building member `required_enum` when building `ErrorSerializationOperationInput`.
|
1124 + | #[doc(hidden)]
|
1125 + | RequiredEnum(crate::model::suit::ConstraintViolation),
|
857 1126 | }
|
858 1127 | impl ::std::fmt::Display for ConstraintViolation {
|
859 1128 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
860 1129 | match self {
|
861 - | ConstraintViolation::MissingInitialData => write!(f, "`initial_data` was not provided but it is required when building `StreamingOperationWithInitialDataInput`"),
|
862 - | ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `StreamingOperationWithInitialDataInput`"),
|
1130 + | ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `ErrorSerializationOperationInput`"),
|
1131 + | ConstraintViolation::MissingRequiredBlob => write!(f, "`required_blob` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1132 + | ConstraintViolation::MissingRequiredBoolean => write!(f, "`required_boolean` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1133 + | ConstraintViolation::MissingRequiredString => write!(f, "`required_string` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1134 + | ConstraintViolation::MissingRequiredByte => write!(f, "`required_byte` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1135 + | ConstraintViolation::MissingRequiredShort => write!(f, "`required_short` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1136 + | ConstraintViolation::MissingRequiredInteger => write!(f, "`required_integer` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1137 + | ConstraintViolation::MissingRequiredLong => write!(f, "`required_long` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1138 + | ConstraintViolation::MissingRequiredFloat => write!(f, "`required_float` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1139 + | ConstraintViolation::MissingRequiredDouble => write!(f, "`required_double` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1140 + | ConstraintViolation::MissingRequiredTimestamp => write!(f, "`required_timestamp` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1141 + | ConstraintViolation::MissingRequiredEnum => write!(f, "`required_enum` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1142 + | ConstraintViolation::RequiredEnum(_) => write!(f, "constraint violation occurred building member `required_enum` when building `ErrorSerializationOperationInput`"),
|
863 1143 | }
|
864 1144 | }
|
865 1145 | }
|
866 1146 | impl ::std::error::Error for ConstraintViolation {}
|
867 1147 | impl ConstraintViolation {
|
868 1148 | pub(crate) fn as_validation_exception_field(
|
869 1149 | self,
|
870 1150 | path: ::std::string::String,
|
871 1151 | ) -> crate::model::ValidationExceptionField {
|
872 1152 | match self {
|
873 - | ConstraintViolation::MissingInitialData => crate::model::ValidationExceptionField {
|
874 - | message: format!("Value at '{}/initialData' failed to satisfy constraint: Member must not be null", path),
|
875 - | path: path + "/initialData",
|
1153 + | ConstraintViolation::Enum(inner) => inner.as_validation_exception_field(path + "/enum"),
|
1154 + | ConstraintViolation::MissingRequiredBlob => crate::model::ValidationExceptionField {
|
1155 + | message: format!("Value at '{}/requiredBlob' failed to satisfy constraint: Member must not be null", path),
|
1156 + | path: path + "/requiredBlob",
|
876 1157 | },
|
877 - | ConstraintViolation::MissingEvents => crate::model::ValidationExceptionField {
|
878 - | message: format!("Value at '{}/events' failed to satisfy constraint: Member must not be null", path),
|
879 - | path: path + "/events",
|
1158 + | ConstraintViolation::MissingRequiredBoolean => crate::model::ValidationExceptionField {
|
1159 + | message: format!("Value at '{}/requiredBoolean' failed to satisfy constraint: Member must not be null", path),
|
1160 + | path: path + "/requiredBoolean",
|
1161 + | },
|
1162 + | ConstraintViolation::MissingRequiredString => crate::model::ValidationExceptionField {
|
1163 + | message: format!("Value at '{}/requiredString' failed to satisfy constraint: Member must not be null", path),
|
1164 + | path: path + "/requiredString",
|
1165 + | },
|
1166 + | ConstraintViolation::MissingRequiredByte => crate::model::ValidationExceptionField {
|
1167 + | message: format!("Value at '{}/requiredByte' failed to satisfy constraint: Member must not be null", path),
|
1168 + | path: path + "/requiredByte",
|
1169 + | },
|
1170 + | ConstraintViolation::MissingRequiredShort => crate::model::ValidationExceptionField {
|
1171 + | message: format!("Value at '{}/requiredShort' failed to satisfy constraint: Member must not be null", path),
|
1172 + | path: path + "/requiredShort",
|
1173 + | },
|
1174 + | ConstraintViolation::MissingRequiredInteger => crate::model::ValidationExceptionField {
|
1175 + | message: format!("Value at '{}/requiredInteger' failed to satisfy constraint: Member must not be null", path),
|
1176 + | path: path + "/requiredInteger",
|
1177 + | },
|
1178 + | ConstraintViolation::MissingRequiredLong => crate::model::ValidationExceptionField {
|
1179 + | message: format!("Value at '{}/requiredLong' failed to satisfy constraint: Member must not be null", path),
|
1180 + | path: path + "/requiredLong",
|
1181 + | },
|
1182 + | ConstraintViolation::MissingRequiredFloat => crate::model::ValidationExceptionField {
|
1183 + | message: format!("Value at '{}/requiredFloat' failed to satisfy constraint: Member must not be null", path),
|
1184 + | path: path + "/requiredFloat",
|
1185 + | },
|
1186 + | ConstraintViolation::MissingRequiredDouble => crate::model::ValidationExceptionField {
|
1187 + | message: format!("Value at '{}/requiredDouble' failed to satisfy constraint: Member must not be null", path),
|
1188 + | path: path + "/requiredDouble",
|
1189 + | },
|
1190 + | ConstraintViolation::MissingRequiredTimestamp => crate::model::ValidationExceptionField {
|
1191 + | message: format!("Value at '{}/requiredTimestamp' failed to satisfy constraint: Member must not be null", path),
|
1192 + | path: path + "/requiredTimestamp",
|
1193 + | },
|
1194 + | ConstraintViolation::MissingRequiredEnum => crate::model::ValidationExceptionField {
|
1195 + | message: format!("Value at '{}/requiredEnum' failed to satisfy constraint: Member must not be null", path),
|
1196 + | path: path + "/requiredEnum",
|
880 1197 | },
|
1198 + | ConstraintViolation::RequiredEnum(inner) => inner.as_validation_exception_field(path + "/requiredEnum"),
|
881 1199 | }
|
882 1200 | }
|
883 1201 | }
|
884 1202 | impl ::std::convert::From<ConstraintViolation>
|
885 1203 | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
886 1204 | {
|
887 1205 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
888 1206 | let first_validation_exception_field =
|
889 1207 | constraint_violation.as_validation_exception_field("".to_owned());
|
890 1208 | let validation_exception = crate::error::ValidationException {
|
891 1209 | message: format!(
|
892 1210 | "1 validation error detected. {}",
|
893 1211 | &first_validation_exception_field.message
|
894 1212 | ),
|
895 1213 | field_list: Some(vec![first_validation_exception_field]),
|
896 1214 | };
|
897 1215 | Self::ConstraintViolation(
|
898 1216 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
899 1217 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
900 1218 | )
|
901 1219 | }
|
902 1220 | }
|
903 1221 | impl ::std::convert::From<Builder>
|
904 - | for crate::constrained::MaybeConstrained<
|
905 - | crate::input::StreamingOperationWithInitialDataInput,
|
906 - | >
|
1222 + | for crate::constrained::MaybeConstrained<crate::input::ErrorSerializationOperationInput>
|
907 1223 | {
|
908 1224 | fn from(builder: Builder) -> Self {
|
909 1225 | Self::Unconstrained(builder)
|
910 1226 | }
|
911 1227 | }
|
912 - | impl ::std::convert::TryFrom<Builder> for crate::input::StreamingOperationWithInitialDataInput {
|
1228 + | impl ::std::convert::TryFrom<Builder> for crate::input::ErrorSerializationOperationInput {
|
913 1229 | type Error = ConstraintViolation;
|
914 1230 |
|
915 1231 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
916 1232 | builder.build()
|
917 1233 | }
|
918 1234 | }
|
919 - | /// A builder for [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
|
920 - | #[derive(::std::default::Default, ::std::fmt::Debug)]
|
1235 + | /// A builder for [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput).
|
1236 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
921 1237 | pub struct Builder {
|
922 - | pub(crate) initial_data: ::std::option::Option<::std::string::String>,
|
923 - | pub(crate) events: ::std::option::Option<
|
924 - | crate::sigv4_event_stream::SigV4Receiver<
|
925 - | crate::model::Events,
|
926 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
927 - | >,
|
928 - | >,
|
1238 + | pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
1239 + | pub(crate) boolean: ::std::option::Option<bool>,
|
1240 + | pub(crate) string: ::std::option::Option<::std::string::String>,
|
1241 + | pub(crate) byte: ::std::option::Option<i8>,
|
1242 + | pub(crate) short: ::std::option::Option<i16>,
|
1243 + | pub(crate) integer: ::std::option::Option<i32>,
|
1244 + | pub(crate) long: ::std::option::Option<i64>,
|
1245 + | pub(crate) float: ::std::option::Option<f32>,
|
1246 + | pub(crate) double: ::std::option::Option<f64>,
|
1247 + | pub(crate) timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1248 + | pub(crate) r#enum:
|
1249 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
1250 + | pub(crate) required_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
1251 + | pub(crate) required_boolean: ::std::option::Option<bool>,
|
1252 + | pub(crate) required_string: ::std::option::Option<::std::string::String>,
|
1253 + | pub(crate) required_byte: ::std::option::Option<i8>,
|
1254 + | pub(crate) required_short: ::std::option::Option<i16>,
|
1255 + | pub(crate) required_integer: ::std::option::Option<i32>,
|
1256 + | pub(crate) required_long: ::std::option::Option<i64>,
|
1257 + | pub(crate) required_float: ::std::option::Option<f32>,
|
1258 + | pub(crate) required_double: ::std::option::Option<f64>,
|
1259 + | pub(crate) required_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1260 + | pub(crate) required_enum:
|
1261 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
929 1262 | }
|
930 1263 | impl Builder {
|
931 1264 | #[allow(missing_docs)] // documentation missing in model
|
932 - | pub fn initial_data(mut self, input: ::std::string::String) -> Self {
|
933 - | self.initial_data = Some(input);
|
1265 + | pub fn blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
|
1266 + | self.blob = input;
|
934 1267 | self
|
935 1268 | }
|
936 1269 | #[allow(missing_docs)] // documentation missing in model
|
937 - | pub(crate) fn set_initial_data(
|
1270 + | pub(crate) fn set_blob(
|
938 1271 | mut self,
|
939 - | input: impl ::std::convert::Into<::std::string::String>,
|
1272 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::Blob>>,
|
940 1273 | ) -> Self {
|
941 - | self.initial_data = Some(input.into());
|
1274 + | self.blob = input.map(|v| v.into());
|
942 1275 | self
|
943 1276 | }
|
944 1277 | #[allow(missing_docs)] // documentation missing in model
|
945 - | pub fn events(
|
946 - | mut self,
|
947 - | input: crate::sigv4_event_stream::SigV4Receiver<
|
948 - | crate::model::Events,
|
949 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
950 - | >,
|
951 - | ) -> Self {
|
952 - | self.events = Some(input);
|
1278 + | pub fn boolean(mut self, input: ::std::option::Option<bool>) -> Self {
|
1279 + | self.boolean = input;
|
953 1280 | self
|
954 1281 | }
|
955 1282 | #[allow(missing_docs)] // documentation missing in model
|
956 - | pub(crate) fn set_events(
|
1283 + | pub(crate) fn set_boolean(
|
957 1284 | mut self,
|
958 - | input: impl ::std::convert::Into<
|
959 - | crate::sigv4_event_stream::SigV4Receiver<
|
960 - | crate::model::Events,
|
961 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
962 - | >,
|
963 - | >,
|
1285 + | input: Option<impl ::std::convert::Into<bool>>,
|
964 1286 | ) -> Self {
|
965 - | self.events = Some(input.into());
|
1287 + | self.boolean = input.map(|v| v.into());
|
966 1288 | self
|
967 1289 | }
|
968 - | /// Consumes the builder and constructs a [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
|
969 - | ///
|
970 - | /// The builder fails to construct a [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput) if a [`ConstraintViolation`] occurs.
|
971 - | ///
|
972 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
973 - | pub fn build(
|
974 - | self,
|
975 - | ) -> Result<crate::input::StreamingOperationWithInitialDataInput, ConstraintViolation>
|
976 - | {
|
977 - | self.build_enforcing_all_constraints()
|
978 - | }
|
979 - | fn build_enforcing_all_constraints(
|
980 - | self,
|
981 - | ) -> Result<crate::input::StreamingOperationWithInitialDataInput, ConstraintViolation>
|
982 - | {
|
983 - | Ok(crate::input::StreamingOperationWithInitialDataInput {
|
984 - | initial_data: self
|
985 - | .initial_data
|
986 - | .ok_or(ConstraintViolation::MissingInitialData)?,
|
987 - | events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
|
988 - | })
|
989 - | }
|
990 - | }
|
991 - | }
|
992 - | /// See [`StreamingOperationInput`](crate::input::StreamingOperationInput).
|
993 - | pub mod streaming_operation_input {
|
994 - |
|
995 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
996 - | /// Holds one variant for each of the ways the builder can fail.
|
997 - | #[non_exhaustive]
|
998 - | #[allow(clippy::enum_variant_names)]
|
999 - | pub enum ConstraintViolation {
|
1000 - | /// `events` was not provided but it is required when building `StreamingOperationInput`.
|
1001 - | MissingEvents,
|
1290 + | #[allow(missing_docs)] // documentation missing in model
|
1291 + | pub fn string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1292 + | self.string = input;
|
1293 + | self
|
1002 1294 | }
|
1003 - | impl ::std::fmt::Display for ConstraintViolation {
|
1004 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1005 - | match self {
|
1006 - | ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `StreamingOperationInput`"),
|
1295 + | #[allow(missing_docs)] // documentation missing in model
|
1296 + | pub(crate) fn set_string(
|
1297 + | mut self,
|
1298 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1299 + | ) -> Self {
|
1300 + | self.string = input.map(|v| v.into());
|
1301 + | self
|
1007 1302 | }
|
1303 + | #[allow(missing_docs)] // documentation missing in model
|
1304 + | pub fn byte(mut self, input: ::std::option::Option<i8>) -> Self {
|
1305 + | self.byte = input;
|
1306 + | self
|
1008 1307 | }
|
1308 + | #[allow(missing_docs)] // documentation missing in model
|
1309 + | pub(crate) fn set_byte(mut self, input: Option<impl ::std::convert::Into<i8>>) -> Self {
|
1310 + | self.byte = input.map(|v| v.into());
|
1311 + | self
|
1009 1312 | }
|
1010 - | impl ::std::error::Error for ConstraintViolation {}
|
1011 - | impl ConstraintViolation {
|
1012 - | pub(crate) fn as_validation_exception_field(
|
1013 - | self,
|
1014 - | path: ::std::string::String,
|
1015 - | ) -> crate::model::ValidationExceptionField {
|
1016 - | match self {
|
1017 - | ConstraintViolation::MissingEvents => crate::model::ValidationExceptionField {
|
1018 - | message: format!("Value at '{}/events' failed to satisfy constraint: Member must not be null", path),
|
1019 - | path: path + "/events",
|
1020 - | },
|
1313 + | #[allow(missing_docs)] // documentation missing in model
|
1314 + | pub fn short(mut self, input: ::std::option::Option<i16>) -> Self {
|
1315 + | self.short = input;
|
1316 + | self
|
1021 1317 | }
|
1318 + | #[allow(missing_docs)] // documentation missing in model
|
1319 + | pub(crate) fn set_short(mut self, input: Option<impl ::std::convert::Into<i16>>) -> Self {
|
1320 + | self.short = input.map(|v| v.into());
|
1321 + | self
|
1022 1322 | }
|
1323 + | #[allow(missing_docs)] // documentation missing in model
|
1324 + | pub fn integer(mut self, input: ::std::option::Option<i32>) -> Self {
|
1325 + | self.integer = input;
|
1326 + | self
|
1023 1327 | }
|
1024 - | impl ::std::convert::From<ConstraintViolation>
|
1025 - | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
1026 - | {
|
1027 - | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1028 - | let first_validation_exception_field =
|
1029 - | constraint_violation.as_validation_exception_field("".to_owned());
|
1030 - | let validation_exception = crate::error::ValidationException {
|
1031 - | message: format!(
|
1032 - | "1 validation error detected. {}",
|
1033 - | &first_validation_exception_field.message
|
1034 - | ),
|
1035 - | field_list: Some(vec![first_validation_exception_field]),
|
1036 - | };
|
1037 - | Self::ConstraintViolation(
|
1038 - | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1039 - | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1040 - | )
|
1328 + | #[allow(missing_docs)] // documentation missing in model
|
1329 + | pub(crate) fn set_integer(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
1330 + | self.integer = input.map(|v| v.into());
|
1331 + | self
|
1041 1332 | }
|
1333 + | #[allow(missing_docs)] // documentation missing in model
|
1334 + | pub fn long(mut self, input: ::std::option::Option<i64>) -> Self {
|
1335 + | self.long = input;
|
1336 + | self
|
1042 1337 | }
|
1043 - | impl ::std::convert::From<Builder>
|
1044 - | for crate::constrained::MaybeConstrained<crate::input::StreamingOperationInput>
|
1045 - | {
|
1046 - | fn from(builder: Builder) -> Self {
|
1047 - | Self::Unconstrained(builder)
|
1338 + | #[allow(missing_docs)] // documentation missing in model
|
1339 + | pub(crate) fn set_long(mut self, input: Option<impl ::std::convert::Into<i64>>) -> Self {
|
1340 + | self.long = input.map(|v| v.into());
|
1341 + | self
|
1048 1342 | }
|
1343 + | #[allow(missing_docs)] // documentation missing in model
|
1344 + | pub fn float(mut self, input: ::std::option::Option<f32>) -> Self {
|
1345 + | self.float = input;
|
1346 + | self
|
1049 1347 | }
|
1050 - | impl ::std::convert::TryFrom<Builder> for crate::input::StreamingOperationInput {
|
1051 - | type Error = ConstraintViolation;
|
1052 - |
|
1053 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1054 - | builder.build()
|
1348 + | #[allow(missing_docs)] // documentation missing in model
|
1349 + | pub(crate) fn set_float(mut self, input: Option<impl ::std::convert::Into<f32>>) -> Self {
|
1350 + | self.float = input.map(|v| v.into());
|
1351 + | self
|
1055 1352 | }
|
1353 + | #[allow(missing_docs)] // documentation missing in model
|
1354 + | pub fn double(mut self, input: ::std::option::Option<f64>) -> Self {
|
1355 + | self.double = input;
|
1356 + | self
|
1056 1357 | }
|
1057 - | /// A builder for [`StreamingOperationInput`](crate::input::StreamingOperationInput).
|
1058 - | #[derive(::std::default::Default, ::std::fmt::Debug)]
|
1059 - | pub struct Builder {
|
1060 - | pub(crate) events: ::std::option::Option<
|
1061 - | crate::sigv4_event_stream::SigV4Receiver<
|
1062 - | crate::model::Events,
|
1063 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
1064 - | >,
|
1065 - | >,
|
1358 + | #[allow(missing_docs)] // documentation missing in model
|
1359 + | pub(crate) fn set_double(mut self, input: Option<impl ::std::convert::Into<f64>>) -> Self {
|
1360 + | self.double = input.map(|v| v.into());
|
1361 + | self
|
1066 1362 | }
|
1067 - | impl Builder {
|
1068 1363 | #[allow(missing_docs)] // documentation missing in model
|
1069 - | pub fn events(
|
1364 + | pub fn timestamp(
|
1070 1365 | mut self,
|
1071 - | input: crate::sigv4_event_stream::SigV4Receiver<
|
1072 - | crate::model::Events,
|
1073 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
1074 - | >,
|
1366 + | input: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1075 1367 | ) -> Self {
|
1076 - | self.events = Some(input);
|
1368 + | self.timestamp = input;
|
1077 1369 | self
|
1078 1370 | }
|
1079 1371 | #[allow(missing_docs)] // documentation missing in model
|
1080 - | pub(crate) fn set_events(
|
1372 + | pub(crate) fn set_timestamp(
|
1081 1373 | mut self,
|
1082 - | input: impl ::std::convert::Into<
|
1083 - | crate::sigv4_event_stream::SigV4Receiver<
|
1084 - | crate::model::Events,
|
1085 - | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
1086 - | >,
|
1087 - | >,
|
1374 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::DateTime>>,
|
1088 1375 | ) -> Self {
|
1089 - | self.events = Some(input.into());
|
1376 + | self.timestamp = input.map(|v| v.into());
|
1090 1377 | self
|
1091 1378 | }
|
1092 - | /// Consumes the builder and constructs a [`StreamingOperationInput`](crate::input::StreamingOperationInput).
|
1093 - | ///
|
1094 - | /// The builder fails to construct a [`StreamingOperationInput`](crate::input::StreamingOperationInput) if a [`ConstraintViolation`] occurs.
|
1095 - | ///
|
1096 - | pub fn build(self) -> Result<crate::input::StreamingOperationInput, ConstraintViolation> {
|
1097 - | self.build_enforcing_all_constraints()
|
1098 - | }
|
1099 - | fn build_enforcing_all_constraints(
|
1100 - | self,
|
1101 - | ) -> Result<crate::input::StreamingOperationInput, ConstraintViolation> {
|
1102 - | Ok(crate::input::StreamingOperationInput {
|
1103 - | events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
|
1104 - | })
|
1379 + | #[allow(missing_docs)] // documentation missing in model
|
1380 + | pub fn r#enum(mut self, input: ::std::option::Option<crate::model::Suit>) -> Self {
|
1381 + | self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1382 + | self
|
1105 1383 | }
|
1384 + | #[allow(missing_docs)] // documentation missing in model
|
1385 + | pub(crate) fn set_enum(
|
1386 + | mut self,
|
1387 + | input: Option<
|
1388 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
1389 + | >,
|
1390 + | ) -> Self {
|
1391 + | self.r#enum = input.map(|v| v.into());
|
1392 + | self
|
1106 1393 | }
|
1107 - | }
|
1108 - | /// See [`RecursiveUnionOperationInput`](crate::input::RecursiveUnionOperationInput).
|
1109 - | pub mod recursive_union_operation_input {
|
1110 - |
|
1111 - | impl ::std::convert::From<Builder> for crate::input::RecursiveUnionOperationInput {
|
1112 - | fn from(builder: Builder) -> Self {
|
1113 - | builder.build()
|
1394 + | #[allow(missing_docs)] // documentation missing in model
|
1395 + | pub fn required_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
|
1396 + | self.required_blob = Some(input);
|
1397 + | self
|
1114 1398 | }
|
1399 + | #[allow(missing_docs)] // documentation missing in model
|
1400 + | pub(crate) fn set_required_blob(
|
1401 + | mut self,
|
1402 + | input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
|
1403 + | ) -> Self {
|
1404 + | self.required_blob = Some(input.into());
|
1405 + | self
|
1115 1406 | }
|
1116 - | /// A builder for [`RecursiveUnionOperationInput`](crate::input::RecursiveUnionOperationInput).
|
1117 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1118 - | pub struct Builder {
|
1119 - | pub(crate) nested:
|
1120 - | ::std::option::Option<crate::model::RecursiveOperationInputOutputNested1>,
|
1407 + | #[allow(missing_docs)] // documentation missing in model
|
1408 + | pub fn required_boolean(mut self, input: bool) -> Self {
|
1409 + | self.required_boolean = Some(input);
|
1410 + | self
|
1121 1411 | }
|
1122 - | impl Builder {
|
1123 1412 | #[allow(missing_docs)] // documentation missing in model
|
1124 - | pub fn nested(
|
1413 + | pub(crate) fn set_required_boolean(
|
1125 1414 | mut self,
|
1126 - | input: ::std::option::Option<crate::model::RecursiveOperationInputOutputNested1>,
|
1415 + | input: impl ::std::convert::Into<bool>,
|
1127 1416 | ) -> Self {
|
1128 - | self.nested = input;
|
1417 + | self.required_boolean = Some(input.into());
|
1129 1418 | self
|
1130 1419 | }
|
1131 1420 | #[allow(missing_docs)] // documentation missing in model
|
1132 - | pub(crate) fn set_nested(
|
1421 + | pub fn required_string(mut self, input: ::std::string::String) -> Self {
|
1422 + | self.required_string = Some(input);
|
1423 + | self
|
1424 + | }
|
1425 + | #[allow(missing_docs)] // documentation missing in model
|
1426 + | pub(crate) fn set_required_string(
|
1133 1427 | mut self,
|
1134 - | input: Option<
|
1135 - | impl ::std::convert::Into<crate::model::RecursiveOperationInputOutputNested1>,
|
1136 - | >,
|
1428 + | input: impl ::std::convert::Into<::std::string::String>,
|
1137 1429 | ) -> Self {
|
1138 - | self.nested = input.map(|v| v.into());
|
1430 + | self.required_string = Some(input.into());
|
1139 1431 | self
|
1140 1432 | }
|
1141 - | /// Consumes the builder and constructs a [`RecursiveUnionOperationInput`](crate::input::RecursiveUnionOperationInput).
|
1142 - | pub fn build(self) -> crate::input::RecursiveUnionOperationInput {
|
1143 - | self.build_enforcing_all_constraints()
|
1433 + | #[allow(missing_docs)] // documentation missing in model
|
1434 + | pub fn required_byte(mut self, input: i8) -> Self {
|
1435 + | self.required_byte = Some(input);
|
1436 + | self
|
1144 1437 | }
|
1145 - | fn build_enforcing_all_constraints(self) -> crate::input::RecursiveUnionOperationInput {
|
1146 - | crate::input::RecursiveUnionOperationInput {
|
1147 - | nested: self.nested,
|
1438 + | #[allow(missing_docs)] // documentation missing in model
|
1439 + | pub(crate) fn set_required_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
|
1440 + | self.required_byte = Some(input.into());
|
1441 + | self
|
1148 1442 | }
|
1443 + | #[allow(missing_docs)] // documentation missing in model
|
1444 + | pub fn required_short(mut self, input: i16) -> Self {
|
1445 + | self.required_short = Some(input);
|
1446 + | self
|
1149 1447 | }
|
1448 + | #[allow(missing_docs)] // documentation missing in model
|
1449 + | pub(crate) fn set_required_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
|
1450 + | self.required_short = Some(input.into());
|
1451 + | self
|
1150 1452 | }
|
1151 - | }
|
1152 - | /// See [`SingleMemberStructOperationInput`](crate::input::SingleMemberStructOperationInput).
|
1153 - | pub mod single_member_struct_operation_input {
|
1154 - |
|
1155 - | impl ::std::convert::From<Builder> for crate::input::SingleMemberStructOperationInput {
|
1156 - | fn from(builder: Builder) -> Self {
|
1157 - | builder.build()
|
1453 + | #[allow(missing_docs)] // documentation missing in model
|
1454 + | pub fn required_integer(mut self, input: i32) -> Self {
|
1455 + | self.required_integer = Some(input);
|
1456 + | self
|
1158 1457 | }
|
1458 + | #[allow(missing_docs)] // documentation missing in model
|
1459 + | pub(crate) fn set_required_integer(
|
1460 + | mut self,
|
1461 + | input: impl ::std::convert::Into<i32>,
|
1462 + | ) -> Self {
|
1463 + | self.required_integer = Some(input.into());
|
1464 + | self
|
1159 1465 | }
|
1160 - | /// A builder for [`SingleMemberStructOperationInput`](crate::input::SingleMemberStructOperationInput).
|
1161 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1162 - | pub struct Builder {
|
1163 - | pub(crate) message: ::std::option::Option<::std::string::String>,
|
1466 + | #[allow(missing_docs)] // documentation missing in model
|
1467 + | pub fn required_long(mut self, input: i64) -> Self {
|
1468 + | self.required_long = Some(input);
|
1469 + | self
|
1164 1470 | }
|
1165 - | impl Builder {
|
1166 1471 | #[allow(missing_docs)] // documentation missing in model
|
1167 - | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1168 - | self.message = input;
|
1472 + | pub(crate) fn set_required_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
|
1473 + | self.required_long = Some(input.into());
|
1169 1474 | self
|
1170 1475 | }
|
1171 1476 | #[allow(missing_docs)] // documentation missing in model
|
1172 - | pub(crate) fn set_message(
|
1173 - | mut self,
|
1174 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1175 - | ) -> Self {
|
1176 - | self.message = input.map(|v| v.into());
|
1477 + | pub fn required_float(mut self, input: f32) -> Self {
|
1478 + | self.required_float = Some(input);
|
1177 1479 | self
|
1178 1480 | }
|
1179 - | /// Consumes the builder and constructs a [`SingleMemberStructOperationInput`](crate::input::SingleMemberStructOperationInput).
|
1180 - | pub fn build(self) -> crate::input::SingleMemberStructOperationInput {
|
1181 - | self.build_enforcing_all_constraints()
|
1481 + | #[allow(missing_docs)] // documentation missing in model
|
1482 + | pub(crate) fn set_required_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
|
1483 + | self.required_float = Some(input.into());
|
1484 + | self
|
1182 1485 | }
|
1183 - | fn build_enforcing_all_constraints(self) -> crate::input::SingleMemberStructOperationInput {
|
1184 - | crate::input::SingleMemberStructOperationInput {
|
1185 - | message: self.message,
|
1486 + | #[allow(missing_docs)] // documentation missing in model
|
1487 + | pub fn required_double(mut self, input: f64) -> Self {
|
1488 + | self.required_double = Some(input);
|
1489 + | self
|
1186 1490 | }
|
1491 + | #[allow(missing_docs)] // documentation missing in model
|
1492 + | pub(crate) fn set_required_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
|
1493 + | self.required_double = Some(input.into());
|
1494 + | self
|
1187 1495 | }
|
1496 + | #[allow(missing_docs)] // documentation missing in model
|
1497 + | pub fn required_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
|
1498 + | self.required_timestamp = Some(input);
|
1499 + | self
|
1188 1500 | }
|
1189 - | }
|
1190 - | /// See [`EmptyStructOperationInput`](crate::input::EmptyStructOperationInput).
|
1191 - | pub mod empty_struct_operation_input {
|
1192 - |
|
1193 - | impl ::std::convert::From<Builder> for crate::input::EmptyStructOperationInput {
|
1194 - | fn from(builder: Builder) -> Self {
|
1195 - | builder.build()
|
1501 + | #[allow(missing_docs)] // documentation missing in model
|
1502 + | pub(crate) fn set_required_timestamp(
|
1503 + | mut self,
|
1504 + | input: impl ::std::convert::Into<::aws_smithy_types::DateTime>,
|
1505 + | ) -> Self {
|
1506 + | self.required_timestamp = Some(input.into());
|
1507 + | self
|
1196 1508 | }
|
1509 + | #[allow(missing_docs)] // documentation missing in model
|
1510 + | pub fn required_enum(mut self, input: crate::model::Suit) -> Self {
|
1511 + | self.required_enum = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
1512 + | self
|
1197 1513 | }
|
1198 - | /// A builder for [`EmptyStructOperationInput`](crate::input::EmptyStructOperationInput).
|
1199 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1200 - | pub struct Builder {}
|
1201 - | impl Builder {
|
1202 - | /// Consumes the builder and constructs a [`EmptyStructOperationInput`](crate::input::EmptyStructOperationInput).
|
1203 - | pub fn build(self) -> crate::input::EmptyStructOperationInput {
|
1514 + | #[allow(missing_docs)] // documentation missing in model
|
1515 + | pub(crate) fn set_required_enum(
|
1516 + | mut self,
|
1517 + | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
1518 + | ) -> Self {
|
1519 + | self.required_enum = Some(input.into());
|
1520 + | self
|
1521 + | }
|
1522 + | /// Consumes the builder and constructs a [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput).
|
1523 + | ///
|
1524 + | /// The builder fails to construct a [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput) if a [`ConstraintViolation`] occurs.
|
1525 + | ///
|
1526 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1527 + | pub fn build(
|
1528 + | self,
|
1529 + | ) -> Result<crate::input::ErrorSerializationOperationInput, ConstraintViolation> {
|
1204 1530 | self.build_enforcing_all_constraints()
|
1205 1531 | }
|
1206 - | fn build_enforcing_all_constraints(self) -> crate::input::EmptyStructOperationInput {
|
1207 - | crate::input::EmptyStructOperationInput {}
|
1532 + | fn build_enforcing_all_constraints(
|
1533 + | self,
|
1534 + | ) -> Result<crate::input::ErrorSerializationOperationInput, ConstraintViolation> {
|
1535 + | Ok(crate::input::ErrorSerializationOperationInput {
|
1536 + | blob: self.blob,
|
1537 + | boolean: self.boolean,
|
1538 + | string: self.string,
|
1539 + | byte: self.byte,
|
1540 + | short: self.short,
|
1541 + | integer: self.integer,
|
1542 + | long: self.long,
|
1543 + | float: self.float,
|
1544 + | double: self.double,
|
1545 + | timestamp: self.timestamp,
|
1546 + | r#enum: self
|
1547 + | .r#enum
|
1548 + | .map(|v| match v {
|
1549 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1550 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1551 + | })
|
1552 + | .map(|res| res.map_err(ConstraintViolation::Enum))
|
1553 + | .transpose()?,
|
1554 + | required_blob: self
|
1555 + | .required_blob
|
1556 + | .ok_or(ConstraintViolation::MissingRequiredBlob)?,
|
1557 + | required_boolean: self
|
1558 + | .required_boolean
|
1559 + | .ok_or(ConstraintViolation::MissingRequiredBoolean)?,
|
1560 + | required_string: self
|
1561 + | .required_string
|
1562 + | .ok_or(ConstraintViolation::MissingRequiredString)?,
|
1563 + | required_byte: self
|
1564 + | .required_byte
|
1565 + | .ok_or(ConstraintViolation::MissingRequiredByte)?,
|
1566 + | required_short: self
|
1567 + | .required_short
|
1568 + | .ok_or(ConstraintViolation::MissingRequiredShort)?,
|
1569 + | required_integer: self
|
1570 + | .required_integer
|
1571 + | .ok_or(ConstraintViolation::MissingRequiredInteger)?,
|
1572 + | required_long: self
|
1573 + | .required_long
|
1574 + | .ok_or(ConstraintViolation::MissingRequiredLong)?,
|
1575 + | required_float: self
|
1576 + | .required_float
|
1577 + | .ok_or(ConstraintViolation::MissingRequiredFloat)?,
|
1578 + | required_double: self
|
1579 + | .required_double
|
1580 + | .ok_or(ConstraintViolation::MissingRequiredDouble)?,
|
1581 + | required_timestamp: self
|
1582 + | .required_timestamp
|
1583 + | .ok_or(ConstraintViolation::MissingRequiredTimestamp)?,
|
1584 + | required_enum: self
|
1585 + | .required_enum
|
1586 + | .map(|v| match v {
|
1587 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1588 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1589 + | })
|
1590 + | .map(|res| res.map_err(ConstraintViolation::RequiredEnum))
|
1591 + | .transpose()?
|
1592 + | .ok_or(ConstraintViolation::MissingRequiredEnum)?,
|
1593 + | })
|
1208 1594 | }
|
1209 1595 | }
|
1210 1596 | }
|
1211 1597 | /// See [`ComplexStructOperationInput`](crate::input::ComplexStructOperationInput).
|
1212 1598 | pub mod complex_struct_operation_input {
|
1213 1599 |
|
1214 1600 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1215 1601 | /// Holds one variant for each of the ways the builder can fail.
|
1216 1602 | #[non_exhaustive]
|
1217 1603 | #[allow(clippy::enum_variant_names)]
|
1602 1988 | .map(|res| {
|
1603 1989 | res.map_err(Box::new)
|
1604 1990 | .map_err(ConstraintViolation::ComplexUnion)
|
1605 1991 | })
|
1606 1992 | .transpose()?
|
1607 1993 | .ok_or(ConstraintViolation::MissingComplexUnion)?,
|
1608 1994 | })
|
1609 1995 | }
|
1610 1996 | }
|
1611 1997 | }
|
1612 - | /// See [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput).
|
1613 - | pub mod error_serialization_operation_input {
|
1998 + | /// See [`EmptyStructOperationInput`](crate::input::EmptyStructOperationInput).
|
1999 + | pub mod empty_struct_operation_input {
|
2000 + |
|
2001 + | impl ::std::convert::From<Builder> for crate::input::EmptyStructOperationInput {
|
2002 + | fn from(builder: Builder) -> Self {
|
2003 + | builder.build()
|
2004 + | }
|
2005 + | }
|
2006 + | /// A builder for [`EmptyStructOperationInput`](crate::input::EmptyStructOperationInput).
|
2007 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2008 + | pub struct Builder {}
|
2009 + | impl Builder {
|
2010 + | /// Consumes the builder and constructs a [`EmptyStructOperationInput`](crate::input::EmptyStructOperationInput).
|
2011 + | pub fn build(self) -> crate::input::EmptyStructOperationInput {
|
2012 + | self.build_enforcing_all_constraints()
|
2013 + | }
|
2014 + | fn build_enforcing_all_constraints(self) -> crate::input::EmptyStructOperationInput {
|
2015 + | crate::input::EmptyStructOperationInput {}
|
2016 + | }
|
2017 + | }
|
2018 + | }
|
2019 + | /// See [`SingleMemberStructOperationInput`](crate::input::SingleMemberStructOperationInput).
|
2020 + | pub mod single_member_struct_operation_input {
|
2021 + |
|
2022 + | impl ::std::convert::From<Builder> for crate::input::SingleMemberStructOperationInput {
|
2023 + | fn from(builder: Builder) -> Self {
|
2024 + | builder.build()
|
2025 + | }
|
2026 + | }
|
2027 + | /// A builder for [`SingleMemberStructOperationInput`](crate::input::SingleMemberStructOperationInput).
|
2028 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2029 + | pub struct Builder {
|
2030 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
2031 + | }
|
2032 + | impl Builder {
|
2033 + | #[allow(missing_docs)] // documentation missing in model
|
2034 + | pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
2035 + | self.message = input;
|
2036 + | self
|
2037 + | }
|
2038 + | #[allow(missing_docs)] // documentation missing in model
|
2039 + | pub(crate) fn set_message(
|
2040 + | mut self,
|
2041 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
2042 + | ) -> Self {
|
2043 + | self.message = input.map(|v| v.into());
|
2044 + | self
|
2045 + | }
|
2046 + | /// Consumes the builder and constructs a [`SingleMemberStructOperationInput`](crate::input::SingleMemberStructOperationInput).
|
2047 + | pub fn build(self) -> crate::input::SingleMemberStructOperationInput {
|
2048 + | self.build_enforcing_all_constraints()
|
2049 + | }
|
2050 + | fn build_enforcing_all_constraints(self) -> crate::input::SingleMemberStructOperationInput {
|
2051 + | crate::input::SingleMemberStructOperationInput {
|
2052 + | message: self.message,
|
2053 + | }
|
2054 + | }
|
2055 + | }
|
2056 + | }
|
2057 + | /// See [`RecursiveUnionOperationInput`](crate::input::RecursiveUnionOperationInput).
|
2058 + | pub mod recursive_union_operation_input {
|
2059 + |
|
2060 + | impl ::std::convert::From<Builder> for crate::input::RecursiveUnionOperationInput {
|
2061 + | fn from(builder: Builder) -> Self {
|
2062 + | builder.build()
|
2063 + | }
|
2064 + | }
|
2065 + | /// A builder for [`RecursiveUnionOperationInput`](crate::input::RecursiveUnionOperationInput).
|
2066 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2067 + | pub struct Builder {
|
2068 + | pub(crate) nested:
|
2069 + | ::std::option::Option<crate::model::RecursiveOperationInputOutputNested1>,
|
2070 + | }
|
2071 + | impl Builder {
|
2072 + | #[allow(missing_docs)] // documentation missing in model
|
2073 + | pub fn nested(
|
2074 + | mut self,
|
2075 + | input: ::std::option::Option<crate::model::RecursiveOperationInputOutputNested1>,
|
2076 + | ) -> Self {
|
2077 + | self.nested = input;
|
2078 + | self
|
2079 + | }
|
2080 + | #[allow(missing_docs)] // documentation missing in model
|
2081 + | pub(crate) fn set_nested(
|
2082 + | mut self,
|
2083 + | input: Option<
|
2084 + | impl ::std::convert::Into<crate::model::RecursiveOperationInputOutputNested1>,
|
2085 + | >,
|
2086 + | ) -> Self {
|
2087 + | self.nested = input.map(|v| v.into());
|
2088 + | self
|
2089 + | }
|
2090 + | /// Consumes the builder and constructs a [`RecursiveUnionOperationInput`](crate::input::RecursiveUnionOperationInput).
|
2091 + | pub fn build(self) -> crate::input::RecursiveUnionOperationInput {
|
2092 + | self.build_enforcing_all_constraints()
|
2093 + | }
|
2094 + | fn build_enforcing_all_constraints(self) -> crate::input::RecursiveUnionOperationInput {
|
2095 + | crate::input::RecursiveUnionOperationInput {
|
2096 + | nested: self.nested,
|
2097 + | }
|
2098 + | }
|
2099 + | }
|
2100 + | }
|
2101 + | /// See [`StreamingOperationInput`](crate::input::StreamingOperationInput).
|
2102 + | pub mod streaming_operation_input {
|
1614 2103 |
|
1615 2104 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1616 2105 | /// Holds one variant for each of the ways the builder can fail.
|
1617 2106 | #[non_exhaustive]
|
1618 2107 | #[allow(clippy::enum_variant_names)]
|
1619 2108 | pub enum ConstraintViolation {
|
1620 - | /// Constraint violation occurred building member `r#enum` when building `ErrorSerializationOperationInput`.
|
1621 - | #[doc(hidden)]
|
1622 - | Enum(crate::model::suit::ConstraintViolation),
|
1623 - | /// `required_blob` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1624 - | MissingRequiredBlob,
|
1625 - | /// `required_boolean` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1626 - | MissingRequiredBoolean,
|
1627 - | /// `required_string` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1628 - | MissingRequiredString,
|
1629 - | /// `required_byte` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1630 - | MissingRequiredByte,
|
1631 - | /// `required_short` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1632 - | MissingRequiredShort,
|
1633 - | /// `required_integer` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1634 - | MissingRequiredInteger,
|
1635 - | /// `required_long` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1636 - | MissingRequiredLong,
|
1637 - | /// `required_float` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1638 - | MissingRequiredFloat,
|
1639 - | /// `required_double` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1640 - | MissingRequiredDouble,
|
1641 - | /// `required_timestamp` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1642 - | MissingRequiredTimestamp,
|
1643 - | /// `required_enum` was not provided but it is required when building `ErrorSerializationOperationInput`.
|
1644 - | MissingRequiredEnum,
|
1645 - | /// Constraint violation occurred building member `required_enum` when building `ErrorSerializationOperationInput`.
|
1646 - | #[doc(hidden)]
|
1647 - | RequiredEnum(crate::model::suit::ConstraintViolation),
|
2109 + | /// `events` was not provided but it is required when building `StreamingOperationInput`.
|
2110 + | MissingEvents,
|
1648 2111 | }
|
1649 2112 | impl ::std::fmt::Display for ConstraintViolation {
|
1650 2113 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1651 2114 | match self {
|
1652 - | ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `ErrorSerializationOperationInput`"),
|
1653 - | ConstraintViolation::MissingRequiredBlob => write!(f, "`required_blob` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1654 - | ConstraintViolation::MissingRequiredBoolean => write!(f, "`required_boolean` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1655 - | ConstraintViolation::MissingRequiredString => write!(f, "`required_string` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1656 - | ConstraintViolation::MissingRequiredByte => write!(f, "`required_byte` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1657 - | ConstraintViolation::MissingRequiredShort => write!(f, "`required_short` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1658 - | ConstraintViolation::MissingRequiredInteger => write!(f, "`required_integer` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1659 - | ConstraintViolation::MissingRequiredLong => write!(f, "`required_long` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1660 - | ConstraintViolation::MissingRequiredFloat => write!(f, "`required_float` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1661 - | ConstraintViolation::MissingRequiredDouble => write!(f, "`required_double` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1662 - | ConstraintViolation::MissingRequiredTimestamp => write!(f, "`required_timestamp` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1663 - | ConstraintViolation::MissingRequiredEnum => write!(f, "`required_enum` was not provided but it is required when building `ErrorSerializationOperationInput`"),
|
1664 - | ConstraintViolation::RequiredEnum(_) => write!(f, "constraint violation occurred building member `required_enum` when building `ErrorSerializationOperationInput`"),
|
1665 - | }
|
1666 - | }
|
2115 + | ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `StreamingOperationInput`"),
|
1667 2116 | }
|
1668 - | impl ::std::error::Error for ConstraintViolation {}
|
1669 - | impl ConstraintViolation {
|
1670 - | pub(crate) fn as_validation_exception_field(
|
1671 - | self,
|
1672 - | path: ::std::string::String,
|
1673 - | ) -> crate::model::ValidationExceptionField {
|
1674 - | match self {
|
1675 - | ConstraintViolation::Enum(inner) => inner.as_validation_exception_field(path + "/enum"),
|
1676 - | ConstraintViolation::MissingRequiredBlob => crate::model::ValidationExceptionField {
|
1677 - | message: format!("Value at '{}/requiredBlob' failed to satisfy constraint: Member must not be null", path),
|
1678 - | path: path + "/requiredBlob",
|
1679 - | },
|
1680 - | ConstraintViolation::MissingRequiredBoolean => crate::model::ValidationExceptionField {
|
1681 - | message: format!("Value at '{}/requiredBoolean' failed to satisfy constraint: Member must not be null", path),
|
1682 - | path: path + "/requiredBoolean",
|
1683 - | },
|
1684 - | ConstraintViolation::MissingRequiredString => crate::model::ValidationExceptionField {
|
1685 - | message: format!("Value at '{}/requiredString' failed to satisfy constraint: Member must not be null", path),
|
1686 - | path: path + "/requiredString",
|
1687 - | },
|
1688 - | ConstraintViolation::MissingRequiredByte => crate::model::ValidationExceptionField {
|
1689 - | message: format!("Value at '{}/requiredByte' failed to satisfy constraint: Member must not be null", path),
|
1690 - | path: path + "/requiredByte",
|
1691 - | },
|
1692 - | ConstraintViolation::MissingRequiredShort => crate::model::ValidationExceptionField {
|
1693 - | message: format!("Value at '{}/requiredShort' failed to satisfy constraint: Member must not be null", path),
|
1694 - | path: path + "/requiredShort",
|
1695 - | },
|
1696 - | ConstraintViolation::MissingRequiredInteger => crate::model::ValidationExceptionField {
|
1697 - | message: format!("Value at '{}/requiredInteger' failed to satisfy constraint: Member must not be null", path),
|
1698 - | path: path + "/requiredInteger",
|
1699 - | },
|
1700 - | ConstraintViolation::MissingRequiredLong => crate::model::ValidationExceptionField {
|
1701 - | message: format!("Value at '{}/requiredLong' failed to satisfy constraint: Member must not be null", path),
|
1702 - | path: path + "/requiredLong",
|
1703 - | },
|
1704 - | ConstraintViolation::MissingRequiredFloat => crate::model::ValidationExceptionField {
|
1705 - | message: format!("Value at '{}/requiredFloat' failed to satisfy constraint: Member must not be null", path),
|
1706 - | path: path + "/requiredFloat",
|
1707 - | },
|
1708 - | ConstraintViolation::MissingRequiredDouble => crate::model::ValidationExceptionField {
|
1709 - | message: format!("Value at '{}/requiredDouble' failed to satisfy constraint: Member must not be null", path),
|
1710 - | path: path + "/requiredDouble",
|
1711 - | },
|
1712 - | ConstraintViolation::MissingRequiredTimestamp => crate::model::ValidationExceptionField {
|
1713 - | message: format!("Value at '{}/requiredTimestamp' failed to satisfy constraint: Member must not be null", path),
|
1714 - | path: path + "/requiredTimestamp",
|
1715 - | },
|
1716 - | ConstraintViolation::MissingRequiredEnum => crate::model::ValidationExceptionField {
|
1717 - | message: format!("Value at '{}/requiredEnum' failed to satisfy constraint: Member must not be null", path),
|
1718 - | path: path + "/requiredEnum",
|
2117 + | }
|
2118 + | }
|
2119 + | impl ::std::error::Error for ConstraintViolation {}
|
2120 + | impl ConstraintViolation {
|
2121 + | pub(crate) fn as_validation_exception_field(
|
2122 + | self,
|
2123 + | path: ::std::string::String,
|
2124 + | ) -> crate::model::ValidationExceptionField {
|
2125 + | match self {
|
2126 + | ConstraintViolation::MissingEvents => crate::model::ValidationExceptionField {
|
2127 + | message: format!("Value at '{}/events' failed to satisfy constraint: Member must not be null", path),
|
2128 + | path: path + "/events",
|
1719 2129 | },
|
1720 - | ConstraintViolation::RequiredEnum(inner) => inner.as_validation_exception_field(path + "/requiredEnum"),
|
1721 2130 | }
|
1722 2131 | }
|
1723 2132 | }
|
1724 2133 | impl ::std::convert::From<ConstraintViolation>
|
1725 2134 | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
1726 2135 | {
|
1727 2136 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1728 2137 | let first_validation_exception_field =
|
1729 2138 | constraint_violation.as_validation_exception_field("".to_owned());
|
1730 2139 | let validation_exception = crate::error::ValidationException {
|
1731 2140 | message: format!(
|
1732 2141 | "1 validation error detected. {}",
|
1733 2142 | &first_validation_exception_field.message
|
1734 2143 | ),
|
1735 2144 | field_list: Some(vec![first_validation_exception_field]),
|
1736 2145 | };
|
1737 2146 | Self::ConstraintViolation(
|
1738 2147 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1739 2148 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1740 2149 | )
|
1741 2150 | }
|
1742 2151 | }
|
1743 2152 | impl ::std::convert::From<Builder>
|
1744 - | for crate::constrained::MaybeConstrained<crate::input::ErrorSerializationOperationInput>
|
2153 + | for crate::constrained::MaybeConstrained<crate::input::StreamingOperationInput>
|
1745 2154 | {
|
1746 2155 | fn from(builder: Builder) -> Self {
|
1747 2156 | Self::Unconstrained(builder)
|
1748 2157 | }
|
1749 2158 | }
|
1750 - | impl ::std::convert::TryFrom<Builder> for crate::input::ErrorSerializationOperationInput {
|
2159 + | impl ::std::convert::TryFrom<Builder> for crate::input::StreamingOperationInput {
|
1751 2160 | type Error = ConstraintViolation;
|
1752 2161 |
|
1753 2162 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1754 2163 | builder.build()
|
1755 2164 | }
|
1756 2165 | }
|
1757 - | /// A builder for [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput).
|
1758 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2166 + | /// A builder for [`StreamingOperationInput`](crate::input::StreamingOperationInput).
|
2167 + | #[derive(::std::default::Default, ::std::fmt::Debug)]
|
1759 2168 | pub struct Builder {
|
1760 - | pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
1761 - | pub(crate) boolean: ::std::option::Option<bool>,
|
1762 - | pub(crate) string: ::std::option::Option<::std::string::String>,
|
1763 - | pub(crate) byte: ::std::option::Option<i8>,
|
1764 - | pub(crate) short: ::std::option::Option<i16>,
|
1765 - | pub(crate) integer: ::std::option::Option<i32>,
|
1766 - | pub(crate) long: ::std::option::Option<i64>,
|
1767 - | pub(crate) float: ::std::option::Option<f32>,
|
1768 - | pub(crate) double: ::std::option::Option<f64>,
|
1769 - | pub(crate) timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1770 - | pub(crate) r#enum:
|
1771 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
1772 - | pub(crate) required_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
1773 - | pub(crate) required_boolean: ::std::option::Option<bool>,
|
1774 - | pub(crate) required_string: ::std::option::Option<::std::string::String>,
|
1775 - | pub(crate) required_byte: ::std::option::Option<i8>,
|
1776 - | pub(crate) required_short: ::std::option::Option<i16>,
|
1777 - | pub(crate) required_integer: ::std::option::Option<i32>,
|
1778 - | pub(crate) required_long: ::std::option::Option<i64>,
|
1779 - | pub(crate) required_float: ::std::option::Option<f32>,
|
1780 - | pub(crate) required_double: ::std::option::Option<f64>,
|
1781 - | pub(crate) required_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1782 - | pub(crate) required_enum:
|
1783 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
2169 + | pub(crate) events: ::std::option::Option<
|
2170 + | crate::sigv4_event_stream::SigV4Receiver<
|
2171 + | crate::model::Events,
|
2172 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
2173 + | >,
|
2174 + | >,
|
1784 2175 | }
|
1785 2176 | impl Builder {
|
1786 2177 | #[allow(missing_docs)] // documentation missing in model
|
1787 - | pub fn blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
|
1788 - | self.blob = input;
|
1789 - | self
|
1790 - | }
|
1791 - | #[allow(missing_docs)] // documentation missing in model
|
1792 - | pub(crate) fn set_blob(
|
1793 - | mut self,
|
1794 - | input: Option<impl ::std::convert::Into<::aws_smithy_types::Blob>>,
|
1795 - | ) -> Self {
|
1796 - | self.blob = input.map(|v| v.into());
|
1797 - | self
|
1798 - | }
|
1799 - | #[allow(missing_docs)] // documentation missing in model
|
1800 - | pub fn boolean(mut self, input: ::std::option::Option<bool>) -> Self {
|
1801 - | self.boolean = input;
|
1802 - | self
|
1803 - | }
|
1804 - | #[allow(missing_docs)] // documentation missing in model
|
1805 - | pub(crate) fn set_boolean(
|
1806 - | mut self,
|
1807 - | input: Option<impl ::std::convert::Into<bool>>,
|
1808 - | ) -> Self {
|
1809 - | self.boolean = input.map(|v| v.into());
|
1810 - | self
|
1811 - | }
|
1812 - | #[allow(missing_docs)] // documentation missing in model
|
1813 - | pub fn string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1814 - | self.string = input;
|
1815 - | self
|
1816 - | }
|
1817 - | #[allow(missing_docs)] // documentation missing in model
|
1818 - | pub(crate) fn set_string(
|
1819 - | mut self,
|
1820 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1821 - | ) -> Self {
|
1822 - | self.string = input.map(|v| v.into());
|
1823 - | self
|
1824 - | }
|
1825 - | #[allow(missing_docs)] // documentation missing in model
|
1826 - | pub fn byte(mut self, input: ::std::option::Option<i8>) -> Self {
|
1827 - | self.byte = input;
|
1828 - | self
|
1829 - | }
|
1830 - | #[allow(missing_docs)] // documentation missing in model
|
1831 - | pub(crate) fn set_byte(mut self, input: Option<impl ::std::convert::Into<i8>>) -> Self {
|
1832 - | self.byte = input.map(|v| v.into());
|
1833 - | self
|
1834 - | }
|
1835 - | #[allow(missing_docs)] // documentation missing in model
|
1836 - | pub fn short(mut self, input: ::std::option::Option<i16>) -> Self {
|
1837 - | self.short = input;
|
1838 - | self
|
1839 - | }
|
1840 - | #[allow(missing_docs)] // documentation missing in model
|
1841 - | pub(crate) fn set_short(mut self, input: Option<impl ::std::convert::Into<i16>>) -> Self {
|
1842 - | self.short = input.map(|v| v.into());
|
1843 - | self
|
1844 - | }
|
1845 - | #[allow(missing_docs)] // documentation missing in model
|
1846 - | pub fn integer(mut self, input: ::std::option::Option<i32>) -> Self {
|
1847 - | self.integer = input;
|
1848 - | self
|
1849 - | }
|
1850 - | #[allow(missing_docs)] // documentation missing in model
|
1851 - | pub(crate) fn set_integer(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
1852 - | self.integer = input.map(|v| v.into());
|
1853 - | self
|
1854 - | }
|
1855 - | #[allow(missing_docs)] // documentation missing in model
|
1856 - | pub fn long(mut self, input: ::std::option::Option<i64>) -> Self {
|
1857 - | self.long = input;
|
1858 - | self
|
1859 - | }
|
1860 - | #[allow(missing_docs)] // documentation missing in model
|
1861 - | pub(crate) fn set_long(mut self, input: Option<impl ::std::convert::Into<i64>>) -> Self {
|
1862 - | self.long = input.map(|v| v.into());
|
1863 - | self
|
1864 - | }
|
1865 - | #[allow(missing_docs)] // documentation missing in model
|
1866 - | pub fn float(mut self, input: ::std::option::Option<f32>) -> Self {
|
1867 - | self.float = input;
|
1868 - | self
|
1869 - | }
|
1870 - | #[allow(missing_docs)] // documentation missing in model
|
1871 - | pub(crate) fn set_float(mut self, input: Option<impl ::std::convert::Into<f32>>) -> Self {
|
1872 - | self.float = input.map(|v| v.into());
|
1873 - | self
|
1874 - | }
|
1875 - | #[allow(missing_docs)] // documentation missing in model
|
1876 - | pub fn double(mut self, input: ::std::option::Option<f64>) -> Self {
|
1877 - | self.double = input;
|
1878 - | self
|
1879 - | }
|
1880 - | #[allow(missing_docs)] // documentation missing in model
|
1881 - | pub(crate) fn set_double(mut self, input: Option<impl ::std::convert::Into<f64>>) -> Self {
|
1882 - | self.double = input.map(|v| v.into());
|
1883 - | self
|
1884 - | }
|
1885 - | #[allow(missing_docs)] // documentation missing in model
|
1886 - | pub fn timestamp(
|
1887 - | mut self,
|
1888 - | input: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1889 - | ) -> Self {
|
1890 - | self.timestamp = input;
|
1891 - | self
|
1892 - | }
|
1893 - | #[allow(missing_docs)] // documentation missing in model
|
1894 - | pub(crate) fn set_timestamp(
|
1895 - | mut self,
|
1896 - | input: Option<impl ::std::convert::Into<::aws_smithy_types::DateTime>>,
|
1897 - | ) -> Self {
|
1898 - | self.timestamp = input.map(|v| v.into());
|
1899 - | self
|
1900 - | }
|
1901 - | #[allow(missing_docs)] // documentation missing in model
|
1902 - | pub fn r#enum(mut self, input: ::std::option::Option<crate::model::Suit>) -> Self {
|
1903 - | self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1904 - | self
|
1905 - | }
|
1906 - | #[allow(missing_docs)] // documentation missing in model
|
1907 - | pub(crate) fn set_enum(
|
2178 + | pub fn events(
|
1908 2179 | mut self,
|
1909 - | input: Option<
|
1910 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
2180 + | input: crate::sigv4_event_stream::SigV4Receiver<
|
2181 + | crate::model::Events,
|
2182 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
1911 2183 | >,
|
1912 2184 | ) -> Self {
|
1913 - | self.r#enum = input.map(|v| v.into());
|
1914 - | self
|
1915 - | }
|
1916 - | #[allow(missing_docs)] // documentation missing in model
|
1917 - | pub fn required_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
|
1918 - | self.required_blob = Some(input);
|
2185 + | self.events = Some(input);
|
1919 2186 | self
|
1920 2187 | }
|
1921 2188 | #[allow(missing_docs)] // documentation missing in model
|
1922 - | pub(crate) fn set_required_blob(
|
2189 + | pub(crate) fn set_events(
|
1923 2190 | mut self,
|
1924 - | input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
|
2191 + | input: impl ::std::convert::Into<
|
2192 + | crate::sigv4_event_stream::SigV4Receiver<
|
2193 + | crate::model::Events,
|
2194 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
2195 + | >,
|
2196 + | >,
|
1925 2197 | ) -> Self {
|
1926 - | self.required_blob = Some(input.into());
|
1927 - | self
|
1928 - | }
|
1929 - | #[allow(missing_docs)] // documentation missing in model
|
1930 - | pub fn required_boolean(mut self, input: bool) -> Self {
|
1931 - | self.required_boolean = Some(input);
|
2198 + | self.events = Some(input.into());
|
1932 2199 | self
|
1933 2200 | }
|
1934 - | #[allow(missing_docs)] // documentation missing in model
|
1935 - | pub(crate) fn set_required_boolean(
|
1936 - | mut self,
|
1937 - | input: impl ::std::convert::Into<bool>,
|
1938 - | ) -> Self {
|
1939 - | self.required_boolean = Some(input.into());
|
1940 - | self
|
2201 + | /// Consumes the builder and constructs a [`StreamingOperationInput`](crate::input::StreamingOperationInput).
|
2202 + | ///
|
2203 + | /// The builder fails to construct a [`StreamingOperationInput`](crate::input::StreamingOperationInput) if a [`ConstraintViolation`] occurs.
|
2204 + | ///
|
2205 + | pub fn build(self) -> Result<crate::input::StreamingOperationInput, ConstraintViolation> {
|
2206 + | self.build_enforcing_all_constraints()
|
1941 2207 | }
|
1942 - | #[allow(missing_docs)] // documentation missing in model
|
1943 - | pub fn required_string(mut self, input: ::std::string::String) -> Self {
|
1944 - | self.required_string = Some(input);
|
1945 - | self
|
2208 + | fn build_enforcing_all_constraints(
|
2209 + | self,
|
2210 + | ) -> Result<crate::input::StreamingOperationInput, ConstraintViolation> {
|
2211 + | Ok(crate::input::StreamingOperationInput {
|
2212 + | events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
|
2213 + | })
|
1946 2214 | }
|
1947 - | #[allow(missing_docs)] // documentation missing in model
|
1948 - | pub(crate) fn set_required_string(
|
1949 - | mut self,
|
1950 - | input: impl ::std::convert::Into<::std::string::String>,
|
1951 - | ) -> Self {
|
1952 - | self.required_string = Some(input.into());
|
1953 - | self
|
1954 2215 | }
|
1955 - | #[allow(missing_docs)] // documentation missing in model
|
1956 - | pub fn required_byte(mut self, input: i8) -> Self {
|
1957 - | self.required_byte = Some(input);
|
1958 - | self
|
2216 + | }
|
2217 + | /// See [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
|
2218 + | pub mod streaming_operation_with_initial_data_input {
|
2219 + |
|
2220 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2221 + | /// Holds one variant for each of the ways the builder can fail.
|
2222 + | #[non_exhaustive]
|
2223 + | #[allow(clippy::enum_variant_names)]
|
2224 + | pub enum ConstraintViolation {
|
2225 + | /// `initial_data` was not provided but it is required when building `StreamingOperationWithInitialDataInput`.
|
2226 + | MissingInitialData,
|
2227 + | /// `events` was not provided but it is required when building `StreamingOperationWithInitialDataInput`.
|
2228 + | MissingEvents,
|
1959 2229 | }
|
1960 - | #[allow(missing_docs)] // documentation missing in model
|
1961 - | pub(crate) fn set_required_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
|
1962 - | self.required_byte = Some(input.into());
|
1963 - | self
|
2230 + | impl ::std::fmt::Display for ConstraintViolation {
|
2231 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2232 + | match self {
|
2233 + | ConstraintViolation::MissingInitialData => write!(f, "`initial_data` was not provided but it is required when building `StreamingOperationWithInitialDataInput`"),
|
2234 + | ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `StreamingOperationWithInitialDataInput`"),
|
1964 2235 | }
|
1965 - | #[allow(missing_docs)] // documentation missing in model
|
1966 - | pub fn required_short(mut self, input: i16) -> Self {
|
1967 - | self.required_short = Some(input);
|
1968 - | self
|
1969 2236 | }
|
1970 - | #[allow(missing_docs)] // documentation missing in model
|
1971 - | pub(crate) fn set_required_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
|
1972 - | self.required_short = Some(input.into());
|
1973 - | self
|
1974 2237 | }
|
1975 - | #[allow(missing_docs)] // documentation missing in model
|
1976 - | pub fn required_integer(mut self, input: i32) -> Self {
|
1977 - | self.required_integer = Some(input);
|
1978 - | self
|
2238 + | impl ::std::error::Error for ConstraintViolation {}
|
2239 + | impl ConstraintViolation {
|
2240 + | pub(crate) fn as_validation_exception_field(
|
2241 + | self,
|
2242 + | path: ::std::string::String,
|
2243 + | ) -> crate::model::ValidationExceptionField {
|
2244 + | match self {
|
2245 + | ConstraintViolation::MissingInitialData => crate::model::ValidationExceptionField {
|
2246 + | message: format!("Value at '{}/initialData' failed to satisfy constraint: Member must not be null", path),
|
2247 + | path: path + "/initialData",
|
2248 + | },
|
2249 + | ConstraintViolation::MissingEvents => crate::model::ValidationExceptionField {
|
2250 + | message: format!("Value at '{}/events' failed to satisfy constraint: Member must not be null", path),
|
2251 + | path: path + "/events",
|
2252 + | },
|
1979 2253 | }
|
1980 - | #[allow(missing_docs)] // documentation missing in model
|
1981 - | pub(crate) fn set_required_integer(
|
1982 - | mut self,
|
1983 - | input: impl ::std::convert::Into<i32>,
|
1984 - | ) -> Self {
|
1985 - | self.required_integer = Some(input.into());
|
1986 - | self
|
1987 2254 | }
|
1988 - | #[allow(missing_docs)] // documentation missing in model
|
1989 - | pub fn required_long(mut self, input: i64) -> Self {
|
1990 - | self.required_long = Some(input);
|
1991 - | self
|
1992 2255 | }
|
1993 - | #[allow(missing_docs)] // documentation missing in model
|
1994 - | pub(crate) fn set_required_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
|
1995 - | self.required_long = Some(input.into());
|
1996 - | self
|
2256 + | impl ::std::convert::From<ConstraintViolation>
|
2257 + | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
2258 + | {
|
2259 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
2260 + | let first_validation_exception_field =
|
2261 + | constraint_violation.as_validation_exception_field("".to_owned());
|
2262 + | let validation_exception = crate::error::ValidationException {
|
2263 + | message: format!(
|
2264 + | "1 validation error detected. {}",
|
2265 + | &first_validation_exception_field.message
|
2266 + | ),
|
2267 + | field_list: Some(vec![first_validation_exception_field]),
|
2268 + | };
|
2269 + | Self::ConstraintViolation(
|
2270 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
2271 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
2272 + | )
|
1997 2273 | }
|
1998 - | #[allow(missing_docs)] // documentation missing in model
|
1999 - | pub fn required_float(mut self, input: f32) -> Self {
|
2000 - | self.required_float = Some(input);
|
2001 - | self
|
2002 2274 | }
|
2003 - | #[allow(missing_docs)] // documentation missing in model
|
2004 - | pub(crate) fn set_required_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
|
2005 - | self.required_float = Some(input.into());
|
2006 - | self
|
2275 + | impl ::std::convert::From<Builder>
|
2276 + | for crate::constrained::MaybeConstrained<
|
2277 + | crate::input::StreamingOperationWithInitialDataInput,
|
2278 + | >
|
2279 + | {
|
2280 + | fn from(builder: Builder) -> Self {
|
2281 + | Self::Unconstrained(builder)
|
2007 2282 | }
|
2008 - | #[allow(missing_docs)] // documentation missing in model
|
2009 - | pub fn required_double(mut self, input: f64) -> Self {
|
2010 - | self.required_double = Some(input);
|
2011 - | self
|
2012 2283 | }
|
2013 - | #[allow(missing_docs)] // documentation missing in model
|
2014 - | pub(crate) fn set_required_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
|
2015 - | self.required_double = Some(input.into());
|
2016 - | self
|
2284 + | impl ::std::convert::TryFrom<Builder> for crate::input::StreamingOperationWithInitialDataInput {
|
2285 + | type Error = ConstraintViolation;
|
2286 + |
|
2287 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
2288 + | builder.build()
|
2289 + | }
|
2290 + | }
|
2291 + | /// A builder for [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
|
2292 + | #[derive(::std::default::Default, ::std::fmt::Debug)]
|
2293 + | pub struct Builder {
|
2294 + | pub(crate) initial_data: ::std::option::Option<::std::string::String>,
|
2295 + | pub(crate) events: ::std::option::Option<
|
2296 + | crate::sigv4_event_stream::SigV4Receiver<
|
2297 + | crate::model::Events,
|
2298 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
2299 + | >,
|
2300 + | >,
|
2017 2301 | }
|
2302 + | impl Builder {
|
2018 2303 | #[allow(missing_docs)] // documentation missing in model
|
2019 - | pub fn required_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
|
2020 - | self.required_timestamp = Some(input);
|
2304 + | pub fn initial_data(mut self, input: ::std::string::String) -> Self {
|
2305 + | self.initial_data = Some(input);
|
2021 2306 | self
|
2022 2307 | }
|
2023 2308 | #[allow(missing_docs)] // documentation missing in model
|
2024 - | pub(crate) fn set_required_timestamp(
|
2309 + | pub(crate) fn set_initial_data(
|
2025 2310 | mut self,
|
2026 - | input: impl ::std::convert::Into<::aws_smithy_types::DateTime>,
|
2311 + | input: impl ::std::convert::Into<::std::string::String>,
|
2027 2312 | ) -> Self {
|
2028 - | self.required_timestamp = Some(input.into());
|
2313 + | self.initial_data = Some(input.into());
|
2029 2314 | self
|
2030 2315 | }
|
2031 2316 | #[allow(missing_docs)] // documentation missing in model
|
2032 - | pub fn required_enum(mut self, input: crate::model::Suit) -> Self {
|
2033 - | self.required_enum = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
2317 + | pub fn events(
|
2318 + | mut self,
|
2319 + | input: crate::sigv4_event_stream::SigV4Receiver<
|
2320 + | crate::model::Events,
|
2321 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
2322 + | >,
|
2323 + | ) -> Self {
|
2324 + | self.events = Some(input);
|
2034 2325 | self
|
2035 2326 | }
|
2036 2327 | #[allow(missing_docs)] // documentation missing in model
|
2037 - | pub(crate) fn set_required_enum(
|
2328 + | pub(crate) fn set_events(
|
2038 2329 | mut self,
|
2039 - | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
2330 + | input: impl ::std::convert::Into<
|
2331 + | crate::sigv4_event_stream::SigV4Receiver<
|
2332 + | crate::model::Events,
|
2333 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
2334 + | >,
|
2335 + | >,
|
2040 2336 | ) -> Self {
|
2041 - | self.required_enum = Some(input.into());
|
2337 + | self.events = Some(input.into());
|
2042 2338 | self
|
2043 2339 | }
|
2044 - | /// Consumes the builder and constructs a [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput).
|
2340 + | /// Consumes the builder and constructs a [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
|
2045 2341 | ///
|
2046 - | /// The builder fails to construct a [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput) if a [`ConstraintViolation`] occurs.
|
2342 + | /// The builder fails to construct a [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput) if a [`ConstraintViolation`] occurs.
|
2047 2343 | ///
|
2048 2344 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
2049 2345 | pub fn build(
|
2050 2346 | self,
|
2051 - | ) -> Result<crate::input::ErrorSerializationOperationInput, ConstraintViolation> {
|
2347 + | ) -> Result<crate::input::StreamingOperationWithInitialDataInput, ConstraintViolation>
|
2348 + | {
|
2052 2349 | self.build_enforcing_all_constraints()
|
2053 2350 | }
|
2054 2351 | fn build_enforcing_all_constraints(
|
2055 2352 | self,
|
2056 - | ) -> Result<crate::input::ErrorSerializationOperationInput, ConstraintViolation> {
|
2057 - | Ok(crate::input::ErrorSerializationOperationInput {
|
2058 - | blob: self.blob,
|
2059 - | boolean: self.boolean,
|
2060 - | string: self.string,
|
2061 - | byte: self.byte,
|
2062 - | short: self.short,
|
2063 - | integer: self.integer,
|
2064 - | long: self.long,
|
2065 - | float: self.float,
|
2066 - | double: self.double,
|
2067 - | timestamp: self.timestamp,
|
2068 - | r#enum: self
|
2069 - | .r#enum
|
2070 - | .map(|v| match v {
|
2071 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2072 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2073 - | })
|
2074 - | .map(|res| res.map_err(ConstraintViolation::Enum))
|
2075 - | .transpose()?,
|
2076 - | required_blob: self
|
2077 - | .required_blob
|
2078 - | .ok_or(ConstraintViolation::MissingRequiredBlob)?,
|
2079 - | required_boolean: self
|
2080 - | .required_boolean
|
2081 - | .ok_or(ConstraintViolation::MissingRequiredBoolean)?,
|
2082 - | required_string: self
|
2083 - | .required_string
|
2084 - | .ok_or(ConstraintViolation::MissingRequiredString)?,
|
2085 - | required_byte: self
|
2086 - | .required_byte
|
2087 - | .ok_or(ConstraintViolation::MissingRequiredByte)?,
|
2088 - | required_short: self
|
2089 - | .required_short
|
2090 - | .ok_or(ConstraintViolation::MissingRequiredShort)?,
|
2091 - | required_integer: self
|
2092 - | .required_integer
|
2093 - | .ok_or(ConstraintViolation::MissingRequiredInteger)?,
|
2094 - | required_long: self
|
2095 - | .required_long
|
2096 - | .ok_or(ConstraintViolation::MissingRequiredLong)?,
|
2097 - | required_float: self
|
2098 - | .required_float
|
2099 - | .ok_or(ConstraintViolation::MissingRequiredFloat)?,
|
2100 - | required_double: self
|
2101 - | .required_double
|
2102 - | .ok_or(ConstraintViolation::MissingRequiredDouble)?,
|
2103 - | required_timestamp: self
|
2104 - | .required_timestamp
|
2105 - | .ok_or(ConstraintViolation::MissingRequiredTimestamp)?,
|
2106 - | required_enum: self
|
2107 - | .required_enum
|
2108 - | .map(|v| match v {
|
2109 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2110 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2111 - | })
|
2112 - | .map(|res| res.map_err(ConstraintViolation::RequiredEnum))
|
2113 - | .transpose()?
|
2114 - | .ok_or(ConstraintViolation::MissingRequiredEnum)?,
|
2353 + | ) -> Result<crate::input::StreamingOperationWithInitialDataInput, ConstraintViolation>
|
2354 + | {
|
2355 + | Ok(crate::input::StreamingOperationWithInitialDataInput {
|
2356 + | initial_data: self
|
2357 + | .initial_data
|
2358 + | .ok_or(ConstraintViolation::MissingInitialData)?,
|
2359 + | events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
|
2115 2360 | })
|
2116 2361 | }
|
2117 2362 | }
|
2118 2363 | }
|
2119 - | /// See [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput).
|
2120 - | pub mod simple_struct_operation_input {
|
2364 + | /// See [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
|
2365 + | pub mod streaming_operation_with_initial_response_input {
|
2121 2366 |
|
2122 2367 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2123 2368 | /// Holds one variant for each of the ways the builder can fail.
|
2124 2369 | #[non_exhaustive]
|
2125 - | #[allow(clippy::enum_variant_names)]
|
2126 - | pub enum ConstraintViolation {
|
2127 - | /// Constraint violation occurred building member `r#enum` when building `SimpleStructOperationInput`.
|
2128 - | #[doc(hidden)]
|
2129 - | Enum(crate::model::suit::ConstraintViolation),
|
2130 - | /// `required_blob` was not provided but it is required when building `SimpleStructOperationInput`.
|
2131 - | MissingRequiredBlob,
|
2132 - | /// `required_boolean` was not provided but it is required when building `SimpleStructOperationInput`.
|
2133 - | MissingRequiredBoolean,
|
2134 - | /// `required_string` was not provided but it is required when building `SimpleStructOperationInput`.
|
2135 - | MissingRequiredString,
|
2136 - | /// `required_byte` was not provided but it is required when building `SimpleStructOperationInput`.
|
2137 - | MissingRequiredByte,
|
2138 - | /// `required_short` was not provided but it is required when building `SimpleStructOperationInput`.
|
2139 - | MissingRequiredShort,
|
2140 - | /// `required_integer` was not provided but it is required when building `SimpleStructOperationInput`.
|
2141 - | MissingRequiredInteger,
|
2142 - | /// `required_long` was not provided but it is required when building `SimpleStructOperationInput`.
|
2143 - | MissingRequiredLong,
|
2144 - | /// `required_float` was not provided but it is required when building `SimpleStructOperationInput`.
|
2145 - | MissingRequiredFloat,
|
2146 - | /// `required_double` was not provided but it is required when building `SimpleStructOperationInput`.
|
2147 - | MissingRequiredDouble,
|
2148 - | /// `required_timestamp` was not provided but it is required when building `SimpleStructOperationInput`.
|
2149 - | MissingRequiredTimestamp,
|
2150 - | /// `required_enum` was not provided but it is required when building `SimpleStructOperationInput`.
|
2151 - | MissingRequiredEnum,
|
2152 - | /// Constraint violation occurred building member `required_enum` when building `SimpleStructOperationInput`.
|
2153 - | #[doc(hidden)]
|
2154 - | RequiredEnum(crate::model::suit::ConstraintViolation),
|
2155 - | }
|
2156 - | impl ::std::fmt::Display for ConstraintViolation {
|
2157 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2158 - | match self {
|
2159 - | ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `SimpleStructOperationInput`"),
|
2160 - | ConstraintViolation::MissingRequiredBlob => write!(f, "`required_blob` was not provided but it is required when building `SimpleStructOperationInput`"),
|
2161 - | ConstraintViolation::MissingRequiredBoolean => write!(f, "`required_boolean` was not provided but it is required when building `SimpleStructOperationInput`"),
|
2162 - | ConstraintViolation::MissingRequiredString => write!(f, "`required_string` was not provided but it is required when building `SimpleStructOperationInput`"),
|
2163 - | ConstraintViolation::MissingRequiredByte => write!(f, "`required_byte` was not provided but it is required when building `SimpleStructOperationInput`"),
|
2164 - | ConstraintViolation::MissingRequiredShort => write!(f, "`required_short` was not provided but it is required when building `SimpleStructOperationInput`"),
|
2165 - | ConstraintViolation::MissingRequiredInteger => write!(f, "`required_integer` was not provided but it is required when building `SimpleStructOperationInput`"),
|
2166 - | ConstraintViolation::MissingRequiredLong => write!(f, "`required_long` was not provided but it is required when building `SimpleStructOperationInput`"),
|
2167 - | ConstraintViolation::MissingRequiredFloat => write!(f, "`required_float` was not provided but it is required when building `SimpleStructOperationInput`"),
|
2168 - | ConstraintViolation::MissingRequiredDouble => write!(f, "`required_double` was not provided but it is required when building `SimpleStructOperationInput`"),
|
2169 - | ConstraintViolation::MissingRequiredTimestamp => write!(f, "`required_timestamp` was not provided but it is required when building `SimpleStructOperationInput`"),
|
2170 - | ConstraintViolation::MissingRequiredEnum => write!(f, "`required_enum` was not provided but it is required when building `SimpleStructOperationInput`"),
|
2171 - | ConstraintViolation::RequiredEnum(_) => write!(f, "constraint violation occurred building member `required_enum` when building `SimpleStructOperationInput`"),
|
2370 + | #[allow(clippy::enum_variant_names)]
|
2371 + | pub enum ConstraintViolation {
|
2372 + | /// `events` was not provided but it is required when building `StreamingOperationWithInitialResponseInput`.
|
2373 + | MissingEvents,
|
2374 + | }
|
2375 + | impl ::std::fmt::Display for ConstraintViolation {
|
2376 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2377 + | match self {
|
2378 + | ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `StreamingOperationWithInitialResponseInput`"),
|
2172 2379 | }
|
2173 2380 | }
|
2174 2381 | }
|
2175 2382 | impl ::std::error::Error for ConstraintViolation {}
|
2176 2383 | impl ConstraintViolation {
|
2177 2384 | pub(crate) fn as_validation_exception_field(
|
2178 2385 | self,
|
2179 2386 | path: ::std::string::String,
|
2180 2387 | ) -> crate::model::ValidationExceptionField {
|
2181 2388 | match self {
|
2182 - | ConstraintViolation::Enum(inner) => inner.as_validation_exception_field(path + "/enum"),
|
2183 - | ConstraintViolation::MissingRequiredBlob => crate::model::ValidationExceptionField {
|
2184 - | message: format!("Value at '{}/requiredBlob' failed to satisfy constraint: Member must not be null", path),
|
2185 - | path: path + "/requiredBlob",
|
2186 - | },
|
2187 - | ConstraintViolation::MissingRequiredBoolean => crate::model::ValidationExceptionField {
|
2188 - | message: format!("Value at '{}/requiredBoolean' failed to satisfy constraint: Member must not be null", path),
|
2189 - | path: path + "/requiredBoolean",
|
2190 - | },
|
2191 - | ConstraintViolation::MissingRequiredString => crate::model::ValidationExceptionField {
|
2192 - | message: format!("Value at '{}/requiredString' failed to satisfy constraint: Member must not be null", path),
|
2193 - | path: path + "/requiredString",
|
2194 - | },
|
2195 - | ConstraintViolation::MissingRequiredByte => crate::model::ValidationExceptionField {
|
2196 - | message: format!("Value at '{}/requiredByte' failed to satisfy constraint: Member must not be null", path),
|
2197 - | path: path + "/requiredByte",
|
2198 - | },
|
2199 - | ConstraintViolation::MissingRequiredShort => crate::model::ValidationExceptionField {
|
2200 - | message: format!("Value at '{}/requiredShort' failed to satisfy constraint: Member must not be null", path),
|
2201 - | path: path + "/requiredShort",
|
2202 - | },
|
2203 - | ConstraintViolation::MissingRequiredInteger => crate::model::ValidationExceptionField {
|
2204 - | message: format!("Value at '{}/requiredInteger' failed to satisfy constraint: Member must not be null", path),
|
2205 - | path: path + "/requiredInteger",
|
2206 - | },
|
2207 - | ConstraintViolation::MissingRequiredLong => crate::model::ValidationExceptionField {
|
2208 - | message: format!("Value at '{}/requiredLong' failed to satisfy constraint: Member must not be null", path),
|
2209 - | path: path + "/requiredLong",
|
2210 - | },
|
2211 - | ConstraintViolation::MissingRequiredFloat => crate::model::ValidationExceptionField {
|
2212 - | message: format!("Value at '{}/requiredFloat' failed to satisfy constraint: Member must not be null", path),
|
2213 - | path: path + "/requiredFloat",
|
2214 - | },
|
2215 - | ConstraintViolation::MissingRequiredDouble => crate::model::ValidationExceptionField {
|
2216 - | message: format!("Value at '{}/requiredDouble' failed to satisfy constraint: Member must not be null", path),
|
2217 - | path: path + "/requiredDouble",
|
2218 - | },
|
2219 - | ConstraintViolation::MissingRequiredTimestamp => crate::model::ValidationExceptionField {
|
2220 - | message: format!("Value at '{}/requiredTimestamp' failed to satisfy constraint: Member must not be null", path),
|
2221 - | path: path + "/requiredTimestamp",
|
2222 - | },
|
2223 - | ConstraintViolation::MissingRequiredEnum => crate::model::ValidationExceptionField {
|
2224 - | message: format!("Value at '{}/requiredEnum' failed to satisfy constraint: Member must not be null", path),
|
2225 - | path: path + "/requiredEnum",
|
2389 + | ConstraintViolation::MissingEvents => crate::model::ValidationExceptionField {
|
2390 + | message: format!("Value at '{}/events' failed to satisfy constraint: Member must not be null", path),
|
2391 + | path: path + "/events",
|
2226 2392 | },
|
2227 - | ConstraintViolation::RequiredEnum(inner) => inner.as_validation_exception_field(path + "/requiredEnum"),
|
2228 2393 | }
|
2229 2394 | }
|
2230 2395 | }
|
2231 2396 | impl ::std::convert::From<ConstraintViolation>
|
2232 2397 | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
2233 2398 | {
|
2234 2399 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
2235 2400 | let first_validation_exception_field =
|
2236 2401 | constraint_violation.as_validation_exception_field("".to_owned());
|
2237 2402 | let validation_exception = crate::error::ValidationException {
|
2238 2403 | message: format!(
|
2239 2404 | "1 validation error detected. {}",
|
2240 2405 | &first_validation_exception_field.message
|
2241 2406 | ),
|
2242 2407 | field_list: Some(vec![first_validation_exception_field]),
|
2243 2408 | };
|
2244 2409 | Self::ConstraintViolation(
|
2245 2410 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
2246 2411 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
2247 2412 | )
|
2248 2413 | }
|
2249 2414 | }
|
2250 2415 | impl ::std::convert::From<Builder>
|
2251 - | for crate::constrained::MaybeConstrained<crate::input::SimpleStructOperationInput>
|
2416 + | for crate::constrained::MaybeConstrained<
|
2417 + | crate::input::StreamingOperationWithInitialResponseInput,
|
2418 + | >
|
2252 2419 | {
|
2253 2420 | fn from(builder: Builder) -> Self {
|
2254 2421 | Self::Unconstrained(builder)
|
2255 2422 | }
|
2256 2423 | }
|
2257 - | impl ::std::convert::TryFrom<Builder> for crate::input::SimpleStructOperationInput {
|
2424 + | impl ::std::convert::TryFrom<Builder> for crate::input::StreamingOperationWithInitialResponseInput {
|
2258 2425 | type Error = ConstraintViolation;
|
2259 2426 |
|
2260 2427 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
2261 2428 | builder.build()
|
2262 2429 | }
|
2263 2430 | }
|
2264 - | /// A builder for [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput).
|
2265 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2431 + | /// A builder for [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
|
2432 + | #[derive(::std::default::Default, ::std::fmt::Debug)]
|
2266 2433 | pub struct Builder {
|
2267 - | pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
2268 - | pub(crate) boolean: ::std::option::Option<bool>,
|
2269 - | pub(crate) string: ::std::option::Option<::std::string::String>,
|
2270 - | pub(crate) byte: ::std::option::Option<i8>,
|
2271 - | pub(crate) short: ::std::option::Option<i16>,
|
2272 - | pub(crate) integer: ::std::option::Option<i32>,
|
2273 - | pub(crate) long: ::std::option::Option<i64>,
|
2274 - | pub(crate) float: ::std::option::Option<f32>,
|
2275 - | pub(crate) double: ::std::option::Option<f64>,
|
2276 - | pub(crate) timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
2277 - | pub(crate) r#enum:
|
2278 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
2279 - | pub(crate) required_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
2280 - | pub(crate) required_boolean: ::std::option::Option<bool>,
|
2281 - | pub(crate) required_string: ::std::option::Option<::std::string::String>,
|
2282 - | pub(crate) required_byte: ::std::option::Option<i8>,
|
2283 - | pub(crate) required_short: ::std::option::Option<i16>,
|
2284 - | pub(crate) required_integer: ::std::option::Option<i32>,
|
2285 - | pub(crate) required_long: ::std::option::Option<i64>,
|
2286 - | pub(crate) required_float: ::std::option::Option<f32>,
|
2287 - | pub(crate) required_double: ::std::option::Option<f64>,
|
2288 - | pub(crate) required_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
2289 - | pub(crate) required_enum:
|
2290 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
2434 + | pub(crate) events: ::std::option::Option<
|
2435 + | crate::sigv4_event_stream::SigV4Receiver<
|
2436 + | crate::model::Events,
|
2437 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
2438 + | >,
|
2439 + | >,
|
2291 2440 | }
|
2292 2441 | impl Builder {
|
2293 2442 | #[allow(missing_docs)] // documentation missing in model
|
2294 - | pub fn blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
|
2295 - | self.blob = input;
|
2296 - | self
|
2297 - | }
|
2298 - | #[allow(missing_docs)] // documentation missing in model
|
2299 - | pub(crate) fn set_blob(
|
2300 - | mut self,
|
2301 - | input: Option<impl ::std::convert::Into<::aws_smithy_types::Blob>>,
|
2302 - | ) -> Self {
|
2303 - | self.blob = input.map(|v| v.into());
|
2304 - | self
|
2305 - | }
|
2306 - | #[allow(missing_docs)] // documentation missing in model
|
2307 - | pub fn boolean(mut self, input: ::std::option::Option<bool>) -> Self {
|
2308 - | self.boolean = input;
|
2309 - | self
|
2310 - | }
|
2311 - | #[allow(missing_docs)] // documentation missing in model
|
2312 - | pub(crate) fn set_boolean(
|
2313 - | mut self,
|
2314 - | input: Option<impl ::std::convert::Into<bool>>,
|
2315 - | ) -> Self {
|
2316 - | self.boolean = input.map(|v| v.into());
|
2317 - | self
|
2318 - | }
|
2319 - | #[allow(missing_docs)] // documentation missing in model
|
2320 - | pub fn string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
2321 - | self.string = input;
|
2322 - | self
|
2323 - | }
|
2324 - | #[allow(missing_docs)] // documentation missing in model
|
2325 - | pub(crate) fn set_string(
|
2326 - | mut self,
|
2327 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
2328 - | ) -> Self {
|
2329 - | self.string = input.map(|v| v.into());
|
2330 - | self
|
2331 - | }
|
2332 - | #[allow(missing_docs)] // documentation missing in model
|
2333 - | pub fn byte(mut self, input: ::std::option::Option<i8>) -> Self {
|
2334 - | self.byte = input;
|
2335 - | self
|
2336 - | }
|
2337 - | #[allow(missing_docs)] // documentation missing in model
|
2338 - | pub(crate) fn set_byte(mut self, input: Option<impl ::std::convert::Into<i8>>) -> Self {
|
2339 - | self.byte = input.map(|v| v.into());
|
2340 - | self
|
2341 - | }
|
2342 - | #[allow(missing_docs)] // documentation missing in model
|
2343 - | pub fn short(mut self, input: ::std::option::Option<i16>) -> Self {
|
2344 - | self.short = input;
|
2345 - | self
|
2346 - | }
|
2347 - | #[allow(missing_docs)] // documentation missing in model
|
2348 - | pub(crate) fn set_short(mut self, input: Option<impl ::std::convert::Into<i16>>) -> Self {
|
2349 - | self.short = input.map(|v| v.into());
|
2350 - | self
|
2351 - | }
|
2352 - | #[allow(missing_docs)] // documentation missing in model
|
2353 - | pub fn integer(mut self, input: ::std::option::Option<i32>) -> Self {
|
2354 - | self.integer = input;
|
2355 - | self
|
2356 - | }
|
2357 - | #[allow(missing_docs)] // documentation missing in model
|
2358 - | pub(crate) fn set_integer(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
2359 - | self.integer = input.map(|v| v.into());
|
2360 - | self
|
2361 - | }
|
2362 - | #[allow(missing_docs)] // documentation missing in model
|
2363 - | pub fn long(mut self, input: ::std::option::Option<i64>) -> Self {
|
2364 - | self.long = input;
|
2365 - | self
|
2366 - | }
|
2367 - | #[allow(missing_docs)] // documentation missing in model
|
2368 - | pub(crate) fn set_long(mut self, input: Option<impl ::std::convert::Into<i64>>) -> Self {
|
2369 - | self.long = input.map(|v| v.into());
|
2370 - | self
|
2371 - | }
|
2372 - | #[allow(missing_docs)] // documentation missing in model
|
2373 - | pub fn float(mut self, input: ::std::option::Option<f32>) -> Self {
|
2374 - | self.float = input;
|
2375 - | self
|
2376 - | }
|
2377 - | #[allow(missing_docs)] // documentation missing in model
|
2378 - | pub(crate) fn set_float(mut self, input: Option<impl ::std::convert::Into<f32>>) -> Self {
|
2379 - | self.float = input.map(|v| v.into());
|
2380 - | self
|
2381 - | }
|
2382 - | #[allow(missing_docs)] // documentation missing in model
|
2383 - | pub fn double(mut self, input: ::std::option::Option<f64>) -> Self {
|
2384 - | self.double = input;
|
2385 - | self
|
2386 - | }
|
2387 - | #[allow(missing_docs)] // documentation missing in model
|
2388 - | pub(crate) fn set_double(mut self, input: Option<impl ::std::convert::Into<f64>>) -> Self {
|
2389 - | self.double = input.map(|v| v.into());
|
2390 - | self
|
2391 - | }
|
2392 - | #[allow(missing_docs)] // documentation missing in model
|
2393 - | pub fn timestamp(
|
2394 - | mut self,
|
2395 - | input: ::std::option::Option<::aws_smithy_types::DateTime>,
|
2396 - | ) -> Self {
|
2397 - | self.timestamp = input;
|
2398 - | self
|
2399 - | }
|
2400 - | #[allow(missing_docs)] // documentation missing in model
|
2401 - | pub(crate) fn set_timestamp(
|
2402 - | mut self,
|
2403 - | input: Option<impl ::std::convert::Into<::aws_smithy_types::DateTime>>,
|
2404 - | ) -> Self {
|
2405 - | self.timestamp = input.map(|v| v.into());
|
2406 - | self
|
2407 - | }
|
2408 - | #[allow(missing_docs)] // documentation missing in model
|
2409 - | pub fn r#enum(mut self, input: ::std::option::Option<crate::model::Suit>) -> Self {
|
2410 - | self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
|
2411 - | self
|
2412 - | }
|
2413 - | #[allow(missing_docs)] // documentation missing in model
|
2414 - | pub(crate) fn set_enum(
|
2443 + | pub fn events(
|
2415 2444 | mut self,
|
2416 - | input: Option<
|
2417 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
2445 + | input: crate::sigv4_event_stream::SigV4Receiver<
|
2446 + | crate::model::Events,
|
2447 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
2418 2448 | >,
|
2419 2449 | ) -> Self {
|
2420 - | self.r#enum = input.map(|v| v.into());
|
2421 - | self
|
2422 - | }
|
2423 - | #[allow(missing_docs)] // documentation missing in model
|
2424 - | pub fn required_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
|
2425 - | self.required_blob = Some(input);
|
2426 - | self
|
2427 - | }
|
2428 - | #[allow(missing_docs)] // documentation missing in model
|
2429 - | pub(crate) fn set_required_blob(
|
2430 - | mut self,
|
2431 - | input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
|
2432 - | ) -> Self {
|
2433 - | self.required_blob = Some(input.into());
|
2434 - | self
|
2435 - | }
|
2436 - | #[allow(missing_docs)] // documentation missing in model
|
2437 - | pub fn required_boolean(mut self, input: bool) -> Self {
|
2438 - | self.required_boolean = Some(input);
|
2439 - | self
|
2440 - | }
|
2441 - | #[allow(missing_docs)] // documentation missing in model
|
2442 - | pub(crate) fn set_required_boolean(
|
2443 - | mut self,
|
2444 - | input: impl ::std::convert::Into<bool>,
|
2445 - | ) -> Self {
|
2446 - | self.required_boolean = Some(input.into());
|
2447 - | self
|
2448 - | }
|
2449 - | #[allow(missing_docs)] // documentation missing in model
|
2450 - | pub fn required_string(mut self, input: ::std::string::String) -> Self {
|
2451 - | self.required_string = Some(input);
|
2450 + | self.events = Some(input);
|
2452 2451 | self
|
2453 2452 | }
|
2454 2453 | #[allow(missing_docs)] // documentation missing in model
|
2455 - | pub(crate) fn set_required_string(
|
2454 + | pub(crate) fn set_events(
|
2456 2455 | mut self,
|
2457 - | input: impl ::std::convert::Into<::std::string::String>,
|
2456 + | input: impl ::std::convert::Into<
|
2457 + | crate::sigv4_event_stream::SigV4Receiver<
|
2458 + | crate::model::Events,
|
2459 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
2460 + | >,
|
2461 + | >,
|
2458 2462 | ) -> Self {
|
2459 - | self.required_string = Some(input.into());
|
2463 + | self.events = Some(input.into());
|
2460 2464 | self
|
2461 2465 | }
|
2462 - | #[allow(missing_docs)] // documentation missing in model
|
2463 - | pub fn required_byte(mut self, input: i8) -> Self {
|
2464 - | self.required_byte = Some(input);
|
2465 - | self
|
2466 + | /// Consumes the builder and constructs a [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
|
2467 + | ///
|
2468 + | /// The builder fails to construct a [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput) if a [`ConstraintViolation`] occurs.
|
2469 + | ///
|
2470 + | pub fn build(
|
2471 + | self,
|
2472 + | ) -> Result<crate::input::StreamingOperationWithInitialResponseInput, ConstraintViolation>
|
2473 + | {
|
2474 + | self.build_enforcing_all_constraints()
|
2466 2475 | }
|
2467 - | #[allow(missing_docs)] // documentation missing in model
|
2468 - | pub(crate) fn set_required_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
|
2469 - | self.required_byte = Some(input.into());
|
2470 - | self
|
2476 + | fn build_enforcing_all_constraints(
|
2477 + | self,
|
2478 + | ) -> Result<crate::input::StreamingOperationWithInitialResponseInput, ConstraintViolation>
|
2479 + | {
|
2480 + | Ok(crate::input::StreamingOperationWithInitialResponseInput {
|
2481 + | events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
|
2482 + | })
|
2471 2483 | }
|
2472 - | #[allow(missing_docs)] // documentation missing in model
|
2473 - | pub fn required_short(mut self, input: i16) -> Self {
|
2474 - | self.required_short = Some(input);
|
2475 - | self
|
2476 2484 | }
|
2477 - | #[allow(missing_docs)] // documentation missing in model
|
2478 - | pub(crate) fn set_required_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
|
2479 - | self.required_short = Some(input.into());
|
2480 - | self
|
2485 + | }
|
2486 + | /// See [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
|
2487 + | pub mod streaming_operation_with_optional_data_input {
|
2488 + |
|
2489 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2490 + | /// Holds one variant for each of the ways the builder can fail.
|
2491 + | #[non_exhaustive]
|
2492 + | #[allow(clippy::enum_variant_names)]
|
2493 + | pub enum ConstraintViolation {
|
2494 + | /// `events` was not provided but it is required when building `StreamingOperationWithOptionalDataInput`.
|
2495 + | MissingEvents,
|
2481 2496 | }
|
2482 - | #[allow(missing_docs)] // documentation missing in model
|
2483 - | pub fn required_integer(mut self, input: i32) -> Self {
|
2484 - | self.required_integer = Some(input);
|
2485 - | self
|
2497 + | impl ::std::fmt::Display for ConstraintViolation {
|
2498 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2499 + | match self {
|
2500 + | ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `StreamingOperationWithOptionalDataInput`"),
|
2486 2501 | }
|
2487 - | #[allow(missing_docs)] // documentation missing in model
|
2488 - | pub(crate) fn set_required_integer(
|
2489 - | mut self,
|
2490 - | input: impl ::std::convert::Into<i32>,
|
2491 - | ) -> Self {
|
2492 - | self.required_integer = Some(input.into());
|
2493 - | self
|
2494 2502 | }
|
2495 - | #[allow(missing_docs)] // documentation missing in model
|
2496 - | pub fn required_long(mut self, input: i64) -> Self {
|
2497 - | self.required_long = Some(input);
|
2498 - | self
|
2499 2503 | }
|
2500 - | #[allow(missing_docs)] // documentation missing in model
|
2501 - | pub(crate) fn set_required_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
|
2502 - | self.required_long = Some(input.into());
|
2503 - | self
|
2504 + | impl ::std::error::Error for ConstraintViolation {}
|
2505 + | impl ConstraintViolation {
|
2506 + | pub(crate) fn as_validation_exception_field(
|
2507 + | self,
|
2508 + | path: ::std::string::String,
|
2509 + | ) -> crate::model::ValidationExceptionField {
|
2510 + | match self {
|
2511 + | ConstraintViolation::MissingEvents => crate::model::ValidationExceptionField {
|
2512 + | message: format!("Value at '{}/events' failed to satisfy constraint: Member must not be null", path),
|
2513 + | path: path + "/events",
|
2514 + | },
|
2504 2515 | }
|
2505 - | #[allow(missing_docs)] // documentation missing in model
|
2506 - | pub fn required_float(mut self, input: f32) -> Self {
|
2507 - | self.required_float = Some(input);
|
2508 - | self
|
2509 2516 | }
|
2510 - | #[allow(missing_docs)] // documentation missing in model
|
2511 - | pub(crate) fn set_required_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
|
2512 - | self.required_float = Some(input.into());
|
2513 - | self
|
2514 2517 | }
|
2515 - | #[allow(missing_docs)] // documentation missing in model
|
2516 - | pub fn required_double(mut self, input: f64) -> Self {
|
2517 - | self.required_double = Some(input);
|
2518 - | self
|
2518 + | impl ::std::convert::From<ConstraintViolation>
|
2519 + | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
2520 + | {
|
2521 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
2522 + | let first_validation_exception_field =
|
2523 + | constraint_violation.as_validation_exception_field("".to_owned());
|
2524 + | let validation_exception = crate::error::ValidationException {
|
2525 + | message: format!(
|
2526 + | "1 validation error detected. {}",
|
2527 + | &first_validation_exception_field.message
|
2528 + | ),
|
2529 + | field_list: Some(vec![first_validation_exception_field]),
|
2530 + | };
|
2531 + | Self::ConstraintViolation(
|
2532 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
2533 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
2534 + | )
|
2519 2535 | }
|
2520 - | #[allow(missing_docs)] // documentation missing in model
|
2521 - | pub(crate) fn set_required_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
|
2522 - | self.required_double = Some(input.into());
|
2523 - | self
|
2524 2536 | }
|
2537 + | impl ::std::convert::From<Builder>
|
2538 + | for crate::constrained::MaybeConstrained<
|
2539 + | crate::input::StreamingOperationWithOptionalDataInput,
|
2540 + | >
|
2541 + | {
|
2542 + | fn from(builder: Builder) -> Self {
|
2543 + | Self::Unconstrained(builder)
|
2544 + | }
|
2545 + | }
|
2546 + | impl ::std::convert::TryFrom<Builder> for crate::input::StreamingOperationWithOptionalDataInput {
|
2547 + | type Error = ConstraintViolation;
|
2548 + |
|
2549 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
2550 + | builder.build()
|
2551 + | }
|
2552 + | }
|
2553 + | /// A builder for [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
|
2554 + | #[derive(::std::default::Default, ::std::fmt::Debug)]
|
2555 + | pub struct Builder {
|
2556 + | pub(crate) optional_data: ::std::option::Option<::std::string::String>,
|
2557 + | pub(crate) events: ::std::option::Option<
|
2558 + | crate::sigv4_event_stream::SigV4Receiver<
|
2559 + | crate::model::Events,
|
2560 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
2561 + | >,
|
2562 + | >,
|
2563 + | }
|
2564 + | impl Builder {
|
2525 2565 | #[allow(missing_docs)] // documentation missing in model
|
2526 - | pub fn required_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
|
2527 - | self.required_timestamp = Some(input);
|
2566 + | pub fn optional_data(
|
2567 + | mut self,
|
2568 + | input: ::std::option::Option<::std::string::String>,
|
2569 + | ) -> Self {
|
2570 + | self.optional_data = input;
|
2528 2571 | self
|
2529 2572 | }
|
2530 2573 | #[allow(missing_docs)] // documentation missing in model
|
2531 - | pub(crate) fn set_required_timestamp(
|
2574 + | pub(crate) fn set_optional_data(
|
2532 2575 | mut self,
|
2533 - | input: impl ::std::convert::Into<::aws_smithy_types::DateTime>,
|
2576 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
2534 2577 | ) -> Self {
|
2535 - | self.required_timestamp = Some(input.into());
|
2578 + | self.optional_data = input.map(|v| v.into());
|
2536 2579 | self
|
2537 2580 | }
|
2538 2581 | #[allow(missing_docs)] // documentation missing in model
|
2539 - | pub fn required_enum(mut self, input: crate::model::Suit) -> Self {
|
2540 - | self.required_enum = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
2582 + | pub fn events(
|
2583 + | mut self,
|
2584 + | input: crate::sigv4_event_stream::SigV4Receiver<
|
2585 + | crate::model::Events,
|
2586 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
2587 + | >,
|
2588 + | ) -> Self {
|
2589 + | self.events = Some(input);
|
2541 2590 | self
|
2542 2591 | }
|
2543 2592 | #[allow(missing_docs)] // documentation missing in model
|
2544 - | pub(crate) fn set_required_enum(
|
2593 + | pub(crate) fn set_events(
|
2545 2594 | mut self,
|
2546 - | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
2595 + | input: impl ::std::convert::Into<
|
2596 + | crate::sigv4_event_stream::SigV4Receiver<
|
2597 + | crate::model::Events,
|
2598 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
2599 + | >,
|
2600 + | >,
|
2547 2601 | ) -> Self {
|
2548 - | self.required_enum = Some(input.into());
|
2602 + | self.events = Some(input.into());
|
2549 2603 | self
|
2550 2604 | }
|
2551 - | /// Consumes the builder and constructs a [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput).
|
2605 + | /// Consumes the builder and constructs a [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
|
2552 2606 | ///
|
2553 - | /// The builder fails to construct a [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput) if a [`ConstraintViolation`] occurs.
|
2607 + | /// The builder fails to construct a [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput) if a [`ConstraintViolation`] occurs.
|
2554 2608 | ///
|
2555 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
2556 2609 | pub fn build(
|
2557 2610 | self,
|
2558 - | ) -> Result<crate::input::SimpleStructOperationInput, ConstraintViolation> {
|
2611 + | ) -> Result<crate::input::StreamingOperationWithOptionalDataInput, ConstraintViolation>
|
2612 + | {
|
2559 2613 | self.build_enforcing_all_constraints()
|
2560 2614 | }
|
2561 2615 | fn build_enforcing_all_constraints(
|
2562 2616 | self,
|
2563 - | ) -> Result<crate::input::SimpleStructOperationInput, ConstraintViolation> {
|
2564 - | Ok(crate::input::SimpleStructOperationInput {
|
2565 - | blob: self.blob,
|
2566 - | boolean: self.boolean,
|
2567 - | string: self.string,
|
2568 - | byte: self.byte,
|
2569 - | short: self.short,
|
2570 - | integer: self.integer,
|
2571 - | long: self.long,
|
2572 - | float: self.float,
|
2573 - | double: self.double,
|
2574 - | timestamp: self.timestamp,
|
2575 - | r#enum: self
|
2576 - | .r#enum
|
2577 - | .map(|v| match v {
|
2578 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2579 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2580 - | })
|
2581 - | .map(|res| res.map_err(ConstraintViolation::Enum))
|
2582 - | .transpose()?,
|
2583 - | required_blob: self
|
2584 - | .required_blob
|
2585 - | .ok_or(ConstraintViolation::MissingRequiredBlob)?,
|
2586 - | required_boolean: self
|
2587 - | .required_boolean
|
2588 - | .ok_or(ConstraintViolation::MissingRequiredBoolean)?,
|
2589 - | required_string: self
|
2590 - | .required_string
|
2591 - | .ok_or(ConstraintViolation::MissingRequiredString)?,
|
2592 - | required_byte: self
|
2593 - | .required_byte
|
2594 - | .ok_or(ConstraintViolation::MissingRequiredByte)?,
|
2595 - | required_short: self
|
2596 - | .required_short
|
2597 - | .ok_or(ConstraintViolation::MissingRequiredShort)?,
|
2598 - | required_integer: self
|
2599 - | .required_integer
|
2600 - | .ok_or(ConstraintViolation::MissingRequiredInteger)?,
|
2601 - | required_long: self
|
2602 - | .required_long
|
2603 - | .ok_or(ConstraintViolation::MissingRequiredLong)?,
|
2604 - | required_float: self
|
2605 - | .required_float
|
2606 - | .ok_or(ConstraintViolation::MissingRequiredFloat)?,
|
2607 - | required_double: self
|
2608 - | .required_double
|
2609 - | .ok_or(ConstraintViolation::MissingRequiredDouble)?,
|
2610 - | required_timestamp: self
|
2611 - | .required_timestamp
|
2612 - | .ok_or(ConstraintViolation::MissingRequiredTimestamp)?,
|
2613 - | required_enum: self
|
2614 - | .required_enum
|
2615 - | .map(|v| match v {
|
2616 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2617 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2618 - | })
|
2619 - | .map(|res| res.map_err(ConstraintViolation::RequiredEnum))
|
2620 - | .transpose()?
|
2621 - | .ok_or(ConstraintViolation::MissingRequiredEnum)?,
|
2617 + | ) -> Result<crate::input::StreamingOperationWithOptionalDataInput, ConstraintViolation>
|
2618 + | {
|
2619 + | Ok(crate::input::StreamingOperationWithOptionalDataInput {
|
2620 + | optional_data: self.optional_data,
|
2621 + | events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
|
2622 2622 | })
|
2623 2623 | }
|
2624 2624 | }
|
2625 2625 | }
|