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 ResponseCodeDefaultOperationInput {}
|
7 + | impl ResponseCodeDefaultOperationInput {
|
8 + | /// Creates a new builder-style object to manufacture [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
|
9 + | pub fn builder() -> crate::input::response_code_default_operation_input::Builder {
|
10 + | crate::input::response_code_default_operation_input::Builder::default()
|
11 + | }
|
12 + | }
|
13 + | impl crate::constrained::Constrained for crate::input::ResponseCodeDefaultOperationInput {
|
14 + | type Unconstrained = crate::input::response_code_default_operation_input::Builder;
|
15 + | }
|
16 + |
|
17 + | #[allow(missing_docs)] // documentation missing in model
|
18 + | #[derive(
|
19 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
20 + | )]
|
21 + | pub struct ResponseCodeHttpFallbackOperationInput {}
|
22 + | impl ResponseCodeHttpFallbackOperationInput {
|
23 + | /// Creates a new builder-style object to manufacture [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
|
24 + | pub fn builder() -> crate::input::response_code_http_fallback_operation_input::Builder {
|
25 + | crate::input::response_code_http_fallback_operation_input::Builder::default()
|
26 + | }
|
27 + | }
|
28 + | impl crate::constrained::Constrained for crate::input::ResponseCodeHttpFallbackOperationInput {
|
29 + | type Unconstrained = crate::input::response_code_http_fallback_operation_input::Builder;
|
30 + | }
|
31 + |
|
32 + | #[allow(missing_docs)] // documentation missing in model
|
33 + | #[derive(
|
34 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
35 + | )]
|
36 + | pub struct ResponseCodeRequiredOperationInput {}
|
37 + | impl ResponseCodeRequiredOperationInput {
|
38 + | /// Creates a new builder-style object to manufacture [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
|
39 + | pub fn builder() -> crate::input::response_code_required_operation_input::Builder {
|
40 + | crate::input::response_code_required_operation_input::Builder::default()
|
41 + | }
|
42 + | }
|
43 + | impl crate::constrained::Constrained for crate::input::ResponseCodeRequiredOperationInput {
|
44 + | type Unconstrained = crate::input::response_code_required_operation_input::Builder;
|
45 + | }
|
46 + |
|
47 + | #[allow(missing_docs)] // documentation missing in model
|
48 + | #[derive(
|
49 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
50 + | )]
|
51 + | pub struct RequiredHeaderCollectionOperationInput {
|
52 + | #[allow(missing_docs)] // documentation missing in model
|
53 + | pub required_header_list: ::std::vec::Vec<::std::string::String>,
|
54 + | #[allow(missing_docs)] // documentation missing in model
|
55 + | pub required_header_set: crate::model::HeaderSet,
|
56 + | }
|
57 + | impl RequiredHeaderCollectionOperationInput {
|
58 + | #[allow(missing_docs)] // documentation missing in model
|
59 + | pub fn required_header_list(&self) -> &[::std::string::String] {
|
60 + | use std::ops::Deref;
|
61 + | self.required_header_list.deref()
|
62 + | }
|
63 + | #[allow(missing_docs)] // documentation missing in model
|
64 + | pub fn required_header_set(&self) -> &crate::model::HeaderSet {
|
65 + | &self.required_header_set
|
66 + | }
|
67 + | }
|
68 + | impl RequiredHeaderCollectionOperationInput {
|
69 + | /// Creates a new builder-style object to manufacture [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput).
|
70 + | pub fn builder() -> crate::input::required_header_collection_operation_input::Builder {
|
71 + | crate::input::required_header_collection_operation_input::Builder::default()
|
72 + | }
|
73 + | }
|
74 + | impl crate::constrained::Constrained for crate::input::RequiredHeaderCollectionOperationInput {
|
75 + | type Unconstrained = crate::input::required_header_collection_operation_input::Builder;
|
76 + | }
|
77 + |
|
78 + | #[allow(missing_docs)] // documentation missing in model
|
79 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
80 + | pub struct RequiredInnerShapeOperationInput {
|
81 + | #[allow(missing_docs)] // documentation missing in model
|
82 + | pub inner: ::std::option::Option<crate::model::InnerShape>,
|
83 + | }
|
84 + | impl RequiredInnerShapeOperationInput {
|
85 + | #[allow(missing_docs)] // documentation missing in model
|
86 + | pub fn inner(&self) -> ::std::option::Option<&crate::model::InnerShape> {
|
87 + | self.inner.as_ref()
|
88 + | }
|
89 + | }
|
90 + | impl RequiredInnerShapeOperationInput {
|
91 + | /// Creates a new builder-style object to manufacture [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
|
92 + | pub fn builder() -> crate::input::required_inner_shape_operation_input::Builder {
|
93 + | crate::input::required_inner_shape_operation_input::Builder::default()
|
94 + | }
|
95 + | }
|
96 + | impl crate::constrained::Constrained for crate::input::RequiredInnerShapeOperationInput {
|
97 + | type Unconstrained = crate::input::required_inner_shape_operation_input::Builder;
|
98 + | }
|
99 + |
|
100 + | #[allow(missing_docs)] // documentation missing in model
|
101 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
102 + | pub struct TypeComplexityOperationInput {
|
103 + | #[allow(missing_docs)] // documentation missing in model
|
104 + | pub list: ::std::option::Option<
|
105 + | ::std::vec::Vec<
|
106 + | ::std::vec::Vec<
|
107 + | ::std::vec::Vec<
|
108 + | ::std::collections::HashMap<
|
109 + | ::std::string::String,
|
110 + | crate::model::EmptyStructure,
|
111 + | >,
|
112 + | >,
|
113 + | >,
|
114 + | >,
|
115 + | >,
|
116 + | }
|
117 + | impl TypeComplexityOperationInput {
|
118 + | #[allow(missing_docs)] // documentation missing in model
|
119 + | pub fn list(
|
120 + | &self,
|
121 + | ) -> ::std::option::Option<
|
122 + | &[::std::vec::Vec<
|
123 + | ::std::vec::Vec<
|
124 + | ::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>,
|
125 + | >,
|
126 + | >],
|
127 + | > {
|
128 + | self.list.as_deref()
|
129 + | }
|
130 + | }
|
131 + | impl TypeComplexityOperationInput {
|
132 + | /// Creates a new builder-style object to manufacture [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
|
133 + | pub fn builder() -> crate::input::type_complexity_operation_input::Builder {
|
134 + | crate::input::type_complexity_operation_input::Builder::default()
|
135 + | }
|
136 + | }
|
137 + | impl crate::constrained::Constrained for crate::input::TypeComplexityOperationInput {
|
138 + | type Unconstrained = crate::input::type_complexity_operation_input::Builder;
|
139 + | }
|
140 + | /// See [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
|
141 + | pub mod response_code_default_operation_input {
|
142 + |
|
143 + | impl ::std::convert::From<Builder> for crate::input::ResponseCodeDefaultOperationInput {
|
144 + | fn from(builder: Builder) -> Self {
|
145 + | builder.build()
|
146 + | }
|
147 + | }
|
148 + | /// A builder for [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
|
149 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
150 + | pub struct Builder {}
|
151 + | impl Builder {
|
152 + | /// Consumes the builder and constructs a [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput).
|
153 + | pub fn build(self) -> crate::input::ResponseCodeDefaultOperationInput {
|
154 + | self.build_enforcing_all_constraints()
|
155 + | }
|
156 + | fn build_enforcing_all_constraints(
|
157 + | self,
|
158 + | ) -> crate::input::ResponseCodeDefaultOperationInput {
|
159 + | crate::input::ResponseCodeDefaultOperationInput {}
|
160 + | }
|
161 + | }
|
162 + | }
|
163 + | /// See [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
|
164 + | pub mod response_code_http_fallback_operation_input {
|
165 + |
|
166 + | impl ::std::convert::From<Builder> for crate::input::ResponseCodeHttpFallbackOperationInput {
|
167 + | fn from(builder: Builder) -> Self {
|
168 + | builder.build()
|
169 + | }
|
170 + | }
|
171 + | /// A builder for [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
|
172 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
173 + | pub struct Builder {}
|
174 + | impl Builder {
|
175 + | /// Consumes the builder and constructs a [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput).
|
176 + | pub fn build(self) -> crate::input::ResponseCodeHttpFallbackOperationInput {
|
177 + | self.build_enforcing_all_constraints()
|
178 + | }
|
179 + | fn build_enforcing_all_constraints(
|
180 + | self,
|
181 + | ) -> crate::input::ResponseCodeHttpFallbackOperationInput {
|
182 + | crate::input::ResponseCodeHttpFallbackOperationInput {}
|
183 + | }
|
184 + | }
|
185 + | }
|
186 + | /// See [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
|
187 + | pub mod response_code_required_operation_input {
|
188 + |
|
189 + | impl ::std::convert::From<Builder> for crate::input::ResponseCodeRequiredOperationInput {
|
190 + | fn from(builder: Builder) -> Self {
|
191 + | builder.build()
|
192 + | }
|
193 + | }
|
194 + | /// A builder for [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
|
195 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
196 + | pub struct Builder {}
|
197 + | impl Builder {
|
198 + | /// Consumes the builder and constructs a [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput).
|
199 + | pub fn build(self) -> crate::input::ResponseCodeRequiredOperationInput {
|
200 + | self.build_enforcing_all_constraints()
|
201 + | }
|
202 + | fn build_enforcing_all_constraints(
|
203 + | self,
|
204 + | ) -> crate::input::ResponseCodeRequiredOperationInput {
|
205 + | crate::input::ResponseCodeRequiredOperationInput {}
|
206 + | }
|
207 + | }
|
208 + | }
|
209 + | /// See [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput).
|
210 + | pub mod required_header_collection_operation_input {
|
211 + |
|
212 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
213 + | /// Holds one variant for each of the ways the builder can fail.
|
214 + | #[non_exhaustive]
|
215 + | #[allow(clippy::enum_variant_names)]
|
216 + | pub enum ConstraintViolation {
|
217 + | /// `required_header_list` was not provided but it is required when building `RequiredHeaderCollectionOperationInput`.
|
218 + | MissingRequiredHeaderList,
|
219 + | /// `required_header_set` was not provided but it is required when building `RequiredHeaderCollectionOperationInput`.
|
220 + | MissingRequiredHeaderSet,
|
221 + | /// Constraint violation occurred building member `required_header_set` when building `RequiredHeaderCollectionOperationInput`.
|
222 + | #[doc(hidden)]
|
223 + | RequiredHeaderSet(crate::model::header_set::ConstraintViolation),
|
224 + | }
|
225 + | impl ::std::fmt::Display for ConstraintViolation {
|
226 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
227 + | match self {
|
228 + | ConstraintViolation::MissingRequiredHeaderList => write!(f, "`required_header_list` was not provided but it is required when building `RequiredHeaderCollectionOperationInput`"),
|
229 + | ConstraintViolation::MissingRequiredHeaderSet => write!(f, "`required_header_set` was not provided but it is required when building `RequiredHeaderCollectionOperationInput`"),
|
230 + | ConstraintViolation::RequiredHeaderSet(_) => write!(f, "constraint violation occurred building member `required_header_set` when building `RequiredHeaderCollectionOperationInput`"),
|
231 + | }
|
232 + | }
|
233 + | }
|
234 + | impl ::std::error::Error for ConstraintViolation {}
|
235 + | impl ConstraintViolation {
|
236 + | pub(crate) fn as_validation_exception_field(
|
237 + | self,
|
238 + | path: ::std::string::String,
|
239 + | ) -> crate::model::ValidationExceptionField {
|
240 + | match self {
|
241 + | ConstraintViolation::MissingRequiredHeaderList => crate::model::ValidationExceptionField {
|
242 + | message: format!("Value at '{}/requiredHeaderList' failed to satisfy constraint: Member must not be null", path),
|
243 + | path: path + "/requiredHeaderList",
|
244 + | },
|
245 + | ConstraintViolation::MissingRequiredHeaderSet => crate::model::ValidationExceptionField {
|
246 + | message: format!("Value at '{}/requiredHeaderSet' failed to satisfy constraint: Member must not be null", path),
|
247 + | path: path + "/requiredHeaderSet",
|
248 + | },
|
249 + | ConstraintViolation::RequiredHeaderSet(inner) => inner.as_validation_exception_field(path + "/requiredHeaderSet"),
|
250 + | }
|
251 + | }
|
252 + | }
|
253 + | impl ::std::convert::From<ConstraintViolation>
|
254 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
255 + | {
|
256 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
257 + | let first_validation_exception_field =
|
258 + | constraint_violation.as_validation_exception_field("".to_owned());
|
259 + | let validation_exception = crate::error::ValidationException {
|
260 + | message: format!(
|
261 + | "1 validation error detected. {}",
|
262 + | &first_validation_exception_field.message
|
263 + | ),
|
264 + | field_list: Some(vec![first_validation_exception_field]),
|
265 + | };
|
266 + | Self::ConstraintViolation(
|
267 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
268 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
269 + | )
|
270 + | }
|
271 + | }
|
272 + | impl ::std::convert::From<Builder>
|
273 + | for crate::constrained::MaybeConstrained<
|
274 + | crate::input::RequiredHeaderCollectionOperationInput,
|
275 + | >
|
276 + | {
|
277 + | fn from(builder: Builder) -> Self {
|
278 + | Self::Unconstrained(builder)
|
279 + | }
|
280 + | }
|
281 + | impl ::std::convert::TryFrom<Builder> for crate::input::RequiredHeaderCollectionOperationInput {
|
282 + | type Error = ConstraintViolation;
|
283 + |
|
284 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
285 + | builder.build()
|
286 + | }
|
287 + | }
|
288 + | /// A builder for [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput).
|
289 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
290 + | pub struct Builder {
|
291 + | pub(crate) required_header_list:
|
292 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
293 + | pub(crate) required_header_set:
|
294 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::HeaderSet>>,
|
295 + | }
|
296 + | impl Builder {
|
297 + | #[allow(missing_docs)] // documentation missing in model
|
298 + | pub fn required_header_list(
|
299 + | mut self,
|
300 + | input: ::std::vec::Vec<::std::string::String>,
|
301 + | ) -> Self {
|
302 + | self.required_header_list = Some(input);
|
303 + | self
|
304 + | }
|
305 + | #[allow(missing_docs)] // documentation missing in model
|
306 + | pub(crate) fn set_required_header_list(
|
307 + | mut self,
|
308 + | input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>,
|
309 + | ) -> Self {
|
310 + | self.required_header_list = Some(input.into());
|
311 + | self
|
312 + | }
|
313 + | #[allow(missing_docs)] // documentation missing in model
|
314 + | pub fn required_header_set(mut self, input: crate::model::HeaderSet) -> Self {
|
315 + | self.required_header_set =
|
316 + | Some(crate::constrained::MaybeConstrained::Constrained(input));
|
317 + | self
|
318 + | }
|
319 + | #[allow(missing_docs)] // documentation missing in model
|
320 + | pub(crate) fn set_required_header_set(
|
321 + | mut self,
|
322 + | input: impl ::std::convert::Into<
|
323 + | crate::constrained::MaybeConstrained<crate::model::HeaderSet>,
|
324 + | >,
|
325 + | ) -> Self {
|
326 + | self.required_header_set = Some(input.into());
|
327 + | self
|
328 + | }
|
329 + | /// Consumes the builder and constructs a [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput).
|
330 + | ///
|
331 + | /// The builder fails to construct a [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput) if a [`ConstraintViolation`] occurs.
|
332 + | ///
|
333 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
334 + | pub fn build(
|
335 + | self,
|
336 + | ) -> Result<crate::input::RequiredHeaderCollectionOperationInput, ConstraintViolation>
|
337 + | {
|
338 + | self.build_enforcing_all_constraints()
|
339 + | }
|
340 + | fn build_enforcing_all_constraints(
|
341 + | self,
|
342 + | ) -> Result<crate::input::RequiredHeaderCollectionOperationInput, ConstraintViolation>
|
343 + | {
|
344 + | Ok(crate::input::RequiredHeaderCollectionOperationInput {
|
345 + | required_header_list: self
|
346 + | .required_header_list
|
347 + | .ok_or(ConstraintViolation::MissingRequiredHeaderList)?,
|
348 + | required_header_set: self
|
349 + | .required_header_set
|
350 + | .map(|v| match v {
|
351 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
352 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
353 + | })
|
354 + | .map(|res| res.map_err(ConstraintViolation::RequiredHeaderSet))
|
355 + | .transpose()?
|
356 + | .ok_or(ConstraintViolation::MissingRequiredHeaderSet)?,
|
357 + | })
|
358 + | }
|
359 + | }
|
360 + | }
|
361 + | /// See [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
|
362 + | pub mod required_inner_shape_operation_input {
|
363 + |
|
364 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
365 + | /// Holds one variant for each of the ways the builder can fail.
|
366 + | #[non_exhaustive]
|
367 + | #[allow(clippy::enum_variant_names)]
|
368 + | pub enum ConstraintViolation {
|
369 + | /// Constraint violation occurred building member `inner` when building `RequiredInnerShapeOperationInput`.
|
370 + | #[doc(hidden)]
|
371 + | Inner(crate::model::inner_shape::ConstraintViolation),
|
372 + | }
|
373 + | impl ::std::fmt::Display for ConstraintViolation {
|
374 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
375 + | match self {
|
376 + | ConstraintViolation::Inner(_) => write!(f, "constraint violation occurred building member `inner` when building `RequiredInnerShapeOperationInput`"),
|
377 + | }
|
378 + | }
|
379 + | }
|
380 + | impl ::std::error::Error for ConstraintViolation {}
|
381 + | impl ConstraintViolation {
|
382 + | pub(crate) fn as_validation_exception_field(
|
383 + | self,
|
384 + | path: ::std::string::String,
|
385 + | ) -> crate::model::ValidationExceptionField {
|
386 + | match self {
|
387 + | ConstraintViolation::Inner(inner) => {
|
388 + | inner.as_validation_exception_field(path + "/inner")
|
389 + | }
|
390 + | }
|
391 + | }
|
392 + | }
|
393 + | impl ::std::convert::From<ConstraintViolation>
|
394 + | for ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
395 + | {
|
396 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
397 + | let first_validation_exception_field =
|
398 + | constraint_violation.as_validation_exception_field("".to_owned());
|
399 + | let validation_exception = crate::error::ValidationException {
|
400 + | message: format!(
|
401 + | "1 validation error detected. {}",
|
402 + | &first_validation_exception_field.message
|
403 + | ),
|
404 + | field_list: Some(vec![first_validation_exception_field]),
|
405 + | };
|
406 + | Self::ConstraintViolation(
|
407 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
408 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
409 + | )
|
410 + | }
|
411 + | }
|
412 + | impl ::std::convert::From<Builder>
|
413 + | for crate::constrained::MaybeConstrained<crate::input::RequiredInnerShapeOperationInput>
|
414 + | {
|
415 + | fn from(builder: Builder) -> Self {
|
416 + | Self::Unconstrained(builder)
|
417 + | }
|
418 + | }
|
419 + | impl ::std::convert::TryFrom<Builder> for crate::input::RequiredInnerShapeOperationInput {
|
420 + | type Error = ConstraintViolation;
|
421 + |
|
422 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
423 + | builder.build()
|
424 + | }
|
425 + | }
|
426 + | /// A builder for [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
|
427 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
428 + | pub struct Builder {
|
429 + | pub(crate) inner:
|
430 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::InnerShape>>,
|
431 + | }
|
432 + | impl Builder {
|
433 + | #[allow(missing_docs)] // documentation missing in model
|
434 + | pub fn inner(mut self, input: ::std::option::Option<crate::model::InnerShape>) -> Self {
|
435 + | self.inner = input.map(crate::constrained::MaybeConstrained::Constrained);
|
436 + | self
|
437 + | }
|
438 + | #[allow(missing_docs)] // documentation missing in model
|
439 + | pub(crate) fn set_inner(
|
440 + | mut self,
|
441 + | input: Option<
|
442 + | impl ::std::convert::Into<
|
443 + | crate::constrained::MaybeConstrained<crate::model::InnerShape>,
|
444 + | >,
|
445 + | >,
|
446 + | ) -> Self {
|
447 + | self.inner = input.map(|v| v.into());
|
448 + | self
|
449 + | }
|
450 + | /// Consumes the builder and constructs a [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput).
|
451 + | ///
|
452 + | /// The builder fails to construct a [`RequiredInnerShapeOperationInput`](crate::input::RequiredInnerShapeOperationInput) if a [`ConstraintViolation`] occurs.
|
453 + | ///
|
454 + | pub fn build(
|
455 + | self,
|
456 + | ) -> Result<crate::input::RequiredInnerShapeOperationInput, ConstraintViolation> {
|
457 + | self.build_enforcing_all_constraints()
|
458 + | }
|
459 + | fn build_enforcing_all_constraints(
|
460 + | self,
|
461 + | ) -> Result<crate::input::RequiredInnerShapeOperationInput, ConstraintViolation> {
|
462 + | Ok(crate::input::RequiredInnerShapeOperationInput {
|
463 + | inner: self
|
464 + | .inner
|
465 + | .map(|v| match v {
|
466 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
467 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
468 + | })
|
469 + | .map(|res| res.map_err(ConstraintViolation::Inner))
|
470 + | .transpose()?,
|
471 + | })
|
472 + | }
|
473 + | }
|
474 + | }
|
475 + | /// See [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
|
476 + | pub mod type_complexity_operation_input {
|
477 + |
|
478 + | impl ::std::convert::From<Builder> for crate::input::TypeComplexityOperationInput {
|
479 + | fn from(builder: Builder) -> Self {
|
480 + | builder.build()
|
481 + | }
|
482 + | }
|
483 + | /// A builder for [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
|
484 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
485 + | pub struct Builder {
|
486 + | pub(crate) list: ::std::option::Option<
|
487 + | ::std::vec::Vec<
|
488 + | ::std::vec::Vec<
|
489 + | ::std::vec::Vec<
|
490 + | ::std::collections::HashMap<
|
491 + | ::std::string::String,
|
492 + | crate::model::EmptyStructure,
|
493 + | >,
|
494 + | >,
|
495 + | >,
|
496 + | >,
|
497 + | >,
|
498 + | }
|
499 + | impl Builder {
|
500 + | #[allow(missing_docs)] // documentation missing in model
|
501 + | pub fn list(
|
502 + | mut self,
|
503 + | input: ::std::option::Option<
|
504 + | ::std::vec::Vec<
|
505 + | ::std::vec::Vec<
|
506 + | ::std::vec::Vec<
|
507 + | ::std::collections::HashMap<
|
508 + | ::std::string::String,
|
509 + | crate::model::EmptyStructure,
|
510 + | >,
|
511 + | >,
|
512 + | >,
|
513 + | >,
|
514 + | >,
|
515 + | ) -> Self {
|
516 + | self.list = input;
|
517 + | self
|
518 + | }
|
519 + | #[allow(missing_docs)] // documentation missing in model
|
520 + | pub(crate) fn set_list(
|
521 + | mut self,
|
522 + | input: Option<
|
523 + | impl ::std::convert::Into<
|
524 + | ::std::vec::Vec<
|
525 + | ::std::vec::Vec<
|
526 + | ::std::vec::Vec<
|
527 + | ::std::collections::HashMap<
|
528 + | ::std::string::String,
|
529 + | crate::model::EmptyStructure,
|
530 + | >,
|
531 + | >,
|
532 + | >,
|
533 + | >,
|
534 + | >,
|
535 + | >,
|
536 + | ) -> Self {
|
537 + | self.list = input.map(|v| v.into());
|
538 + | self
|
539 + | }
|
540 + | /// Consumes the builder and constructs a [`TypeComplexityOperationInput`](crate::input::TypeComplexityOperationInput).
|
541 + | pub fn build(self) -> crate::input::TypeComplexityOperationInput {
|
542 + | self.build_enforcing_all_constraints()
|
543 + | }
|
544 + | fn build_enforcing_all_constraints(self) -> crate::input::TypeComplexityOperationInput {
|
545 + | crate::input::TypeComplexityOperationInput { list: self.list }
|
546 + | }
|
547 + | }
|
548 + | }
|