1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | #[allow(missing_docs)] // documentation missing in model
|
3 + | #[derive(::std::fmt::Debug)]
|
4 + | pub struct StreamingOperationWithOptionalDataInput {
|
5 + | #[allow(missing_docs)] // documentation missing in model
|
6 + | pub optional_data: ::std::option::Option<::std::string::String>,
|
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 {
|
14 + | #[allow(missing_docs)] // documentation missing in model
|
15 + | pub fn optional_data(&self) -> ::std::option::Option<&str> {
|
16 + | self.optional_data.as_deref()
|
17 + | }
|
18 + | #[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 {
|
41 + | #[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 {
|
48 + | #[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 {
|
71 + | #[allow(missing_docs)] // documentation missing in model
|
72 + | pub initial_data: ::std::string::String,
|
73 + | #[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 {
|
80 + | #[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 + | }
|
85 + | #[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 {
|
108 + | #[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 {
|
115 + | #[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 {
|
140 + | #[allow(missing_docs)] // documentation missing in model
|
141 + | pub nested: ::std::option::Option<crate::model::RecursiveOperationInputOutputNested1>,
|
142 + | }
|
143 + | impl RecursiveUnionOperationInput {
|
144 + | #[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 {
|
166 + | #[allow(missing_docs)] // documentation missing in model
|
167 + | pub message: ::std::option::Option<::std::string::String>,
|
168 + | }
|
169 + | impl SingleMemberStructOperationInput {
|
170 + | #[allow(missing_docs)] // documentation missing in model
|
171 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
172 + | self.message.as_deref()
|
173 + | }
|
174 + | }
|
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()
|
179 + | }
|
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()
|
194 + | }
|
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 + | #[allow(missing_docs)] // documentation missing in model
|
204 + | pub structure: ::std::option::Option<crate::model::SimpleStruct>,
|
205 + | #[allow(missing_docs)] // documentation missing in model
|
206 + | pub empty_structure: ::std::option::Option<crate::model::EmptyStruct>,
|
207 + | #[allow(missing_docs)] // documentation missing in model
|
208 + | pub list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
209 + | #[allow(missing_docs)] // documentation missing in model
|
210 + | pub map: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
211 + | #[allow(missing_docs)] // documentation missing in model
|
212 + | pub union: ::std::option::Option<crate::model::SimpleUnion>,
|
213 + | #[allow(missing_docs)] // documentation missing in model
|
214 + | pub unit_union: ::std::option::Option<crate::model::UnitUnion>,
|
215 + | #[allow(missing_docs)] // documentation missing in model
|
216 + | pub structure_list: ::std::option::Option<::std::vec::Vec<crate::model::SimpleStruct>>,
|
217 + | #[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 + | >,
|
221 + | #[allow(missing_docs)] // documentation missing in model
|
222 + | pub complex_map: ::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>,
|
223 + | #[allow(missing_docs)] // documentation missing in model
|
224 + | pub complex_union: ::std::boxed::Box<crate::model::ComplexUnion>,
|
225 + | }
|
226 + | impl ComplexStructOperationInput {
|
227 + | #[allow(missing_docs)] // documentation missing in model
|
228 + | pub fn structure(&self) -> ::std::option::Option<&crate::model::SimpleStruct> {
|
229 + | self.structure.as_ref()
|
230 + | }
|
231 + | #[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()
|
234 + | }
|
235 + | #[allow(missing_docs)] // documentation missing in model
|
236 + | pub fn list(&self) -> ::std::option::Option<&[::std::string::String]> {
|
237 + | self.list.as_deref()
|
238 + | }
|
239 + | #[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()
|
244 + | }
|
245 + | #[allow(missing_docs)] // documentation missing in model
|
246 + | pub fn union(&self) -> ::std::option::Option<&crate::model::SimpleUnion> {
|
247 + | self.union.as_ref()
|
248 + | }
|
249 + | #[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()
|
252 + | }
|
253 + | #[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()
|
256 + | }
|
257 + | #[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()
|
263 + | }
|
264 + | #[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
|
269 + | }
|
270 + | #[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()
|
274 + | }
|
275 + | }
|
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()
|
280 + | }
|
281 + | }
|
282 + | impl crate::constrained::Constrained for crate::input::ComplexStructOperationInput {
|
283 + | type Unconstrained = crate::input::complex_struct_operation_input::Builder;
|
284 + | }
|
285 + |
|
286 + | #[allow(missing_docs)] // documentation missing in model
|
287 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
288 + | pub struct ErrorSerializationOperationInput {
|
289 + | #[allow(missing_docs)] // documentation missing in model
|
290 + | pub blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
291 + | #[allow(missing_docs)] // documentation missing in model
|
292 + | pub boolean: ::std::option::Option<bool>,
|
293 + | #[allow(missing_docs)] // documentation missing in model
|
294 + | pub string: ::std::option::Option<::std::string::String>,
|
295 + | #[allow(missing_docs)] // documentation missing in model
|
296 + | pub byte: ::std::option::Option<i8>,
|
297 + | #[allow(missing_docs)] // documentation missing in model
|
298 + | pub short: ::std::option::Option<i16>,
|
299 + | #[allow(missing_docs)] // documentation missing in model
|
300 + | pub integer: ::std::option::Option<i32>,
|
301 + | #[allow(missing_docs)] // documentation missing in model
|
302 + | pub long: ::std::option::Option<i64>,
|
303 + | #[allow(missing_docs)] // documentation missing in model
|
304 + | pub float: ::std::option::Option<f32>,
|
305 + | #[allow(missing_docs)] // documentation missing in model
|
306 + | pub double: ::std::option::Option<f64>,
|
307 + | #[allow(missing_docs)] // documentation missing in model
|
308 + | pub timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
309 + | #[allow(missing_docs)] // documentation missing in model
|
310 + | pub r#enum: ::std::option::Option<crate::model::Suit>,
|
311 + | #[allow(missing_docs)] // documentation missing in model
|
312 + | pub required_blob: ::aws_smithy_types::Blob,
|
313 + | #[allow(missing_docs)] // documentation missing in model
|
314 + | pub required_boolean: bool,
|
315 + | #[allow(missing_docs)] // documentation missing in model
|
316 + | pub required_string: ::std::string::String,
|
317 + | #[allow(missing_docs)] // documentation missing in model
|
318 + | pub required_byte: i8,
|
319 + | #[allow(missing_docs)] // documentation missing in model
|
320 + | pub required_short: i16,
|
321 + | #[allow(missing_docs)] // documentation missing in model
|
322 + | pub required_integer: i32,
|
323 + | #[allow(missing_docs)] // documentation missing in model
|
324 + | pub required_long: i64,
|
325 + | #[allow(missing_docs)] // documentation missing in model
|
326 + | pub required_float: f32,
|
327 + | #[allow(missing_docs)] // documentation missing in model
|
328 + | pub required_double: f64,
|
329 + | #[allow(missing_docs)] // documentation missing in model
|
330 + | pub required_timestamp: ::aws_smithy_types::DateTime,
|
331 + | #[allow(missing_docs)] // documentation missing in model
|
332 + | pub required_enum: crate::model::Suit,
|
333 + | }
|
334 + | impl ErrorSerializationOperationInput {
|
335 + | #[allow(missing_docs)] // documentation missing in model
|
336 + | pub fn blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
337 + | self.blob.as_ref()
|
338 + | }
|
339 + | #[allow(missing_docs)] // documentation missing in model
|
340 + | pub fn boolean(&self) -> ::std::option::Option<bool> {
|
341 + | self.boolean
|
342 + | }
|
343 + | #[allow(missing_docs)] // documentation missing in model
|
344 + | pub fn string(&self) -> ::std::option::Option<&str> {
|
345 + | self.string.as_deref()
|
346 + | }
|
347 + | #[allow(missing_docs)] // documentation missing in model
|
348 + | pub fn byte(&self) -> ::std::option::Option<i8> {
|
349 + | self.byte
|
350 + | }
|
351 + | #[allow(missing_docs)] // documentation missing in model
|
352 + | pub fn short(&self) -> ::std::option::Option<i16> {
|
353 + | self.short
|
354 + | }
|
355 + | #[allow(missing_docs)] // documentation missing in model
|
356 + | pub fn integer(&self) -> ::std::option::Option<i32> {
|
357 + | self.integer
|
358 + | }
|
359 + | #[allow(missing_docs)] // documentation missing in model
|
360 + | pub fn long(&self) -> ::std::option::Option<i64> {
|
361 + | self.long
|
362 + | }
|
363 + | #[allow(missing_docs)] // documentation missing in model
|
364 + | pub fn float(&self) -> ::std::option::Option<f32> {
|
365 + | self.float
|
366 + | }
|
367 + | #[allow(missing_docs)] // documentation missing in model
|
368 + | pub fn double(&self) -> ::std::option::Option<f64> {
|
369 + | self.double
|
370 + | }
|
371 + | #[allow(missing_docs)] // documentation missing in model
|
372 + | pub fn timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
373 + | self.timestamp.as_ref()
|
374 + | }
|
375 + | #[allow(missing_docs)] // documentation missing in model
|
376 + | pub fn r#enum(&self) -> ::std::option::Option<&crate::model::Suit> {
|
377 + | self.r#enum.as_ref()
|
378 + | }
|
379 + | #[allow(missing_docs)] // documentation missing in model
|
380 + | pub fn required_blob(&self) -> &::aws_smithy_types::Blob {
|
381 + | &self.required_blob
|
382 + | }
|
383 + | #[allow(missing_docs)] // documentation missing in model
|
384 + | pub fn required_boolean(&self) -> bool {
|
385 + | self.required_boolean
|
386 + | }
|
387 + | #[allow(missing_docs)] // documentation missing in model
|
388 + | pub fn required_string(&self) -> &str {
|
389 + | use std::ops::Deref;
|
390 + | self.required_string.deref()
|
391 + | }
|
392 + | #[allow(missing_docs)] // documentation missing in model
|
393 + | pub fn required_byte(&self) -> i8 {
|
394 + | self.required_byte
|
395 + | }
|
396 + | #[allow(missing_docs)] // documentation missing in model
|
397 + | pub fn required_short(&self) -> i16 {
|
398 + | self.required_short
|
399 + | }
|
400 + | #[allow(missing_docs)] // documentation missing in model
|
401 + | pub fn required_integer(&self) -> i32 {
|
402 + | self.required_integer
|
403 + | }
|
404 + | #[allow(missing_docs)] // documentation missing in model
|
405 + | pub fn required_long(&self) -> i64 {
|
406 + | self.required_long
|
407 + | }
|
408 + | #[allow(missing_docs)] // documentation missing in model
|
409 + | pub fn required_float(&self) -> f32 {
|
410 + | self.required_float
|
411 + | }
|
412 + | #[allow(missing_docs)] // documentation missing in model
|
413 + | pub fn required_double(&self) -> f64 {
|
414 + | self.required_double
|
415 + | }
|
416 + | #[allow(missing_docs)] // documentation missing in model
|
417 + | pub fn required_timestamp(&self) -> &::aws_smithy_types::DateTime {
|
418 + | &self.required_timestamp
|
419 + | }
|
420 + | #[allow(missing_docs)] // documentation missing in model
|
421 + | pub fn required_enum(&self) -> &crate::model::Suit {
|
422 + | &self.required_enum
|
423 + | }
|
424 + | }
|
425 + | impl ErrorSerializationOperationInput {
|
426 + | /// Creates a new builder-style object to manufacture [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput).
|
427 + | pub fn builder() -> crate::input::error_serialization_operation_input::Builder {
|
428 + | crate::input::error_serialization_operation_input::Builder::default()
|
429 + | }
|
430 + | }
|
431 + | impl crate::constrained::Constrained for crate::input::ErrorSerializationOperationInput {
|
432 + | type Unconstrained = crate::input::error_serialization_operation_input::Builder;
|
433 + | }
|
434 + |
|
435 + | #[allow(missing_docs)] // documentation missing in model
|
436 + | #[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>,
|
442 + | #[allow(missing_docs)] // documentation missing in model
|
443 + | pub string: ::std::option::Option<::std::string::String>,
|
444 + | #[allow(missing_docs)] // documentation missing in model
|
445 + | pub byte: ::std::option::Option<i8>,
|
446 + | #[allow(missing_docs)] // documentation missing in model
|
447 + | pub short: ::std::option::Option<i16>,
|
448 + | #[allow(missing_docs)] // documentation missing in model
|
449 + | pub integer: ::std::option::Option<i32>,
|
450 + | #[allow(missing_docs)] // documentation missing in model
|
451 + | pub long: ::std::option::Option<i64>,
|
452 + | #[allow(missing_docs)] // documentation missing in model
|
453 + | pub float: ::std::option::Option<f32>,
|
454 + | #[allow(missing_docs)] // documentation missing in model
|
455 + | pub double: ::std::option::Option<f64>,
|
456 + | #[allow(missing_docs)] // documentation missing in model
|
457 + | pub timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
458 + | #[allow(missing_docs)] // documentation missing in model
|
459 + | pub r#enum: ::std::option::Option<crate::model::Suit>,
|
460 + | #[allow(missing_docs)] // documentation missing in model
|
461 + | pub required_blob: ::aws_smithy_types::Blob,
|
462 + | #[allow(missing_docs)] // documentation missing in model
|
463 + | pub required_boolean: bool,
|
464 + | #[allow(missing_docs)] // documentation missing in model
|
465 + | pub required_string: ::std::string::String,
|
466 + | #[allow(missing_docs)] // documentation missing in model
|
467 + | pub required_byte: i8,
|
468 + | #[allow(missing_docs)] // documentation missing in model
|
469 + | pub required_short: i16,
|
470 + | #[allow(missing_docs)] // documentation missing in model
|
471 + | pub required_integer: i32,
|
472 + | #[allow(missing_docs)] // documentation missing in model
|
473 + | pub required_long: i64,
|
474 + | #[allow(missing_docs)] // documentation missing in model
|
475 + | pub required_float: f32,
|
476 + | #[allow(missing_docs)] // documentation missing in model
|
477 + | pub required_double: f64,
|
478 + | #[allow(missing_docs)] // documentation missing in model
|
479 + | pub required_timestamp: ::aws_smithy_types::DateTime,
|
480 + | #[allow(missing_docs)] // documentation missing in model
|
481 + | pub required_enum: crate::model::Suit,
|
482 + | }
|
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()
|
487 + | }
|
488 + | #[allow(missing_docs)] // documentation missing in model
|
489 + | pub fn boolean(&self) -> ::std::option::Option<bool> {
|
490 + | self.boolean
|
491 + | }
|
492 + | #[allow(missing_docs)] // documentation missing in model
|
493 + | pub fn string(&self) -> ::std::option::Option<&str> {
|
494 + | self.string.as_deref()
|
495 + | }
|
496 + | #[allow(missing_docs)] // documentation missing in model
|
497 + | pub fn byte(&self) -> ::std::option::Option<i8> {
|
498 + | self.byte
|
499 + | }
|
500 + | #[allow(missing_docs)] // documentation missing in model
|
501 + | pub fn short(&self) -> ::std::option::Option<i16> {
|
502 + | self.short
|
503 + | }
|
504 + | #[allow(missing_docs)] // documentation missing in model
|
505 + | pub fn integer(&self) -> ::std::option::Option<i32> {
|
506 + | self.integer
|
507 + | }
|
508 + | #[allow(missing_docs)] // documentation missing in model
|
509 + | pub fn long(&self) -> ::std::option::Option<i64> {
|
510 + | self.long
|
511 + | }
|
512 + | #[allow(missing_docs)] // documentation missing in model
|
513 + | pub fn float(&self) -> ::std::option::Option<f32> {
|
514 + | self.float
|
515 + | }
|
516 + | #[allow(missing_docs)] // documentation missing in model
|
517 + | pub fn double(&self) -> ::std::option::Option<f64> {
|
518 + | self.double
|
519 + | }
|
520 + | #[allow(missing_docs)] // documentation missing in model
|
521 + | pub fn timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
522 + | self.timestamp.as_ref()
|
523 + | }
|
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()
|
527 + | }
|
528 + | #[allow(missing_docs)] // documentation missing in model
|
529 + | pub fn required_blob(&self) -> &::aws_smithy_types::Blob {
|
530 + | &self.required_blob
|
531 + | }
|
532 + | #[allow(missing_docs)] // documentation missing in model
|
533 + | pub fn required_boolean(&self) -> bool {
|
534 + | self.required_boolean
|
535 + | }
|
536 + | #[allow(missing_docs)] // documentation missing in model
|
537 + | pub fn required_string(&self) -> &str {
|
538 + | use std::ops::Deref;
|
539 + | self.required_string.deref()
|
540 + | }
|
541 + | #[allow(missing_docs)] // documentation missing in model
|
542 + | pub fn required_byte(&self) -> i8 {
|
543 + | self.required_byte
|
544 + | }
|
545 + | #[allow(missing_docs)] // documentation missing in model
|
546 + | pub fn required_short(&self) -> i16 {
|
547 + | self.required_short
|
548 + | }
|
549 + | #[allow(missing_docs)] // documentation missing in model
|
550 + | pub fn required_integer(&self) -> i32 {
|
551 + | self.required_integer
|
552 + | }
|
553 + | #[allow(missing_docs)] // documentation missing in model
|
554 + | pub fn required_long(&self) -> i64 {
|
555 + | self.required_long
|
556 + | }
|
557 + | #[allow(missing_docs)] // documentation missing in model
|
558 + | pub fn required_float(&self) -> f32 {
|
559 + | self.required_float
|
560 + | }
|
561 + | #[allow(missing_docs)] // documentation missing in model
|
562 + | pub fn required_double(&self) -> f64 {
|
563 + | self.required_double
|
564 + | }
|
565 + | #[allow(missing_docs)] // documentation missing in model
|
566 + | pub fn required_timestamp(&self) -> &::aws_smithy_types::DateTime {
|
567 + | &self.required_timestamp
|
568 + | }
|
569 + | #[allow(missing_docs)] // documentation missing in model
|
570 + | pub fn required_enum(&self) -> &crate::model::Suit {
|
571 + | &self.required_enum
|
572 + | }
|
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()
|
578 + | }
|
579 + | }
|
580 + | impl crate::constrained::Constrained for crate::input::SimpleStructOperationInput {
|
581 + | type Unconstrained = crate::input::simple_struct_operation_input::Builder;
|
582 + | }
|
583 + | /// See [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
|
584 + | pub mod streaming_operation_with_optional_data_input {
|
585 + |
|
586 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
587 + | /// Holds one variant for each of the ways the builder can fail.
|
588 + | #[non_exhaustive]
|
589 + | #[allow(clippy::enum_variant_names)]
|
590 + | pub enum ConstraintViolation {
|
591 + | /// `events` was not provided but it is required when building `StreamingOperationWithOptionalDataInput`.
|
592 + | MissingEvents,
|
593 + | }
|
594 + | impl ::std::fmt::Display for ConstraintViolation {
|
595 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
596 + | match self {
|
597 + | ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `StreamingOperationWithOptionalDataInput`"),
|
598 + | }
|
599 + | }
|
600 + | }
|
601 + | impl ::std::error::Error for ConstraintViolation {}
|
602 + | impl ConstraintViolation {
|
603 + | pub(crate) fn as_validation_exception_field(
|
604 + | self,
|
605 + | path: ::std::string::String,
|
606 + | ) -> crate::model::ValidationExceptionField {
|
607 + | 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",
|
611 + | },
|
612 + | }
|
613 + | }
|
614 + | }
|
615 + | impl ::std::convert::From<ConstraintViolation>
|
616 + | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
617 + | {
|
618 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
619 + | let first_validation_exception_field =
|
620 + | constraint_violation.as_validation_exception_field("".to_owned());
|
621 + | let validation_exception = crate::error::ValidationException {
|
622 + | message: format!(
|
623 + | "1 validation error detected. {}",
|
624 + | &first_validation_exception_field.message
|
625 + | ),
|
626 + | field_list: Some(vec![first_validation_exception_field]),
|
627 + | };
|
628 + | Self::ConstraintViolation(
|
629 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
630 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
631 + | )
|
632 + | }
|
633 + | }
|
634 + | impl ::std::convert::From<Builder>
|
635 + | for crate::constrained::MaybeConstrained<
|
636 + | crate::input::StreamingOperationWithOptionalDataInput,
|
637 + | >
|
638 + | {
|
639 + | fn from(builder: Builder) -> Self {
|
640 + | Self::Unconstrained(builder)
|
641 + | }
|
642 + | }
|
643 + | impl ::std::convert::TryFrom<Builder> for crate::input::StreamingOperationWithOptionalDataInput {
|
644 + | type Error = ConstraintViolation;
|
645 + |
|
646 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
647 + | builder.build()
|
648 + | }
|
649 + | }
|
650 + | /// A builder for [`StreamingOperationWithOptionalDataInput`](crate::input::StreamingOperationWithOptionalDataInput).
|
651 + | #[derive(::std::default::Default, ::std::fmt::Debug)]
|
652 + | 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 + | >,
|
660 + | }
|
661 + | impl Builder {
|
662 + | #[allow(missing_docs)] // documentation missing in model
|
663 + | pub fn optional_data(
|
664 + | mut self,
|
665 + | input: ::std::option::Option<::std::string::String>,
|
666 + | ) -> Self {
|
667 + | self.optional_data = input;
|
668 + | self
|
669 + | }
|
670 + | #[allow(missing_docs)] // documentation missing in model
|
671 + | pub(crate) fn set_optional_data(
|
672 + | mut self,
|
673 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
674 + | ) -> Self {
|
675 + | self.optional_data = input.map(|v| v.into());
|
676 + | self
|
677 + | }
|
678 + | #[allow(missing_docs)] // documentation missing in model
|
679 + | pub fn events(
|
680 + | mut self,
|
681 + | input: crate::sigv4_event_stream::SigV4Receiver<
|
682 + | crate::model::Events,
|
683 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
684 + | >,
|
685 + | ) -> Self {
|
686 + | self.events = Some(input);
|
687 + | self
|
688 + | }
|
689 + | #[allow(missing_docs)] // documentation missing in model
|
690 + | pub(crate) fn set_events(
|
691 + | 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 + | >,
|
697 + | >,
|
698 + | ) -> Self {
|
699 + | self.events = Some(input.into());
|
700 + | self
|
701 + | }
|
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()
|
711 + | }
|
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 + | })
|
720 + | }
|
721 + | }
|
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,
|
733 + | }
|
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`"),
|
738 + | }
|
739 + | }
|
740 + | }
|
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 + | },
|
752 + | }
|
753 + | }
|
754 + | }
|
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 + | )
|
772 + | }
|
773 + | }
|
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)
|
781 + | }
|
782 + | }
|
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()
|
788 + | }
|
789 + | }
|
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 + | >,
|
799 + | }
|
800 + | impl Builder {
|
801 + | #[allow(missing_docs)] // documentation missing in model
|
802 + | pub fn events(
|
803 + | mut self,
|
804 + | input: crate::sigv4_event_stream::SigV4Receiver<
|
805 + | crate::model::Events,
|
806 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
807 + | >,
|
808 + | ) -> Self {
|
809 + | self.events = Some(input);
|
810 + | self
|
811 + | }
|
812 + | #[allow(missing_docs)] // documentation missing in model
|
813 + | pub(crate) fn set_events(
|
814 + | 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 + | >,
|
821 + | ) -> Self {
|
822 + | self.events = Some(input.into());
|
823 + | self
|
824 + | }
|
825 + | /// Consumes the builder and constructs a [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput).
|
826 + | ///
|
827 + | /// The builder fails to construct a [`StreamingOperationWithInitialResponseInput`](crate::input::StreamingOperationWithInitialResponseInput) if a [`ConstraintViolation`] occurs.
|
828 + | ///
|
829 + | pub fn build(
|
830 + | self,
|
831 + | ) -> Result<crate::input::StreamingOperationWithInitialResponseInput, ConstraintViolation>
|
832 + | {
|
833 + | self.build_enforcing_all_constraints()
|
834 + | }
|
835 + | fn build_enforcing_all_constraints(
|
836 + | self,
|
837 + | ) -> Result<crate::input::StreamingOperationWithInitialResponseInput, ConstraintViolation>
|
838 + | {
|
839 + | Ok(crate::input::StreamingOperationWithInitialResponseInput {
|
840 + | events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
|
841 + | })
|
842 + | }
|
843 + | }
|
844 + | }
|
845 + | /// See [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
|
846 + | pub mod streaming_operation_with_initial_data_input {
|
847 + |
|
848 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
849 + | /// Holds one variant for each of the ways the builder can fail.
|
850 + | #[non_exhaustive]
|
851 + | #[allow(clippy::enum_variant_names)]
|
852 + | 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,
|
857 + | }
|
858 + | impl ::std::fmt::Display for ConstraintViolation {
|
859 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
860 + | 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`"),
|
863 + | }
|
864 + | }
|
865 + | }
|
866 + | impl ::std::error::Error for ConstraintViolation {}
|
867 + | impl ConstraintViolation {
|
868 + | pub(crate) fn as_validation_exception_field(
|
869 + | self,
|
870 + | path: ::std::string::String,
|
871 + | ) -> crate::model::ValidationExceptionField {
|
872 + | 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",
|
876 + | },
|
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",
|
880 + | },
|
881 + | }
|
882 + | }
|
883 + | }
|
884 + | impl ::std::convert::From<ConstraintViolation>
|
885 + | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
886 + | {
|
887 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
888 + | let first_validation_exception_field =
|
889 + | constraint_violation.as_validation_exception_field("".to_owned());
|
890 + | let validation_exception = crate::error::ValidationException {
|
891 + | message: format!(
|
892 + | "1 validation error detected. {}",
|
893 + | &first_validation_exception_field.message
|
894 + | ),
|
895 + | field_list: Some(vec![first_validation_exception_field]),
|
896 + | };
|
897 + | Self::ConstraintViolation(
|
898 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
899 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
900 + | )
|
901 + | }
|
902 + | }
|
903 + | impl ::std::convert::From<Builder>
|
904 + | for crate::constrained::MaybeConstrained<
|
905 + | crate::input::StreamingOperationWithInitialDataInput,
|
906 + | >
|
907 + | {
|
908 + | fn from(builder: Builder) -> Self {
|
909 + | Self::Unconstrained(builder)
|
910 + | }
|
911 + | }
|
912 + | impl ::std::convert::TryFrom<Builder> for crate::input::StreamingOperationWithInitialDataInput {
|
913 + | type Error = ConstraintViolation;
|
914 + |
|
915 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
916 + | builder.build()
|
917 + | }
|
918 + | }
|
919 + | /// A builder for [`StreamingOperationWithInitialDataInput`](crate::input::StreamingOperationWithInitialDataInput).
|
920 + | #[derive(::std::default::Default, ::std::fmt::Debug)]
|
921 + | 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 + | >,
|
929 + | }
|
930 + | impl Builder {
|
931 + | #[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);
|
934 + | self
|
935 + | }
|
936 + | #[allow(missing_docs)] // documentation missing in model
|
937 + | pub(crate) fn set_initial_data(
|
938 + | mut self,
|
939 + | input: impl ::std::convert::Into<::std::string::String>,
|
940 + | ) -> Self {
|
941 + | self.initial_data = Some(input.into());
|
942 + | self
|
943 + | }
|
944 + | #[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);
|
953 + | self
|
954 + | }
|
955 + | #[allow(missing_docs)] // documentation missing in model
|
956 + | pub(crate) fn set_events(
|
957 + | 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 + | >,
|
964 + | ) -> Self {
|
965 + | self.events = Some(input.into());
|
966 + | self
|
967 + | }
|
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,
|
1002 + | }
|
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`"),
|
1007 + | }
|
1008 + | }
|
1009 + | }
|
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 + | },
|
1021 + | }
|
1022 + | }
|
1023 + | }
|
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 + | )
|
1041 + | }
|
1042 + | }
|
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)
|
1048 + | }
|
1049 + | }
|
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()
|
1055 + | }
|
1056 + | }
|
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 + | >,
|
1066 + | }
|
1067 + | impl Builder {
|
1068 + | #[allow(missing_docs)] // documentation missing in model
|
1069 + | pub fn events(
|
1070 + | mut self,
|
1071 + | input: crate::sigv4_event_stream::SigV4Receiver<
|
1072 + | crate::model::Events,
|
1073 + | ::aws_smithy_legacy_http::event_stream::MessageStreamError,
|
1074 + | >,
|
1075 + | ) -> Self {
|
1076 + | self.events = Some(input);
|
1077 + | self
|
1078 + | }
|
1079 + | #[allow(missing_docs)] // documentation missing in model
|
1080 + | pub(crate) fn set_events(
|
1081 + | 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 + | >,
|
1088 + | ) -> Self {
|
1089 + | self.events = Some(input.into());
|
1090 + | self
|
1091 + | }
|
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 + | })
|
1105 + | }
|
1106 + | }
|
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()
|
1114 + | }
|
1115 + | }
|
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>,
|
1121 + | }
|
1122 + | impl Builder {
|
1123 + | #[allow(missing_docs)] // documentation missing in model
|
1124 + | pub fn nested(
|
1125 + | mut self,
|
1126 + | input: ::std::option::Option<crate::model::RecursiveOperationInputOutputNested1>,
|
1127 + | ) -> Self {
|
1128 + | self.nested = input;
|
1129 + | self
|
1130 + | }
|
1131 + | #[allow(missing_docs)] // documentation missing in model
|
1132 + | pub(crate) fn set_nested(
|
1133 + | mut self,
|
1134 + | input: Option<
|
1135 + | impl ::std::convert::Into<crate::model::RecursiveOperationInputOutputNested1>,
|
1136 + | >,
|
1137 + | ) -> Self {
|
1138 + | self.nested = input.map(|v| v.into());
|
1139 + | self
|
1140 + | }
|
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()
|
1144 + | }
|
1145 + | fn build_enforcing_all_constraints(self) -> crate::input::RecursiveUnionOperationInput {
|
1146 + | crate::input::RecursiveUnionOperationInput {
|
1147 + | nested: self.nested,
|
1148 + | }
|
1149 + | }
|
1150 + | }
|
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()
|
1158 + | }
|
1159 + | }
|
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>,
|
1164 + | }
|
1165 + | impl Builder {
|
1166 + | #[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;
|
1169 + | self
|
1170 + | }
|
1171 + | #[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());
|
1177 + | self
|
1178 + | }
|
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()
|
1182 + | }
|
1183 + | fn build_enforcing_all_constraints(self) -> crate::input::SingleMemberStructOperationInput {
|
1184 + | crate::input::SingleMemberStructOperationInput {
|
1185 + | message: self.message,
|
1186 + | }
|
1187 + | }
|
1188 + | }
|
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()
|
1196 + | }
|
1197 + | }
|
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 {
|
1204 + | self.build_enforcing_all_constraints()
|
1205 + | }
|
1206 + | fn build_enforcing_all_constraints(self) -> crate::input::EmptyStructOperationInput {
|
1207 + | crate::input::EmptyStructOperationInput {}
|
1208 + | }
|
1209 + | }
|
1210 + | }
|
1211 + | /// See [`ComplexStructOperationInput`](crate::input::ComplexStructOperationInput).
|
1212 + | pub mod complex_struct_operation_input {
|
1213 + |
|
1214 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1215 + | /// Holds one variant for each of the ways the builder can fail.
|
1216 + | #[non_exhaustive]
|
1217 + | #[allow(clippy::enum_variant_names)]
|
1218 + | pub enum ConstraintViolation {
|
1219 + | /// Constraint violation occurred building member `structure` when building `ComplexStructOperationInput`.
|
1220 + | #[doc(hidden)]
|
1221 + | Structure(crate::model::simple_struct::ConstraintViolation),
|
1222 + | /// Constraint violation occurred building member `structure_list` when building `ComplexStructOperationInput`.
|
1223 + | #[doc(hidden)]
|
1224 + | StructureList(crate::model::struct_list::ConstraintViolation),
|
1225 + | /// `complex_list` was not provided but it is required when building `ComplexStructOperationInput`.
|
1226 + | MissingComplexList,
|
1227 + | /// Constraint violation occurred building member `complex_list` when building `ComplexStructOperationInput`.
|
1228 + | #[doc(hidden)]
|
1229 + | ComplexList(crate::model::complex_list::ConstraintViolation),
|
1230 + | /// `complex_map` was not provided but it is required when building `ComplexStructOperationInput`.
|
1231 + | MissingComplexMap,
|
1232 + | /// Constraint violation occurred building member `complex_map` when building `ComplexStructOperationInput`.
|
1233 + | #[doc(hidden)]
|
1234 + | ComplexMap(crate::model::complex_map::ConstraintViolation),
|
1235 + | /// `complex_union` was not provided but it is required when building `ComplexStructOperationInput`.
|
1236 + | MissingComplexUnion,
|
1237 + | /// Constraint violation occurred building member `complex_union` when building `ComplexStructOperationInput`.
|
1238 + | #[doc(hidden)]
|
1239 + | ComplexUnion(::std::boxed::Box<crate::model::complex_union::ConstraintViolation>),
|
1240 + | }
|
1241 + | impl ::std::fmt::Display for ConstraintViolation {
|
1242 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1243 + | match self {
|
1244 + | ConstraintViolation::Structure(_) => write!(f, "constraint violation occurred building member `structure` when building `ComplexStructOperationInput`"),
|
1245 + | ConstraintViolation::StructureList(_) => write!(f, "constraint violation occurred building member `structure_list` when building `ComplexStructOperationInput`"),
|
1246 + | ConstraintViolation::MissingComplexList => write!(f, "`complex_list` was not provided but it is required when building `ComplexStructOperationInput`"),
|
1247 + | ConstraintViolation::ComplexList(_) => write!(f, "constraint violation occurred building member `complex_list` when building `ComplexStructOperationInput`"),
|
1248 + | ConstraintViolation::MissingComplexMap => write!(f, "`complex_map` was not provided but it is required when building `ComplexStructOperationInput`"),
|
1249 + | ConstraintViolation::ComplexMap(_) => write!(f, "constraint violation occurred building member `complex_map` when building `ComplexStructOperationInput`"),
|
1250 + | ConstraintViolation::MissingComplexUnion => write!(f, "`complex_union` was not provided but it is required when building `ComplexStructOperationInput`"),
|
1251 + | ConstraintViolation::ComplexUnion(_) => write!(f, "constraint violation occurred building member `complex_union` when building `ComplexStructOperationInput`"),
|
1252 + | }
|
1253 + | }
|
1254 + | }
|
1255 + | impl ::std::error::Error for ConstraintViolation {}
|
1256 + | impl ConstraintViolation {
|
1257 + | pub(crate) fn as_validation_exception_field(
|
1258 + | self,
|
1259 + | path: ::std::string::String,
|
1260 + | ) -> crate::model::ValidationExceptionField {
|
1261 + | match self {
|
1262 + | ConstraintViolation::Structure(inner) => inner.as_validation_exception_field(path + "/structure"),
|
1263 + | ConstraintViolation::StructureList(inner) => inner.as_validation_exception_field(path + "/structureList"),
|
1264 + | ConstraintViolation::MissingComplexList => crate::model::ValidationExceptionField {
|
1265 + | message: format!("Value at '{}/complexList' failed to satisfy constraint: Member must not be null", path),
|
1266 + | path: path + "/complexList",
|
1267 + | },
|
1268 + | ConstraintViolation::ComplexList(inner) => inner.as_validation_exception_field(path + "/complexList"),
|
1269 + | ConstraintViolation::MissingComplexMap => crate::model::ValidationExceptionField {
|
1270 + | message: format!("Value at '{}/complexMap' failed to satisfy constraint: Member must not be null", path),
|
1271 + | path: path + "/complexMap",
|
1272 + | },
|
1273 + | ConstraintViolation::ComplexMap(inner) => inner.as_validation_exception_field(path + "/complexMap"),
|
1274 + | ConstraintViolation::MissingComplexUnion => crate::model::ValidationExceptionField {
|
1275 + | message: format!("Value at '{}/complexUnion' failed to satisfy constraint: Member must not be null", path),
|
1276 + | path: path + "/complexUnion",
|
1277 + | },
|
1278 + | ConstraintViolation::ComplexUnion(inner) => inner.as_validation_exception_field(path + "/complexUnion"),
|
1279 + | }
|
1280 + | }
|
1281 + | }
|
1282 + | impl ::std::convert::From<ConstraintViolation>
|
1283 + | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
1284 + | {
|
1285 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1286 + | let first_validation_exception_field =
|
1287 + | constraint_violation.as_validation_exception_field("".to_owned());
|
1288 + | let validation_exception = crate::error::ValidationException {
|
1289 + | message: format!(
|
1290 + | "1 validation error detected. {}",
|
1291 + | &first_validation_exception_field.message
|
1292 + | ),
|
1293 + | field_list: Some(vec![first_validation_exception_field]),
|
1294 + | };
|
1295 + | Self::ConstraintViolation(
|
1296 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1297 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1298 + | )
|
1299 + | }
|
1300 + | }
|
1301 + | impl ::std::convert::From<Builder>
|
1302 + | for crate::constrained::MaybeConstrained<crate::input::ComplexStructOperationInput>
|
1303 + | {
|
1304 + | fn from(builder: Builder) -> Self {
|
1305 + | Self::Unconstrained(builder)
|
1306 + | }
|
1307 + | }
|
1308 + | impl ::std::convert::TryFrom<Builder> for crate::input::ComplexStructOperationInput {
|
1309 + | type Error = ConstraintViolation;
|
1310 + |
|
1311 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1312 + | builder.build()
|
1313 + | }
|
1314 + | }
|
1315 + | /// A builder for [`ComplexStructOperationInput`](crate::input::ComplexStructOperationInput).
|
1316 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1317 + | pub struct Builder {
|
1318 + | pub(crate) structure:
|
1319 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SimpleStruct>>,
|
1320 + | pub(crate) empty_structure: ::std::option::Option<crate::model::EmptyStruct>,
|
1321 + | pub(crate) list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1322 + | pub(crate) map:
|
1323 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
1324 + | pub(crate) union: ::std::option::Option<crate::model::SimpleUnion>,
|
1325 + | pub(crate) unit_union: ::std::option::Option<crate::model::UnitUnion>,
|
1326 + | pub(crate) structure_list: ::std::option::Option<
|
1327 + | crate::constrained::MaybeConstrained<
|
1328 + | crate::constrained::struct_list_constrained::StructListConstrained,
|
1329 + | >,
|
1330 + | >,
|
1331 + | pub(crate) complex_list: ::std::option::Option<
|
1332 + | crate::constrained::MaybeConstrained<
|
1333 + | crate::constrained::complex_list_constrained::ComplexListConstrained,
|
1334 + | >,
|
1335 + | >,
|
1336 + | pub(crate) complex_map: ::std::option::Option<
|
1337 + | crate::constrained::MaybeConstrained<
|
1338 + | crate::constrained::complex_map_constrained::ComplexMapConstrained,
|
1339 + | >,
|
1340 + | >,
|
1341 + | pub(crate) complex_union: ::std::option::Option<
|
1342 + | ::std::boxed::Box<crate::constrained::MaybeConstrained<crate::model::ComplexUnion>>,
|
1343 + | >,
|
1344 + | }
|
1345 + | impl Builder {
|
1346 + | #[allow(missing_docs)] // documentation missing in model
|
1347 + | pub fn structure(
|
1348 + | mut self,
|
1349 + | input: ::std::option::Option<crate::model::SimpleStruct>,
|
1350 + | ) -> Self {
|
1351 + | self.structure = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1352 + | self
|
1353 + | }
|
1354 + | #[allow(missing_docs)] // documentation missing in model
|
1355 + | pub(crate) fn set_structure(
|
1356 + | mut self,
|
1357 + | input: Option<
|
1358 + | impl ::std::convert::Into<
|
1359 + | crate::constrained::MaybeConstrained<crate::model::SimpleStruct>,
|
1360 + | >,
|
1361 + | >,
|
1362 + | ) -> Self {
|
1363 + | self.structure = input.map(|v| v.into());
|
1364 + | self
|
1365 + | }
|
1366 + | #[allow(missing_docs)] // documentation missing in model
|
1367 + | pub fn empty_structure(
|
1368 + | mut self,
|
1369 + | input: ::std::option::Option<crate::model::EmptyStruct>,
|
1370 + | ) -> Self {
|
1371 + | self.empty_structure = input;
|
1372 + | self
|
1373 + | }
|
1374 + | #[allow(missing_docs)] // documentation missing in model
|
1375 + | pub(crate) fn set_empty_structure(
|
1376 + | mut self,
|
1377 + | input: Option<impl ::std::convert::Into<crate::model::EmptyStruct>>,
|
1378 + | ) -> Self {
|
1379 + | self.empty_structure = input.map(|v| v.into());
|
1380 + | self
|
1381 + | }
|
1382 + | #[allow(missing_docs)] // documentation missing in model
|
1383 + | pub fn list(
|
1384 + | mut self,
|
1385 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1386 + | ) -> Self {
|
1387 + | self.list = input;
|
1388 + | self
|
1389 + | }
|
1390 + | #[allow(missing_docs)] // documentation missing in model
|
1391 + | pub(crate) fn set_list(
|
1392 + | mut self,
|
1393 + | input: Option<impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>>,
|
1394 + | ) -> Self {
|
1395 + | self.list = input.map(|v| v.into());
|
1396 + | self
|
1397 + | }
|
1398 + | #[allow(missing_docs)] // documentation missing in model
|
1399 + | pub fn map(
|
1400 + | mut self,
|
1401 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
1402 + | ) -> Self {
|
1403 + | self.map = input;
|
1404 + | self
|
1405 + | }
|
1406 + | #[allow(missing_docs)] // documentation missing in model
|
1407 + | pub(crate) fn set_map(
|
1408 + | mut self,
|
1409 + | input: Option<
|
1410 + | impl ::std::convert::Into<::std::collections::HashMap<::std::string::String, i32>>,
|
1411 + | >,
|
1412 + | ) -> Self {
|
1413 + | self.map = input.map(|v| v.into());
|
1414 + | self
|
1415 + | }
|
1416 + | #[allow(missing_docs)] // documentation missing in model
|
1417 + | pub fn union(mut self, input: ::std::option::Option<crate::model::SimpleUnion>) -> Self {
|
1418 + | self.union = input;
|
1419 + | self
|
1420 + | }
|
1421 + | #[allow(missing_docs)] // documentation missing in model
|
1422 + | pub(crate) fn set_union(
|
1423 + | mut self,
|
1424 + | input: Option<impl ::std::convert::Into<crate::model::SimpleUnion>>,
|
1425 + | ) -> Self {
|
1426 + | self.union = input.map(|v| v.into());
|
1427 + | self
|
1428 + | }
|
1429 + | #[allow(missing_docs)] // documentation missing in model
|
1430 + | pub fn unit_union(mut self, input: ::std::option::Option<crate::model::UnitUnion>) -> Self {
|
1431 + | self.unit_union = input;
|
1432 + | self
|
1433 + | }
|
1434 + | #[allow(missing_docs)] // documentation missing in model
|
1435 + | pub(crate) fn set_unit_union(
|
1436 + | mut self,
|
1437 + | input: Option<impl ::std::convert::Into<crate::model::UnitUnion>>,
|
1438 + | ) -> Self {
|
1439 + | self.unit_union = input.map(|v| v.into());
|
1440 + | self
|
1441 + | }
|
1442 + | #[allow(missing_docs)] // documentation missing in model
|
1443 + | pub fn structure_list(
|
1444 + | mut self,
|
1445 + | input: ::std::option::Option<::std::vec::Vec<crate::model::SimpleStruct>>,
|
1446 + | ) -> Self {
|
1447 + | self.structure_list =
|
1448 + | input.map(|v| crate::constrained::MaybeConstrained::Constrained((v).into()));
|
1449 + | self
|
1450 + | }
|
1451 + | #[allow(missing_docs)] // documentation missing in model
|
1452 + | pub(crate) fn set_structure_list(
|
1453 + | mut self,
|
1454 + | input: Option<
|
1455 + | impl ::std::convert::Into<
|
1456 + | crate::constrained::MaybeConstrained<
|
1457 + | crate::constrained::struct_list_constrained::StructListConstrained,
|
1458 + | >,
|
1459 + | >,
|
1460 + | >,
|
1461 + | ) -> Self {
|
1462 + | self.structure_list = input.map(|v| v.into());
|
1463 + | self
|
1464 + | }
|
1465 + | #[allow(missing_docs)] // documentation missing in model
|
1466 + | pub fn complex_list(
|
1467 + | mut self,
|
1468 + | input: ::std::vec::Vec<
|
1469 + | ::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>,
|
1470 + | >,
|
1471 + | ) -> Self {
|
1472 + | self.complex_list = Some(crate::constrained::MaybeConstrained::Constrained(
|
1473 + | (input).into(),
|
1474 + | ));
|
1475 + | self
|
1476 + | }
|
1477 + | #[allow(missing_docs)] // documentation missing in model
|
1478 + | pub(crate) fn set_complex_list(
|
1479 + | mut self,
|
1480 + | input: impl ::std::convert::Into<
|
1481 + | crate::constrained::MaybeConstrained<
|
1482 + | crate::constrained::complex_list_constrained::ComplexListConstrained,
|
1483 + | >,
|
1484 + | >,
|
1485 + | ) -> Self {
|
1486 + | self.complex_list = Some(input.into());
|
1487 + | self
|
1488 + | }
|
1489 + | #[allow(missing_docs)] // documentation missing in model
|
1490 + | pub fn complex_map(
|
1491 + | mut self,
|
1492 + | input: ::std::collections::HashMap<::std::string::String, crate::model::ComplexUnion>,
|
1493 + | ) -> Self {
|
1494 + | self.complex_map = Some(crate::constrained::MaybeConstrained::Constrained(
|
1495 + | (input).into(),
|
1496 + | ));
|
1497 + | self
|
1498 + | }
|
1499 + | #[allow(missing_docs)] // documentation missing in model
|
1500 + | pub(crate) fn set_complex_map(
|
1501 + | mut self,
|
1502 + | input: impl ::std::convert::Into<
|
1503 + | crate::constrained::MaybeConstrained<
|
1504 + | crate::constrained::complex_map_constrained::ComplexMapConstrained,
|
1505 + | >,
|
1506 + | >,
|
1507 + | ) -> Self {
|
1508 + | self.complex_map = Some(input.into());
|
1509 + | self
|
1510 + | }
|
1511 + | #[allow(missing_docs)] // documentation missing in model
|
1512 + | #[allow(clippy::boxed_local)]
|
1513 + | pub fn complex_union(
|
1514 + | mut self,
|
1515 + | input: ::std::boxed::Box<crate::model::ComplexUnion>,
|
1516 + | ) -> Self {
|
1517 + | self.complex_union = Some(Box::new(crate::constrained::MaybeConstrained::Constrained(
|
1518 + | *input,
|
1519 + | )));
|
1520 + | self
|
1521 + | }
|
1522 + | #[allow(missing_docs)] // documentation missing in model
|
1523 + | pub(crate) fn set_complex_union(
|
1524 + | mut self,
|
1525 + | input: impl ::std::convert::Into<
|
1526 + | ::std::boxed::Box<crate::constrained::MaybeConstrained<crate::model::ComplexUnion>>,
|
1527 + | >,
|
1528 + | ) -> Self {
|
1529 + | self.complex_union = Some(input.into());
|
1530 + | self
|
1531 + | }
|
1532 + | /// Consumes the builder and constructs a [`ComplexStructOperationInput`](crate::input::ComplexStructOperationInput).
|
1533 + | ///
|
1534 + | /// The builder fails to construct a [`ComplexStructOperationInput`](crate::input::ComplexStructOperationInput) if a [`ConstraintViolation`] occurs.
|
1535 + | ///
|
1536 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1537 + | pub fn build(
|
1538 + | self,
|
1539 + | ) -> Result<crate::input::ComplexStructOperationInput, ConstraintViolation> {
|
1540 + | self.build_enforcing_all_constraints()
|
1541 + | }
|
1542 + | fn build_enforcing_all_constraints(
|
1543 + | self,
|
1544 + | ) -> Result<crate::input::ComplexStructOperationInput, ConstraintViolation> {
|
1545 + | Ok(crate::input::ComplexStructOperationInput {
|
1546 + | structure: self
|
1547 + | .structure
|
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::Structure))
|
1553 + | .transpose()?,
|
1554 + | empty_structure: self.empty_structure,
|
1555 + | list: self.list,
|
1556 + | map: self.map,
|
1557 + | union: self.union,
|
1558 + | unit_union: self.unit_union,
|
1559 + | structure_list: self
|
1560 + | .structure_list
|
1561 + | .map(|v| match v {
|
1562 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1563 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1564 + | })
|
1565 + | .map(|res| {
|
1566 + | res.map(|v| v.into())
|
1567 + | .map_err(ConstraintViolation::StructureList)
|
1568 + | })
|
1569 + | .transpose()?,
|
1570 + | complex_list: self
|
1571 + | .complex_list
|
1572 + | .map(|v| match v {
|
1573 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1574 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1575 + | })
|
1576 + | .map(|res| {
|
1577 + | res.map(|v| v.into())
|
1578 + | .map_err(ConstraintViolation::ComplexList)
|
1579 + | })
|
1580 + | .transpose()?
|
1581 + | .ok_or(ConstraintViolation::MissingComplexList)?,
|
1582 + | complex_map: self
|
1583 + | .complex_map
|
1584 + | .map(|v| match v {
|
1585 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1586 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1587 + | })
|
1588 + | .map(|res| {
|
1589 + | res.map(|v| v.into())
|
1590 + | .map_err(ConstraintViolation::ComplexMap)
|
1591 + | })
|
1592 + | .transpose()?
|
1593 + | .ok_or(ConstraintViolation::MissingComplexMap)?,
|
1594 + | complex_union: self
|
1595 + | .complex_union
|
1596 + | .map(|v| match *v {
|
1597 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(Box::new(x)),
|
1598 + | crate::constrained::MaybeConstrained::Unconstrained(x) => {
|
1599 + | Ok(Box::new(x.try_into()?))
|
1600 + | }
|
1601 + | })
|
1602 + | .map(|res| {
|
1603 + | res.map_err(Box::new)
|
1604 + | .map_err(ConstraintViolation::ComplexUnion)
|
1605 + | })
|
1606 + | .transpose()?
|
1607 + | .ok_or(ConstraintViolation::MissingComplexUnion)?,
|
1608 + | })
|
1609 + | }
|
1610 + | }
|
1611 + | }
|
1612 + | /// See [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput).
|
1613 + | pub mod error_serialization_operation_input {
|
1614 + |
|
1615 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1616 + | /// Holds one variant for each of the ways the builder can fail.
|
1617 + | #[non_exhaustive]
|
1618 + | #[allow(clippy::enum_variant_names)]
|
1619 + | 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),
|
1648 + | }
|
1649 + | impl ::std::fmt::Display for ConstraintViolation {
|
1650 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1651 + | 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 + | }
|
1667 + | }
|
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",
|
1719 + | },
|
1720 + | ConstraintViolation::RequiredEnum(inner) => inner.as_validation_exception_field(path + "/requiredEnum"),
|
1721 + | }
|
1722 + | }
|
1723 + | }
|
1724 + | impl ::std::convert::From<ConstraintViolation>
|
1725 + | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
1726 + | {
|
1727 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
1728 + | let first_validation_exception_field =
|
1729 + | constraint_violation.as_validation_exception_field("".to_owned());
|
1730 + | let validation_exception = crate::error::ValidationException {
|
1731 + | message: format!(
|
1732 + | "1 validation error detected. {}",
|
1733 + | &first_validation_exception_field.message
|
1734 + | ),
|
1735 + | field_list: Some(vec![first_validation_exception_field]),
|
1736 + | };
|
1737 + | Self::ConstraintViolation(
|
1738 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
1739 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
1740 + | )
|
1741 + | }
|
1742 + | }
|
1743 + | impl ::std::convert::From<Builder>
|
1744 + | for crate::constrained::MaybeConstrained<crate::input::ErrorSerializationOperationInput>
|
1745 + | {
|
1746 + | fn from(builder: Builder) -> Self {
|
1747 + | Self::Unconstrained(builder)
|
1748 + | }
|
1749 + | }
|
1750 + | impl ::std::convert::TryFrom<Builder> for crate::input::ErrorSerializationOperationInput {
|
1751 + | type Error = ConstraintViolation;
|
1752 + |
|
1753 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
1754 + | builder.build()
|
1755 + | }
|
1756 + | }
|
1757 + | /// A builder for [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput).
|
1758 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1759 + | 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>>,
|
1784 + | }
|
1785 + | impl Builder {
|
1786 + | #[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(
|
1908 + | mut self,
|
1909 + | input: Option<
|
1910 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
1911 + | >,
|
1912 + | ) -> 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);
|
1919 + | self
|
1920 + | }
|
1921 + | #[allow(missing_docs)] // documentation missing in model
|
1922 + | pub(crate) fn set_required_blob(
|
1923 + | mut self,
|
1924 + | input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
|
1925 + | ) -> 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);
|
1932 + | self
|
1933 + | }
|
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
|
1941 + | }
|
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
|
1946 + | }
|
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 + | }
|
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
|
1959 + | }
|
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
|
1964 + | }
|
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 + | }
|
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 + | }
|
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
|
1979 + | }
|
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 + | }
|
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 + | }
|
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
|
1997 + | }
|
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 + | }
|
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
|
2007 + | }
|
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 + | }
|
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
|
2017 + | }
|
2018 + | #[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);
|
2021 + | self
|
2022 + | }
|
2023 + | #[allow(missing_docs)] // documentation missing in model
|
2024 + | pub(crate) fn set_required_timestamp(
|
2025 + | mut self,
|
2026 + | input: impl ::std::convert::Into<::aws_smithy_types::DateTime>,
|
2027 + | ) -> Self {
|
2028 + | self.required_timestamp = Some(input.into());
|
2029 + | self
|
2030 + | }
|
2031 + | #[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));
|
2034 + | self
|
2035 + | }
|
2036 + | #[allow(missing_docs)] // documentation missing in model
|
2037 + | pub(crate) fn set_required_enum(
|
2038 + | mut self,
|
2039 + | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
2040 + | ) -> Self {
|
2041 + | self.required_enum = Some(input.into());
|
2042 + | self
|
2043 + | }
|
2044 + | /// Consumes the builder and constructs a [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput).
|
2045 + | ///
|
2046 + | /// The builder fails to construct a [`ErrorSerializationOperationInput`](crate::input::ErrorSerializationOperationInput) if a [`ConstraintViolation`] occurs.
|
2047 + | ///
|
2048 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
2049 + | pub fn build(
|
2050 + | self,
|
2051 + | ) -> Result<crate::input::ErrorSerializationOperationInput, ConstraintViolation> {
|
2052 + | self.build_enforcing_all_constraints()
|
2053 + | }
|
2054 + | fn build_enforcing_all_constraints(
|
2055 + | 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)?,
|
2115 + | })
|
2116 + | }
|
2117 + | }
|
2118 + | }
|
2119 + | /// See [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput).
|
2120 + | pub mod simple_struct_operation_input {
|
2121 + |
|
2122 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2123 + | /// Holds one variant for each of the ways the builder can fail.
|
2124 + | #[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`"),
|
2172 + | }
|
2173 + | }
|
2174 + | }
|
2175 + | impl ::std::error::Error for ConstraintViolation {}
|
2176 + | impl ConstraintViolation {
|
2177 + | pub(crate) fn as_validation_exception_field(
|
2178 + | self,
|
2179 + | path: ::std::string::String,
|
2180 + | ) -> crate::model::ValidationExceptionField {
|
2181 + | 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",
|
2226 + | },
|
2227 + | ConstraintViolation::RequiredEnum(inner) => inner.as_validation_exception_field(path + "/requiredEnum"),
|
2228 + | }
|
2229 + | }
|
2230 + | }
|
2231 + | impl ::std::convert::From<ConstraintViolation>
|
2232 + | for ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection
|
2233 + | {
|
2234 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
2235 + | let first_validation_exception_field =
|
2236 + | constraint_violation.as_validation_exception_field("".to_owned());
|
2237 + | let validation_exception = crate::error::ValidationException {
|
2238 + | message: format!(
|
2239 + | "1 validation error detected. {}",
|
2240 + | &first_validation_exception_field.message
|
2241 + | ),
|
2242 + | field_list: Some(vec![first_validation_exception_field]),
|
2243 + | };
|
2244 + | Self::ConstraintViolation(
|
2245 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
2246 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
2247 + | )
|
2248 + | }
|
2249 + | }
|
2250 + | impl ::std::convert::From<Builder>
|
2251 + | for crate::constrained::MaybeConstrained<crate::input::SimpleStructOperationInput>
|
2252 + | {
|
2253 + | fn from(builder: Builder) -> Self {
|
2254 + | Self::Unconstrained(builder)
|
2255 + | }
|
2256 + | }
|
2257 + | impl ::std::convert::TryFrom<Builder> for crate::input::SimpleStructOperationInput {
|
2258 + | type Error = ConstraintViolation;
|
2259 + |
|
2260 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
2261 + | builder.build()
|
2262 + | }
|
2263 + | }
|
2264 + | /// A builder for [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput).
|
2265 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2266 + | 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>>,
|
2291 + | }
|
2292 + | impl Builder {
|
2293 + | #[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(
|
2415 + | mut self,
|
2416 + | input: Option<
|
2417 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
2418 + | >,
|
2419 + | ) -> 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);
|
2452 + | self
|
2453 + | }
|
2454 + | #[allow(missing_docs)] // documentation missing in model
|
2455 + | pub(crate) fn set_required_string(
|
2456 + | mut self,
|
2457 + | input: impl ::std::convert::Into<::std::string::String>,
|
2458 + | ) -> Self {
|
2459 + | self.required_string = Some(input.into());
|
2460 + | self
|
2461 + | }
|
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 + | }
|
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
|
2471 + | }
|
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 + | }
|
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
|
2481 + | }
|
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
|
2486 + | }
|
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 + | }
|
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 + | }
|
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 + | }
|
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 + | }
|
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 + | }
|
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
|
2519 + | }
|
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 + | }
|
2525 + | #[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);
|
2528 + | self
|
2529 + | }
|
2530 + | #[allow(missing_docs)] // documentation missing in model
|
2531 + | pub(crate) fn set_required_timestamp(
|
2532 + | mut self,
|
2533 + | input: impl ::std::convert::Into<::aws_smithy_types::DateTime>,
|
2534 + | ) -> Self {
|
2535 + | self.required_timestamp = Some(input.into());
|
2536 + | self
|
2537 + | }
|
2538 + | #[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));
|
2541 + | self
|
2542 + | }
|
2543 + | #[allow(missing_docs)] // documentation missing in model
|
2544 + | pub(crate) fn set_required_enum(
|
2545 + | mut self,
|
2546 + | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::Suit>>,
|
2547 + | ) -> Self {
|
2548 + | self.required_enum = Some(input.into());
|
2549 + | self
|
2550 + | }
|
2551 + | /// Consumes the builder and constructs a [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput).
|
2552 + | ///
|
2553 + | /// The builder fails to construct a [`SimpleStructOperationInput`](crate::input::SimpleStructOperationInput) if a [`ConstraintViolation`] occurs.
|
2554 + | ///
|
2555 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
2556 + | pub fn build(
|
2557 + | self,
|
2558 + | ) -> Result<crate::input::SimpleStructOperationInput, ConstraintViolation> {
|
2559 + | self.build_enforcing_all_constraints()
|
2560 + | }
|
2561 + | fn build_enforcing_all_constraints(
|
2562 + | 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)?,
|
2622 + | })
|
2623 + | }
|
2624 + | }
|
2625 + | }
|