1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | #[allow(missing_docs)] // documentation missing in model
|
3 + | #[derive(
|
4 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
5 + | )]
|
6 + | pub struct RpcEchoInput {
|
7 + | #[allow(missing_docs)] // documentation missing in model
|
8 + | pub r#as: ::std::option::Option<i32>,
|
9 + | #[allow(missing_docs)] // documentation missing in model
|
10 + | pub r#async: ::std::option::Option<bool>,
|
11 + | #[allow(missing_docs)] // documentation missing in model
|
12 + | pub r#enum: ::std::option::Option<crate::model::UnknownVariantCollidingEnum>,
|
13 + | #[allow(missing_docs)] // documentation missing in model
|
14 + | pub self_: ::std::option::Option<bool>,
|
15 + | #[allow(missing_docs)] // documentation missing in model
|
16 + | pub crate_: ::std::option::Option<bool>,
|
17 + | #[allow(missing_docs)] // documentation missing in model
|
18 + | pub super_: ::std::option::Option<bool>,
|
19 + | #[allow(missing_docs)] // documentation missing in model
|
20 + | pub build_value: ::std::option::Option<::std::string::String>,
|
21 + | #[allow(missing_docs)] // documentation missing in model
|
22 + | pub default_value: ::std::option::Option<::std::string::String>,
|
23 + | #[allow(missing_docs)] // documentation missing in model
|
24 + | pub send: ::std::option::Option<::std::string::String>,
|
25 + | }
|
26 + | impl RpcEchoInput {
|
27 + | #[allow(missing_docs)] // documentation missing in model
|
28 + | pub fn r#as(&self) -> ::std::option::Option<i32> {
|
29 + | self.r#as
|
30 + | }
|
31 + | #[allow(missing_docs)] // documentation missing in model
|
32 + | pub fn r#async(&self) -> ::std::option::Option<bool> {
|
33 + | self.r#async
|
34 + | }
|
35 + | #[allow(missing_docs)] // documentation missing in model
|
36 + | pub fn r#enum(&self) -> ::std::option::Option<&crate::model::UnknownVariantCollidingEnum> {
|
37 + | self.r#enum.as_ref()
|
38 + | }
|
39 + | #[allow(missing_docs)] // documentation missing in model
|
40 + | pub fn self_(&self) -> ::std::option::Option<bool> {
|
41 + | self.self_
|
42 + | }
|
43 + | #[allow(missing_docs)] // documentation missing in model
|
44 + | pub fn crate_(&self) -> ::std::option::Option<bool> {
|
45 + | self.crate_
|
46 + | }
|
47 + | #[allow(missing_docs)] // documentation missing in model
|
48 + | pub fn super_(&self) -> ::std::option::Option<bool> {
|
49 + | self.super_
|
50 + | }
|
51 + | #[allow(missing_docs)] // documentation missing in model
|
52 + | pub fn build_value(&self) -> ::std::option::Option<&str> {
|
53 + | self.build_value.as_deref()
|
54 + | }
|
55 + | #[allow(missing_docs)] // documentation missing in model
|
56 + | pub fn default_value(&self) -> ::std::option::Option<&str> {
|
57 + | self.default_value.as_deref()
|
58 + | }
|
59 + | #[allow(missing_docs)] // documentation missing in model
|
60 + | pub fn send(&self) -> ::std::option::Option<&str> {
|
61 + | self.send.as_deref()
|
62 + | }
|
63 + | }
|
64 + | impl RpcEchoInput {
|
65 + | /// Creates a new builder-style object to manufacture [`RpcEchoInput`](crate::input::RpcEchoInput).
|
66 + | pub fn builder() -> crate::input::rpc_echo_input::Builder {
|
67 + | crate::input::rpc_echo_input::Builder::default()
|
68 + | }
|
69 + | }
|
70 + | impl crate::constrained::Constrained for crate::input::RpcEchoInput {
|
71 + | type Unconstrained = crate::input::rpc_echo_input::Builder;
|
72 + | }
|
73 + |
|
74 + | #[allow(missing_docs)] // documentation missing in model
|
75 + | #[derive(
|
76 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
77 + | )]
|
78 + | pub struct MatchInput {
|
79 + | #[allow(missing_docs)] // documentation missing in model
|
80 + | pub r#as: ::std::option::Option<i32>,
|
81 + | #[allow(missing_docs)] // documentation missing in model
|
82 + | pub r#async: ::std::option::Option<bool>,
|
83 + | #[allow(missing_docs)] // documentation missing in model
|
84 + | pub r#enum: ::std::option::Option<crate::model::UnknownVariantCollidingEnum>,
|
85 + | #[allow(missing_docs)] // documentation missing in model
|
86 + | pub self_: ::std::option::Option<bool>,
|
87 + | #[allow(missing_docs)] // documentation missing in model
|
88 + | pub crate_: ::std::option::Option<bool>,
|
89 + | #[allow(missing_docs)] // documentation missing in model
|
90 + | pub super_: ::std::option::Option<bool>,
|
91 + | #[allow(missing_docs)] // documentation missing in model
|
92 + | pub build_value: ::std::option::Option<::std::string::String>,
|
93 + | #[allow(missing_docs)] // documentation missing in model
|
94 + | pub default_value: ::std::option::Option<::std::string::String>,
|
95 + | #[allow(missing_docs)] // documentation missing in model
|
96 + | pub send: ::std::option::Option<::std::string::String>,
|
97 + | }
|
98 + | impl MatchInput {
|
99 + | #[allow(missing_docs)] // documentation missing in model
|
100 + | pub fn r#as(&self) -> ::std::option::Option<i32> {
|
101 + | self.r#as
|
102 + | }
|
103 + | #[allow(missing_docs)] // documentation missing in model
|
104 + | pub fn r#async(&self) -> ::std::option::Option<bool> {
|
105 + | self.r#async
|
106 + | }
|
107 + | #[allow(missing_docs)] // documentation missing in model
|
108 + | pub fn r#enum(&self) -> ::std::option::Option<&crate::model::UnknownVariantCollidingEnum> {
|
109 + | self.r#enum.as_ref()
|
110 + | }
|
111 + | #[allow(missing_docs)] // documentation missing in model
|
112 + | pub fn self_(&self) -> ::std::option::Option<bool> {
|
113 + | self.self_
|
114 + | }
|
115 + | #[allow(missing_docs)] // documentation missing in model
|
116 + | pub fn crate_(&self) -> ::std::option::Option<bool> {
|
117 + | self.crate_
|
118 + | }
|
119 + | #[allow(missing_docs)] // documentation missing in model
|
120 + | pub fn super_(&self) -> ::std::option::Option<bool> {
|
121 + | self.super_
|
122 + | }
|
123 + | #[allow(missing_docs)] // documentation missing in model
|
124 + | pub fn build_value(&self) -> ::std::option::Option<&str> {
|
125 + | self.build_value.as_deref()
|
126 + | }
|
127 + | #[allow(missing_docs)] // documentation missing in model
|
128 + | pub fn default_value(&self) -> ::std::option::Option<&str> {
|
129 + | self.default_value.as_deref()
|
130 + | }
|
131 + | #[allow(missing_docs)] // documentation missing in model
|
132 + | pub fn send(&self) -> ::std::option::Option<&str> {
|
133 + | self.send.as_deref()
|
134 + | }
|
135 + | }
|
136 + | impl MatchInput {
|
137 + | /// Creates a new builder-style object to manufacture [`MatchInput`](crate::input::MatchInput).
|
138 + | pub fn builder() -> crate::input::match_input::Builder {
|
139 + | crate::input::match_input::Builder::default()
|
140 + | }
|
141 + | }
|
142 + | impl crate::constrained::Constrained for crate::input::MatchInput {
|
143 + | type Unconstrained = crate::input::match_input::Builder;
|
144 + | }
|
145 + |
|
146 + | #[allow(missing_docs)] // documentation missing in model
|
147 + | #[derive(
|
148 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
149 + | )]
|
150 + | pub struct OptionInput {
|
151 + | #[allow(missing_docs)] // documentation missing in model
|
152 + | pub pv_member: ::std::option::Option<bool>,
|
153 + | }
|
154 + | impl OptionInput {
|
155 + | #[allow(missing_docs)] // documentation missing in model
|
156 + | pub fn pv_member(&self) -> ::std::option::Option<bool> {
|
157 + | self.pv_member
|
158 + | }
|
159 + | }
|
160 + | impl OptionInput {
|
161 + | /// Creates a new builder-style object to manufacture [`OptionInput`](crate::input::OptionInput).
|
162 + | pub fn builder() -> crate::input::option_input::Builder {
|
163 + | crate::input::option_input::Builder::default()
|
164 + | }
|
165 + | }
|
166 + | impl crate::constrained::Constrained for crate::input::OptionInput {
|
167 + | type Unconstrained = crate::input::option_input::Builder;
|
168 + | }
|
169 + |
|
170 + | #[allow(missing_docs)] // documentation missing in model
|
171 + | #[derive(
|
172 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
173 + | )]
|
174 + | pub struct ResultInput {
|
175 + | #[allow(missing_docs)] // documentation missing in model
|
176 + | pub pv_member: ::std::option::Option<bool>,
|
177 + | }
|
178 + | impl ResultInput {
|
179 + | #[allow(missing_docs)] // documentation missing in model
|
180 + | pub fn pv_member(&self) -> ::std::option::Option<bool> {
|
181 + | self.pv_member
|
182 + | }
|
183 + | }
|
184 + | impl ResultInput {
|
185 + | /// Creates a new builder-style object to manufacture [`ResultInput`](crate::input::ResultInput).
|
186 + | pub fn builder() -> crate::input::result_input::Builder {
|
187 + | crate::input::result_input::Builder::default()
|
188 + | }
|
189 + | }
|
190 + | impl crate::constrained::Constrained for crate::input::ResultInput {
|
191 + | type Unconstrained = crate::input::result_input::Builder;
|
192 + | }
|
193 + |
|
194 + | #[allow(missing_docs)] // documentation missing in model
|
195 + | #[derive(
|
196 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
197 + | )]
|
198 + | pub struct ErrCollisionsInput {}
|
199 + | impl ErrCollisionsInput {
|
200 + | /// Creates a new builder-style object to manufacture [`ErrCollisionsInput`](crate::input::ErrCollisionsInput).
|
201 + | pub fn builder() -> crate::input::err_collisions_input::Builder {
|
202 + | crate::input::err_collisions_input::Builder::default()
|
203 + | }
|
204 + | }
|
205 + | impl crate::constrained::Constrained for crate::input::ErrCollisionsInput {
|
206 + | type Unconstrained = crate::input::err_collisions_input::Builder;
|
207 + | }
|
208 + |
|
209 + | #[allow(missing_docs)] // documentation missing in model
|
210 + | #[derive(
|
211 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
212 + | )]
|
213 + | pub struct StructureNamePunningInput {
|
214 + | #[allow(missing_docs)] // documentation missing in model
|
215 + | pub regular_string: ::std::option::Option<::std::string::String>,
|
216 + | #[allow(missing_docs)] // documentation missing in model
|
217 + | pub punned_vec: ::std::option::Option<crate::model::Vec>,
|
218 + | }
|
219 + | impl StructureNamePunningInput {
|
220 + | #[allow(missing_docs)] // documentation missing in model
|
221 + | pub fn regular_string(&self) -> ::std::option::Option<&str> {
|
222 + | self.regular_string.as_deref()
|
223 + | }
|
224 + | #[allow(missing_docs)] // documentation missing in model
|
225 + | pub fn punned_vec(&self) -> ::std::option::Option<&crate::model::Vec> {
|
226 + | self.punned_vec.as_ref()
|
227 + | }
|
228 + | }
|
229 + | impl StructureNamePunningInput {
|
230 + | /// Creates a new builder-style object to manufacture [`StructureNamePunningInput`](crate::input::StructureNamePunningInput).
|
231 + | pub fn builder() -> crate::input::structure_name_punning_input::Builder {
|
232 + | crate::input::structure_name_punning_input::Builder::default()
|
233 + | }
|
234 + | }
|
235 + | impl crate::constrained::Constrained for crate::input::StructureNamePunningInput {
|
236 + | type Unconstrained = crate::input::structure_name_punning_input::Builder;
|
237 + | }
|
238 + |
|
239 + | #[allow(missing_docs)] // documentation missing in model
|
240 + | #[derive(
|
241 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
242 + | )]
|
243 + | pub struct ReservedWordsAsMembersInput {
|
244 + | #[allow(missing_docs)] // documentation missing in model
|
245 + | pub r#as: ::std::option::Option<i32>,
|
246 + | #[allow(missing_docs)] // documentation missing in model
|
247 + | pub r#async: ::std::option::Option<bool>,
|
248 + | #[allow(missing_docs)] // documentation missing in model
|
249 + | pub r#enum: ::std::option::Option<crate::model::UnknownVariantCollidingEnum>,
|
250 + | #[allow(missing_docs)] // documentation missing in model
|
251 + | pub self_: ::std::option::Option<bool>,
|
252 + | #[allow(missing_docs)] // documentation missing in model
|
253 + | pub crate_: ::std::option::Option<bool>,
|
254 + | #[allow(missing_docs)] // documentation missing in model
|
255 + | pub super_: ::std::option::Option<bool>,
|
256 + | #[allow(missing_docs)] // documentation missing in model
|
257 + | pub build_value: ::std::option::Option<::std::string::String>,
|
258 + | #[allow(missing_docs)] // documentation missing in model
|
259 + | pub default_value: ::std::option::Option<::std::string::String>,
|
260 + | #[allow(missing_docs)] // documentation missing in model
|
261 + | pub send: ::std::option::Option<::std::string::String>,
|
262 + | }
|
263 + | impl ReservedWordsAsMembersInput {
|
264 + | #[allow(missing_docs)] // documentation missing in model
|
265 + | pub fn r#as(&self) -> ::std::option::Option<i32> {
|
266 + | self.r#as
|
267 + | }
|
268 + | #[allow(missing_docs)] // documentation missing in model
|
269 + | pub fn r#async(&self) -> ::std::option::Option<bool> {
|
270 + | self.r#async
|
271 + | }
|
272 + | #[allow(missing_docs)] // documentation missing in model
|
273 + | pub fn r#enum(&self) -> ::std::option::Option<&crate::model::UnknownVariantCollidingEnum> {
|
274 + | self.r#enum.as_ref()
|
275 + | }
|
276 + | #[allow(missing_docs)] // documentation missing in model
|
277 + | pub fn self_(&self) -> ::std::option::Option<bool> {
|
278 + | self.self_
|
279 + | }
|
280 + | #[allow(missing_docs)] // documentation missing in model
|
281 + | pub fn crate_(&self) -> ::std::option::Option<bool> {
|
282 + | self.crate_
|
283 + | }
|
284 + | #[allow(missing_docs)] // documentation missing in model
|
285 + | pub fn super_(&self) -> ::std::option::Option<bool> {
|
286 + | self.super_
|
287 + | }
|
288 + | #[allow(missing_docs)] // documentation missing in model
|
289 + | pub fn build_value(&self) -> ::std::option::Option<&str> {
|
290 + | self.build_value.as_deref()
|
291 + | }
|
292 + | #[allow(missing_docs)] // documentation missing in model
|
293 + | pub fn default_value(&self) -> ::std::option::Option<&str> {
|
294 + | self.default_value.as_deref()
|
295 + | }
|
296 + | #[allow(missing_docs)] // documentation missing in model
|
297 + | pub fn send(&self) -> ::std::option::Option<&str> {
|
298 + | self.send.as_deref()
|
299 + | }
|
300 + | }
|
301 + | impl ReservedWordsAsMembersInput {
|
302 + | /// Creates a new builder-style object to manufacture [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput).
|
303 + | pub fn builder() -> crate::input::reserved_words_as_members_input::Builder {
|
304 + | crate::input::reserved_words_as_members_input::Builder::default()
|
305 + | }
|
306 + | }
|
307 + | impl crate::constrained::Constrained for crate::input::ReservedWordsAsMembersInput {
|
308 + | type Unconstrained = crate::input::reserved_words_as_members_input::Builder;
|
309 + | }
|
310 + | /// See [`RpcEchoInput`](crate::input::RpcEchoInput).
|
311 + | pub mod rpc_echo_input {
|
312 + |
|
313 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
314 + | /// Holds one variant for each of the ways the builder can fail.
|
315 + | #[non_exhaustive]
|
316 + | #[allow(clippy::enum_variant_names)]
|
317 + | pub enum ConstraintViolation {
|
318 + | /// Constraint violation occurred building member `r#enum` when building `RpcEchoInput`.
|
319 + | #[doc(hidden)]
|
320 + | Enum(crate::model::unknown_variant_colliding_enum::ConstraintViolation),
|
321 + | }
|
322 + | impl ::std::fmt::Display for ConstraintViolation {
|
323 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
324 + | match self {
|
325 + | ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `RpcEchoInput`"),
|
326 + | }
|
327 + | }
|
328 + | }
|
329 + | impl ::std::error::Error for ConstraintViolation {}
|
330 + | impl ConstraintViolation {
|
331 + | pub(crate) fn as_validation_exception_field(
|
332 + | self,
|
333 + | path: ::std::string::String,
|
334 + | ) -> crate::model::ValidationExceptionField {
|
335 + | match self {
|
336 + | ConstraintViolation::Enum(inner) => {
|
337 + | inner.as_validation_exception_field(path + "/enum")
|
338 + | }
|
339 + | }
|
340 + | }
|
341 + | }
|
342 + | impl ::std::convert::From<ConstraintViolation>
|
343 + | for ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection
|
344 + | {
|
345 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
346 + | let first_validation_exception_field =
|
347 + | constraint_violation.as_validation_exception_field("".to_owned());
|
348 + | let validation_exception = crate::error::ValidationException {
|
349 + | message: format!(
|
350 + | "1 validation error detected. {}",
|
351 + | &first_validation_exception_field.message
|
352 + | ),
|
353 + | field_list: Some(vec![first_validation_exception_field]),
|
354 + | };
|
355 + | Self::ConstraintViolation(
|
356 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
357 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
358 + | )
|
359 + | }
|
360 + | }
|
361 + | impl ::std::convert::From<Builder>
|
362 + | for crate::constrained::MaybeConstrained<crate::input::RpcEchoInput>
|
363 + | {
|
364 + | fn from(builder: Builder) -> Self {
|
365 + | Self::Unconstrained(builder)
|
366 + | }
|
367 + | }
|
368 + | impl ::std::convert::TryFrom<Builder> for crate::input::RpcEchoInput {
|
369 + | type Error = ConstraintViolation;
|
370 + |
|
371 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
372 + | builder.build()
|
373 + | }
|
374 + | }
|
375 + | /// A builder for [`RpcEchoInput`](crate::input::RpcEchoInput).
|
376 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
377 + | pub struct Builder {
|
378 + | pub(crate) r#as: ::std::option::Option<i32>,
|
379 + | pub(crate) r#async: ::std::option::Option<bool>,
|
380 + | pub(crate) r#enum: ::std::option::Option<
|
381 + | crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>,
|
382 + | >,
|
383 + | pub(crate) self_: ::std::option::Option<bool>,
|
384 + | pub(crate) crate_: ::std::option::Option<bool>,
|
385 + | pub(crate) super_: ::std::option::Option<bool>,
|
386 + | pub(crate) build_value: ::std::option::Option<::std::string::String>,
|
387 + | pub(crate) default_value: ::std::option::Option<::std::string::String>,
|
388 + | pub(crate) send: ::std::option::Option<::std::string::String>,
|
389 + | }
|
390 + | impl Builder {
|
391 + | #[allow(missing_docs)] // documentation missing in model
|
392 + | pub fn r#as(mut self, input: ::std::option::Option<i32>) -> Self {
|
393 + | self.r#as = input;
|
394 + | self
|
395 + | }
|
396 + | #[allow(missing_docs)] // documentation missing in model
|
397 + | pub(crate) fn set_as(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
398 + | self.r#as = input.map(|v| v.into());
|
399 + | self
|
400 + | }
|
401 + | #[allow(missing_docs)] // documentation missing in model
|
402 + | pub fn r#async(mut self, input: ::std::option::Option<bool>) -> Self {
|
403 + | self.r#async = input;
|
404 + | self
|
405 + | }
|
406 + | #[allow(missing_docs)] // documentation missing in model
|
407 + | pub(crate) fn set_async(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
408 + | self.r#async = input.map(|v| v.into());
|
409 + | self
|
410 + | }
|
411 + | #[allow(missing_docs)] // documentation missing in model
|
412 + | pub fn r#enum(
|
413 + | mut self,
|
414 + | input: ::std::option::Option<crate::model::UnknownVariantCollidingEnum>,
|
415 + | ) -> Self {
|
416 + | self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
|
417 + | self
|
418 + | }
|
419 + | #[allow(missing_docs)] // documentation missing in model
|
420 + | pub(crate) fn set_enum(
|
421 + | mut self,
|
422 + | input: Option<
|
423 + | impl ::std::convert::Into<
|
424 + | crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>,
|
425 + | >,
|
426 + | >,
|
427 + | ) -> Self {
|
428 + | self.r#enum = input.map(|v| v.into());
|
429 + | self
|
430 + | }
|
431 + | #[allow(missing_docs)] // documentation missing in model
|
432 + | pub fn self_(mut self, input: ::std::option::Option<bool>) -> Self {
|
433 + | self.self_ = input;
|
434 + | self
|
435 + | }
|
436 + | #[allow(missing_docs)] // documentation missing in model
|
437 + | pub(crate) fn set_self(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
438 + | self.self_ = input.map(|v| v.into());
|
439 + | self
|
440 + | }
|
441 + | #[allow(missing_docs)] // documentation missing in model
|
442 + | pub fn crate_(mut self, input: ::std::option::Option<bool>) -> Self {
|
443 + | self.crate_ = input;
|
444 + | self
|
445 + | }
|
446 + | #[allow(missing_docs)] // documentation missing in model
|
447 + | pub(crate) fn set_crate(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
448 + | self.crate_ = input.map(|v| v.into());
|
449 + | self
|
450 + | }
|
451 + | #[allow(missing_docs)] // documentation missing in model
|
452 + | pub fn super_(mut self, input: ::std::option::Option<bool>) -> Self {
|
453 + | self.super_ = input;
|
454 + | self
|
455 + | }
|
456 + | #[allow(missing_docs)] // documentation missing in model
|
457 + | pub(crate) fn set_super(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
458 + | self.super_ = input.map(|v| v.into());
|
459 + | self
|
460 + | }
|
461 + | #[allow(missing_docs)] // documentation missing in model
|
462 + | pub fn build_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
463 + | self.build_value = input;
|
464 + | self
|
465 + | }
|
466 + | #[allow(missing_docs)] // documentation missing in model
|
467 + | pub(crate) fn set_build(
|
468 + | mut self,
|
469 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
470 + | ) -> Self {
|
471 + | self.build_value = input.map(|v| v.into());
|
472 + | self
|
473 + | }
|
474 + | #[allow(missing_docs)] // documentation missing in model
|
475 + | pub fn default_value(
|
476 + | mut self,
|
477 + | input: ::std::option::Option<::std::string::String>,
|
478 + | ) -> Self {
|
479 + | self.default_value = input;
|
480 + | self
|
481 + | }
|
482 + | #[allow(missing_docs)] // documentation missing in model
|
483 + | pub(crate) fn set_default(
|
484 + | mut self,
|
485 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
486 + | ) -> Self {
|
487 + | self.default_value = input.map(|v| v.into());
|
488 + | self
|
489 + | }
|
490 + | #[allow(missing_docs)] // documentation missing in model
|
491 + | pub fn send(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
492 + | self.send = input;
|
493 + | self
|
494 + | }
|
495 + | #[allow(missing_docs)] // documentation missing in model
|
496 + | pub(crate) fn set_send(
|
497 + | mut self,
|
498 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
499 + | ) -> Self {
|
500 + | self.send = input.map(|v| v.into());
|
501 + | self
|
502 + | }
|
503 + | /// Consumes the builder and constructs a [`RpcEchoInput`](crate::input::RpcEchoInput).
|
504 + | ///
|
505 + | /// The builder fails to construct a [`RpcEchoInput`](crate::input::RpcEchoInput) if a [`ConstraintViolation`] occurs.
|
506 + | ///
|
507 + | pub fn build(self) -> Result<crate::input::RpcEchoInput, ConstraintViolation> {
|
508 + | self.build_enforcing_all_constraints()
|
509 + | }
|
510 + | fn build_enforcing_all_constraints(
|
511 + | self,
|
512 + | ) -> Result<crate::input::RpcEchoInput, ConstraintViolation> {
|
513 + | Ok(crate::input::RpcEchoInput {
|
514 + | r#as: self.r#as,
|
515 + | r#async: self.r#async,
|
516 + | r#enum: self
|
517 + | .r#enum
|
518 + | .map(|v| match v {
|
519 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
520 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
521 + | })
|
522 + | .map(|res| res.map_err(ConstraintViolation::Enum))
|
523 + | .transpose()?,
|
524 + | self_: self.self_,
|
525 + | crate_: self.crate_,
|
526 + | super_: self.super_,
|
527 + | build_value: self.build_value,
|
528 + | default_value: self.default_value,
|
529 + | send: self.send,
|
530 + | })
|
531 + | }
|
532 + | }
|
533 + | }
|
534 + | /// See [`MatchInput`](crate::input::MatchInput).
|
535 + | pub mod match_input {
|
536 + |
|
537 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
538 + | /// Holds one variant for each of the ways the builder can fail.
|
539 + | #[non_exhaustive]
|
540 + | #[allow(clippy::enum_variant_names)]
|
541 + | pub enum ConstraintViolation {
|
542 + | /// Constraint violation occurred building member `r#enum` when building `MatchInput`.
|
543 + | #[doc(hidden)]
|
544 + | Enum(crate::model::unknown_variant_colliding_enum::ConstraintViolation),
|
545 + | }
|
546 + | impl ::std::fmt::Display for ConstraintViolation {
|
547 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
548 + | match self {
|
549 + | ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `MatchInput`"),
|
550 + | }
|
551 + | }
|
552 + | }
|
553 + | impl ::std::error::Error for ConstraintViolation {}
|
554 + | impl ConstraintViolation {
|
555 + | pub(crate) fn as_validation_exception_field(
|
556 + | self,
|
557 + | path: ::std::string::String,
|
558 + | ) -> crate::model::ValidationExceptionField {
|
559 + | match self {
|
560 + | ConstraintViolation::Enum(inner) => {
|
561 + | inner.as_validation_exception_field(path + "/enum")
|
562 + | }
|
563 + | }
|
564 + | }
|
565 + | }
|
566 + | impl ::std::convert::From<ConstraintViolation>
|
567 + | for ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection
|
568 + | {
|
569 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
570 + | let first_validation_exception_field =
|
571 + | constraint_violation.as_validation_exception_field("".to_owned());
|
572 + | let validation_exception = crate::error::ValidationException {
|
573 + | message: format!(
|
574 + | "1 validation error detected. {}",
|
575 + | &first_validation_exception_field.message
|
576 + | ),
|
577 + | field_list: Some(vec![first_validation_exception_field]),
|
578 + | };
|
579 + | Self::ConstraintViolation(
|
580 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
581 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
582 + | )
|
583 + | }
|
584 + | }
|
585 + | impl ::std::convert::From<Builder>
|
586 + | for crate::constrained::MaybeConstrained<crate::input::MatchInput>
|
587 + | {
|
588 + | fn from(builder: Builder) -> Self {
|
589 + | Self::Unconstrained(builder)
|
590 + | }
|
591 + | }
|
592 + | impl ::std::convert::TryFrom<Builder> for crate::input::MatchInput {
|
593 + | type Error = ConstraintViolation;
|
594 + |
|
595 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
596 + | builder.build()
|
597 + | }
|
598 + | }
|
599 + | /// A builder for [`MatchInput`](crate::input::MatchInput).
|
600 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
601 + | pub struct Builder {
|
602 + | pub(crate) r#as: ::std::option::Option<i32>,
|
603 + | pub(crate) r#async: ::std::option::Option<bool>,
|
604 + | pub(crate) r#enum: ::std::option::Option<
|
605 + | crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>,
|
606 + | >,
|
607 + | pub(crate) self_: ::std::option::Option<bool>,
|
608 + | pub(crate) crate_: ::std::option::Option<bool>,
|
609 + | pub(crate) super_: ::std::option::Option<bool>,
|
610 + | pub(crate) build_value: ::std::option::Option<::std::string::String>,
|
611 + | pub(crate) default_value: ::std::option::Option<::std::string::String>,
|
612 + | pub(crate) send: ::std::option::Option<::std::string::String>,
|
613 + | }
|
614 + | impl Builder {
|
615 + | #[allow(missing_docs)] // documentation missing in model
|
616 + | pub fn r#as(mut self, input: ::std::option::Option<i32>) -> Self {
|
617 + | self.r#as = input;
|
618 + | self
|
619 + | }
|
620 + | #[allow(missing_docs)] // documentation missing in model
|
621 + | pub(crate) fn set_as(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
622 + | self.r#as = input.map(|v| v.into());
|
623 + | self
|
624 + | }
|
625 + | #[allow(missing_docs)] // documentation missing in model
|
626 + | pub fn r#async(mut self, input: ::std::option::Option<bool>) -> Self {
|
627 + | self.r#async = input;
|
628 + | self
|
629 + | }
|
630 + | #[allow(missing_docs)] // documentation missing in model
|
631 + | pub(crate) fn set_async(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
632 + | self.r#async = input.map(|v| v.into());
|
633 + | self
|
634 + | }
|
635 + | #[allow(missing_docs)] // documentation missing in model
|
636 + | pub fn r#enum(
|
637 + | mut self,
|
638 + | input: ::std::option::Option<crate::model::UnknownVariantCollidingEnum>,
|
639 + | ) -> Self {
|
640 + | self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
|
641 + | self
|
642 + | }
|
643 + | #[allow(missing_docs)] // documentation missing in model
|
644 + | pub(crate) fn set_enum(
|
645 + | mut self,
|
646 + | input: Option<
|
647 + | impl ::std::convert::Into<
|
648 + | crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>,
|
649 + | >,
|
650 + | >,
|
651 + | ) -> Self {
|
652 + | self.r#enum = input.map(|v| v.into());
|
653 + | self
|
654 + | }
|
655 + | #[allow(missing_docs)] // documentation missing in model
|
656 + | pub fn self_(mut self, input: ::std::option::Option<bool>) -> Self {
|
657 + | self.self_ = input;
|
658 + | self
|
659 + | }
|
660 + | #[allow(missing_docs)] // documentation missing in model
|
661 + | pub(crate) fn set_self(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
662 + | self.self_ = input.map(|v| v.into());
|
663 + | self
|
664 + | }
|
665 + | #[allow(missing_docs)] // documentation missing in model
|
666 + | pub fn crate_(mut self, input: ::std::option::Option<bool>) -> Self {
|
667 + | self.crate_ = input;
|
668 + | self
|
669 + | }
|
670 + | #[allow(missing_docs)] // documentation missing in model
|
671 + | pub(crate) fn set_crate(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
672 + | self.crate_ = input.map(|v| v.into());
|
673 + | self
|
674 + | }
|
675 + | #[allow(missing_docs)] // documentation missing in model
|
676 + | pub fn super_(mut self, input: ::std::option::Option<bool>) -> Self {
|
677 + | self.super_ = input;
|
678 + | self
|
679 + | }
|
680 + | #[allow(missing_docs)] // documentation missing in model
|
681 + | pub(crate) fn set_super(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
682 + | self.super_ = input.map(|v| v.into());
|
683 + | self
|
684 + | }
|
685 + | #[allow(missing_docs)] // documentation missing in model
|
686 + | pub fn build_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
687 + | self.build_value = input;
|
688 + | self
|
689 + | }
|
690 + | #[allow(missing_docs)] // documentation missing in model
|
691 + | pub(crate) fn set_build(
|
692 + | mut self,
|
693 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
694 + | ) -> Self {
|
695 + | self.build_value = input.map(|v| v.into());
|
696 + | self
|
697 + | }
|
698 + | #[allow(missing_docs)] // documentation missing in model
|
699 + | pub fn default_value(
|
700 + | mut self,
|
701 + | input: ::std::option::Option<::std::string::String>,
|
702 + | ) -> Self {
|
703 + | self.default_value = input;
|
704 + | self
|
705 + | }
|
706 + | #[allow(missing_docs)] // documentation missing in model
|
707 + | pub(crate) fn set_default(
|
708 + | mut self,
|
709 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
710 + | ) -> Self {
|
711 + | self.default_value = input.map(|v| v.into());
|
712 + | self
|
713 + | }
|
714 + | #[allow(missing_docs)] // documentation missing in model
|
715 + | pub fn send(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
716 + | self.send = input;
|
717 + | self
|
718 + | }
|
719 + | #[allow(missing_docs)] // documentation missing in model
|
720 + | pub(crate) fn set_send(
|
721 + | mut self,
|
722 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
723 + | ) -> Self {
|
724 + | self.send = input.map(|v| v.into());
|
725 + | self
|
726 + | }
|
727 + | /// Consumes the builder and constructs a [`MatchInput`](crate::input::MatchInput).
|
728 + | ///
|
729 + | /// The builder fails to construct a [`MatchInput`](crate::input::MatchInput) if a [`ConstraintViolation`] occurs.
|
730 + | ///
|
731 + | pub fn build(self) -> Result<crate::input::MatchInput, ConstraintViolation> {
|
732 + | self.build_enforcing_all_constraints()
|
733 + | }
|
734 + | fn build_enforcing_all_constraints(
|
735 + | self,
|
736 + | ) -> Result<crate::input::MatchInput, ConstraintViolation> {
|
737 + | Ok(crate::input::MatchInput {
|
738 + | r#as: self.r#as,
|
739 + | r#async: self.r#async,
|
740 + | r#enum: self
|
741 + | .r#enum
|
742 + | .map(|v| match v {
|
743 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
744 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
745 + | })
|
746 + | .map(|res| res.map_err(ConstraintViolation::Enum))
|
747 + | .transpose()?,
|
748 + | self_: self.self_,
|
749 + | crate_: self.crate_,
|
750 + | super_: self.super_,
|
751 + | build_value: self.build_value,
|
752 + | default_value: self.default_value,
|
753 + | send: self.send,
|
754 + | })
|
755 + | }
|
756 + | }
|
757 + | }
|
758 + | /// See [`OptionInput`](crate::input::OptionInput).
|
759 + | pub mod option_input {
|
760 + |
|
761 + | impl ::std::convert::From<Builder> for crate::input::OptionInput {
|
762 + | fn from(builder: Builder) -> Self {
|
763 + | builder.build()
|
764 + | }
|
765 + | }
|
766 + | /// A builder for [`OptionInput`](crate::input::OptionInput).
|
767 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
768 + | pub struct Builder {
|
769 + | pub(crate) pv_member: ::std::option::Option<bool>,
|
770 + | }
|
771 + | impl Builder {
|
772 + | #[allow(missing_docs)] // documentation missing in model
|
773 + | pub fn pv_member(mut self, input: ::std::option::Option<bool>) -> Self {
|
774 + | self.pv_member = input;
|
775 + | self
|
776 + | }
|
777 + | #[allow(missing_docs)] // documentation missing in model
|
778 + | pub(crate) fn set_pv_member(
|
779 + | mut self,
|
780 + | input: Option<impl ::std::convert::Into<bool>>,
|
781 + | ) -> Self {
|
782 + | self.pv_member = input.map(|v| v.into());
|
783 + | self
|
784 + | }
|
785 + | /// Consumes the builder and constructs a [`OptionInput`](crate::input::OptionInput).
|
786 + | pub fn build(self) -> crate::input::OptionInput {
|
787 + | self.build_enforcing_all_constraints()
|
788 + | }
|
789 + | fn build_enforcing_all_constraints(self) -> crate::input::OptionInput {
|
790 + | crate::input::OptionInput {
|
791 + | pv_member: self.pv_member,
|
792 + | }
|
793 + | }
|
794 + | }
|
795 + | }
|
796 + | /// See [`ResultInput`](crate::input::ResultInput).
|
797 + | pub mod result_input {
|
798 + |
|
799 + | impl ::std::convert::From<Builder> for crate::input::ResultInput {
|
800 + | fn from(builder: Builder) -> Self {
|
801 + | builder.build()
|
802 + | }
|
803 + | }
|
804 + | /// A builder for [`ResultInput`](crate::input::ResultInput).
|
805 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
806 + | pub struct Builder {
|
807 + | pub(crate) pv_member: ::std::option::Option<bool>,
|
808 + | }
|
809 + | impl Builder {
|
810 + | #[allow(missing_docs)] // documentation missing in model
|
811 + | pub fn pv_member(mut self, input: ::std::option::Option<bool>) -> Self {
|
812 + | self.pv_member = input;
|
813 + | self
|
814 + | }
|
815 + | #[allow(missing_docs)] // documentation missing in model
|
816 + | pub(crate) fn set_pv_member(
|
817 + | mut self,
|
818 + | input: Option<impl ::std::convert::Into<bool>>,
|
819 + | ) -> Self {
|
820 + | self.pv_member = input.map(|v| v.into());
|
821 + | self
|
822 + | }
|
823 + | /// Consumes the builder and constructs a [`ResultInput`](crate::input::ResultInput).
|
824 + | pub fn build(self) -> crate::input::ResultInput {
|
825 + | self.build_enforcing_all_constraints()
|
826 + | }
|
827 + | fn build_enforcing_all_constraints(self) -> crate::input::ResultInput {
|
828 + | crate::input::ResultInput {
|
829 + | pv_member: self.pv_member,
|
830 + | }
|
831 + | }
|
832 + | }
|
833 + | }
|
834 + | /// See [`ErrCollisionsInput`](crate::input::ErrCollisionsInput).
|
835 + | pub mod err_collisions_input {
|
836 + |
|
837 + | impl ::std::convert::From<Builder> for crate::input::ErrCollisionsInput {
|
838 + | fn from(builder: Builder) -> Self {
|
839 + | builder.build()
|
840 + | }
|
841 + | }
|
842 + | /// A builder for [`ErrCollisionsInput`](crate::input::ErrCollisionsInput).
|
843 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
844 + | pub struct Builder {}
|
845 + | impl Builder {
|
846 + | /// Consumes the builder and constructs a [`ErrCollisionsInput`](crate::input::ErrCollisionsInput).
|
847 + | pub fn build(self) -> crate::input::ErrCollisionsInput {
|
848 + | self.build_enforcing_all_constraints()
|
849 + | }
|
850 + | fn build_enforcing_all_constraints(self) -> crate::input::ErrCollisionsInput {
|
851 + | crate::input::ErrCollisionsInput {}
|
852 + | }
|
853 + | }
|
854 + | }
|
855 + | /// See [`StructureNamePunningInput`](crate::input::StructureNamePunningInput).
|
856 + | pub mod structure_name_punning_input {
|
857 + |
|
858 + | impl ::std::convert::From<Builder> for crate::input::StructureNamePunningInput {
|
859 + | fn from(builder: Builder) -> Self {
|
860 + | builder.build()
|
861 + | }
|
862 + | }
|
863 + | /// A builder for [`StructureNamePunningInput`](crate::input::StructureNamePunningInput).
|
864 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
865 + | pub struct Builder {
|
866 + | pub(crate) regular_string: ::std::option::Option<::std::string::String>,
|
867 + | pub(crate) punned_vec: ::std::option::Option<crate::model::Vec>,
|
868 + | }
|
869 + | impl Builder {
|
870 + | #[allow(missing_docs)] // documentation missing in model
|
871 + | pub fn regular_string(
|
872 + | mut self,
|
873 + | input: ::std::option::Option<::std::string::String>,
|
874 + | ) -> Self {
|
875 + | self.regular_string = input;
|
876 + | self
|
877 + | }
|
878 + | #[allow(missing_docs)] // documentation missing in model
|
879 + | pub(crate) fn set_regular_string(
|
880 + | mut self,
|
881 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
882 + | ) -> Self {
|
883 + | self.regular_string = input.map(|v| v.into());
|
884 + | self
|
885 + | }
|
886 + | #[allow(missing_docs)] // documentation missing in model
|
887 + | pub fn punned_vec(mut self, input: ::std::option::Option<crate::model::Vec>) -> Self {
|
888 + | self.punned_vec = input;
|
889 + | self
|
890 + | }
|
891 + | #[allow(missing_docs)] // documentation missing in model
|
892 + | pub(crate) fn set_punned_vec(
|
893 + | mut self,
|
894 + | input: Option<impl ::std::convert::Into<crate::model::Vec>>,
|
895 + | ) -> Self {
|
896 + | self.punned_vec = input.map(|v| v.into());
|
897 + | self
|
898 + | }
|
899 + | /// Consumes the builder and constructs a [`StructureNamePunningInput`](crate::input::StructureNamePunningInput).
|
900 + | pub fn build(self) -> crate::input::StructureNamePunningInput {
|
901 + | self.build_enforcing_all_constraints()
|
902 + | }
|
903 + | fn build_enforcing_all_constraints(self) -> crate::input::StructureNamePunningInput {
|
904 + | crate::input::StructureNamePunningInput {
|
905 + | regular_string: self.regular_string,
|
906 + | punned_vec: self.punned_vec,
|
907 + | }
|
908 + | }
|
909 + | }
|
910 + | }
|
911 + | /// See [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput).
|
912 + | pub mod reserved_words_as_members_input {
|
913 + |
|
914 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
915 + | /// Holds one variant for each of the ways the builder can fail.
|
916 + | #[non_exhaustive]
|
917 + | #[allow(clippy::enum_variant_names)]
|
918 + | pub enum ConstraintViolation {
|
919 + | /// Constraint violation occurred building member `r#enum` when building `ReservedWordsAsMembersInput`.
|
920 + | #[doc(hidden)]
|
921 + | Enum(crate::model::unknown_variant_colliding_enum::ConstraintViolation),
|
922 + | }
|
923 + | impl ::std::fmt::Display for ConstraintViolation {
|
924 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
925 + | match self {
|
926 + | ConstraintViolation::Enum(_) => write!(f, "constraint violation occurred building member `r#enum` when building `ReservedWordsAsMembersInput`"),
|
927 + | }
|
928 + | }
|
929 + | }
|
930 + | impl ::std::error::Error for ConstraintViolation {}
|
931 + | impl ConstraintViolation {
|
932 + | pub(crate) fn as_validation_exception_field(
|
933 + | self,
|
934 + | path: ::std::string::String,
|
935 + | ) -> crate::model::ValidationExceptionField {
|
936 + | match self {
|
937 + | ConstraintViolation::Enum(inner) => {
|
938 + | inner.as_validation_exception_field(path + "/enum")
|
939 + | }
|
940 + | }
|
941 + | }
|
942 + | }
|
943 + | impl ::std::convert::From<ConstraintViolation>
|
944 + | for ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection
|
945 + | {
|
946 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
947 + | let first_validation_exception_field =
|
948 + | constraint_violation.as_validation_exception_field("".to_owned());
|
949 + | let validation_exception = crate::error::ValidationException {
|
950 + | message: format!(
|
951 + | "1 validation error detected. {}",
|
952 + | &first_validation_exception_field.message
|
953 + | ),
|
954 + | field_list: Some(vec![first_validation_exception_field]),
|
955 + | };
|
956 + | Self::ConstraintViolation(
|
957 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
958 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
959 + | )
|
960 + | }
|
961 + | }
|
962 + | impl ::std::convert::From<Builder>
|
963 + | for crate::constrained::MaybeConstrained<crate::input::ReservedWordsAsMembersInput>
|
964 + | {
|
965 + | fn from(builder: Builder) -> Self {
|
966 + | Self::Unconstrained(builder)
|
967 + | }
|
968 + | }
|
969 + | impl ::std::convert::TryFrom<Builder> for crate::input::ReservedWordsAsMembersInput {
|
970 + | type Error = ConstraintViolation;
|
971 + |
|
972 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
973 + | builder.build()
|
974 + | }
|
975 + | }
|
976 + | /// A builder for [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput).
|
977 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
978 + | pub struct Builder {
|
979 + | pub(crate) r#as: ::std::option::Option<i32>,
|
980 + | pub(crate) r#async: ::std::option::Option<bool>,
|
981 + | pub(crate) r#enum: ::std::option::Option<
|
982 + | crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>,
|
983 + | >,
|
984 + | pub(crate) self_: ::std::option::Option<bool>,
|
985 + | pub(crate) crate_: ::std::option::Option<bool>,
|
986 + | pub(crate) super_: ::std::option::Option<bool>,
|
987 + | pub(crate) build_value: ::std::option::Option<::std::string::String>,
|
988 + | pub(crate) default_value: ::std::option::Option<::std::string::String>,
|
989 + | pub(crate) send: ::std::option::Option<::std::string::String>,
|
990 + | }
|
991 + | impl Builder {
|
992 + | #[allow(missing_docs)] // documentation missing in model
|
993 + | pub fn r#as(mut self, input: ::std::option::Option<i32>) -> Self {
|
994 + | self.r#as = input;
|
995 + | self
|
996 + | }
|
997 + | #[allow(missing_docs)] // documentation missing in model
|
998 + | pub(crate) fn set_as(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
999 + | self.r#as = input.map(|v| v.into());
|
1000 + | self
|
1001 + | }
|
1002 + | #[allow(missing_docs)] // documentation missing in model
|
1003 + | pub fn r#async(mut self, input: ::std::option::Option<bool>) -> Self {
|
1004 + | self.r#async = input;
|
1005 + | self
|
1006 + | }
|
1007 + | #[allow(missing_docs)] // documentation missing in model
|
1008 + | pub(crate) fn set_async(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
1009 + | self.r#async = input.map(|v| v.into());
|
1010 + | self
|
1011 + | }
|
1012 + | #[allow(missing_docs)] // documentation missing in model
|
1013 + | pub fn r#enum(
|
1014 + | mut self,
|
1015 + | input: ::std::option::Option<crate::model::UnknownVariantCollidingEnum>,
|
1016 + | ) -> Self {
|
1017 + | self.r#enum = input.map(crate::constrained::MaybeConstrained::Constrained);
|
1018 + | self
|
1019 + | }
|
1020 + | #[allow(missing_docs)] // documentation missing in model
|
1021 + | pub(crate) fn set_enum(
|
1022 + | mut self,
|
1023 + | input: Option<
|
1024 + | impl ::std::convert::Into<
|
1025 + | crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>,
|
1026 + | >,
|
1027 + | >,
|
1028 + | ) -> Self {
|
1029 + | self.r#enum = input.map(|v| v.into());
|
1030 + | self
|
1031 + | }
|
1032 + | #[allow(missing_docs)] // documentation missing in model
|
1033 + | pub fn self_(mut self, input: ::std::option::Option<bool>) -> Self {
|
1034 + | self.self_ = input;
|
1035 + | self
|
1036 + | }
|
1037 + | #[allow(missing_docs)] // documentation missing in model
|
1038 + | pub(crate) fn set_self(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
1039 + | self.self_ = input.map(|v| v.into());
|
1040 + | self
|
1041 + | }
|
1042 + | #[allow(missing_docs)] // documentation missing in model
|
1043 + | pub fn crate_(mut self, input: ::std::option::Option<bool>) -> Self {
|
1044 + | self.crate_ = input;
|
1045 + | self
|
1046 + | }
|
1047 + | #[allow(missing_docs)] // documentation missing in model
|
1048 + | pub(crate) fn set_crate(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
1049 + | self.crate_ = input.map(|v| v.into());
|
1050 + | self
|
1051 + | }
|
1052 + | #[allow(missing_docs)] // documentation missing in model
|
1053 + | pub fn super_(mut self, input: ::std::option::Option<bool>) -> Self {
|
1054 + | self.super_ = input;
|
1055 + | self
|
1056 + | }
|
1057 + | #[allow(missing_docs)] // documentation missing in model
|
1058 + | pub(crate) fn set_super(mut self, input: Option<impl ::std::convert::Into<bool>>) -> Self {
|
1059 + | self.super_ = input.map(|v| v.into());
|
1060 + | self
|
1061 + | }
|
1062 + | #[allow(missing_docs)] // documentation missing in model
|
1063 + | pub fn build_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1064 + | self.build_value = input;
|
1065 + | self
|
1066 + | }
|
1067 + | #[allow(missing_docs)] // documentation missing in model
|
1068 + | pub(crate) fn set_build(
|
1069 + | mut self,
|
1070 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1071 + | ) -> Self {
|
1072 + | self.build_value = input.map(|v| v.into());
|
1073 + | self
|
1074 + | }
|
1075 + | #[allow(missing_docs)] // documentation missing in model
|
1076 + | pub fn default_value(
|
1077 + | mut self,
|
1078 + | input: ::std::option::Option<::std::string::String>,
|
1079 + | ) -> Self {
|
1080 + | self.default_value = input;
|
1081 + | self
|
1082 + | }
|
1083 + | #[allow(missing_docs)] // documentation missing in model
|
1084 + | pub(crate) fn set_default(
|
1085 + | mut self,
|
1086 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1087 + | ) -> Self {
|
1088 + | self.default_value = input.map(|v| v.into());
|
1089 + | self
|
1090 + | }
|
1091 + | #[allow(missing_docs)] // documentation missing in model
|
1092 + | pub fn send(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1093 + | self.send = input;
|
1094 + | self
|
1095 + | }
|
1096 + | #[allow(missing_docs)] // documentation missing in model
|
1097 + | pub(crate) fn set_send(
|
1098 + | mut self,
|
1099 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1100 + | ) -> Self {
|
1101 + | self.send = input.map(|v| v.into());
|
1102 + | self
|
1103 + | }
|
1104 + | /// Consumes the builder and constructs a [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput).
|
1105 + | ///
|
1106 + | /// The builder fails to construct a [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput) if a [`ConstraintViolation`] occurs.
|
1107 + | ///
|
1108 + | pub fn build(
|
1109 + | self,
|
1110 + | ) -> Result<crate::input::ReservedWordsAsMembersInput, ConstraintViolation> {
|
1111 + | self.build_enforcing_all_constraints()
|
1112 + | }
|
1113 + | fn build_enforcing_all_constraints(
|
1114 + | self,
|
1115 + | ) -> Result<crate::input::ReservedWordsAsMembersInput, ConstraintViolation> {
|
1116 + | Ok(crate::input::ReservedWordsAsMembersInput {
|
1117 + | r#as: self.r#as,
|
1118 + | r#async: self.r#async,
|
1119 + | r#enum: self
|
1120 + | .r#enum
|
1121 + | .map(|v| match v {
|
1122 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
1123 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
1124 + | })
|
1125 + | .map(|res| res.map_err(ConstraintViolation::Enum))
|
1126 + | .transpose()?,
|
1127 + | self_: self.self_,
|
1128 + | crate_: self.crate_,
|
1129 + | super_: self.super_,
|
1130 + | build_value: self.build_value,
|
1131 + | default_value: self.default_value,
|
1132 + | send: self.send,
|
1133 + | })
|
1134 + | }
|
1135 + | }
|
1136 + | }
|