448 448 | type Unconstrained =
|
449 449 | crate::input::query_params_targeting_length_map_operation_input_internal::Builder;
|
450 450 | }
|
451 451 | impl QueryParamsTargetingLengthMapOperationInput {
|
452 452 | /// Creates a new builder-style object to manufacture [`QueryParamsTargetingLengthMapOperationInput`](crate::input::QueryParamsTargetingLengthMapOperationInput).
|
453 453 | pub fn builder() -> crate::input::query_params_targeting_length_map_operation_input::Builder {
|
454 454 | crate::input::query_params_targeting_length_map_operation_input::Builder::default()
|
455 455 | }
|
456 456 | }
|
457 457 |
|
458 + | #[allow(missing_docs)] // documentation missing in model
|
459 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
460 + | pub struct ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
|
461 + | #[allow(missing_docs)] // documentation missing in model
|
462 + | pub a: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
463 + | #[allow(missing_docs)] // documentation missing in model
|
464 + | pub b: ::std::option::Option<
|
465 + | ::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
|
466 + | >,
|
467 + | }
|
468 + | impl ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
|
469 + | #[allow(missing_docs)] // documentation missing in model
|
470 + | pub fn a(&self) -> ::std::option::Option<&[::std::vec::Vec<::std::string::String>]> {
|
471 + | self.a.as_deref()
|
472 + | }
|
473 + | #[allow(missing_docs)] // documentation missing in model
|
474 + | pub fn b(
|
475 + | &self,
|
476 + | ) -> ::std::option::Option<
|
477 + | &[::std::collections::HashMap<::std::string::String, ::std::string::String>],
|
478 + | > {
|
479 + | self.b.as_deref()
|
480 + | }
|
481 + | }
|
482 + | impl crate::constrained::Constrained
|
483 + | for crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput
|
484 + | {
|
485 + | type Unconstrained = crate::input::constrained_list_with_indirectly_constrained_aggregate_operation_input_internal::Builder;
|
486 + | }
|
487 + | impl ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
|
488 + | /// Creates a new builder-style object to manufacture [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
|
489 + | pub fn builder(
|
490 + | ) -> crate::input::constrained_list_with_indirectly_constrained_aggregate_operation_input::Builder
|
491 + | {
|
492 + | crate::input::constrained_list_with_indirectly_constrained_aggregate_operation_input::Builder::default()
|
493 + | }
|
494 + | }
|
495 + |
|
458 496 | #[allow(missing_docs)] // documentation missing in model
|
459 497 | #[derive(
|
460 498 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
461 499 | )]
|
462 500 | pub struct ConstrainedRecursiveShapesOperationInput {
|
463 501 | #[allow(missing_docs)] // documentation missing in model
|
464 502 | pub nested: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
465 503 | #[allow(missing_docs)] // documentation missing in model
|
466 504 | pub recursive_list: ::std::vec::Vec<crate::model::RecursiveShapesInputOutputNested1>,
|
467 505 | }
|
3132 3170 | }
|
3133 3171 | fn build_enforcing_required_and_enum_traits(
|
3134 3172 | self,
|
3135 3173 | ) -> crate::input::QueryParamsTargetingLengthMapOperationInput {
|
3136 3174 | crate::input::QueryParamsTargetingLengthMapOperationInput {
|
3137 3175 | length_map: self.length_map,
|
3138 3176 | }
|
3139 3177 | }
|
3140 3178 | }
|
3141 3179 | }
|
3180 + | /// See [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
|
3181 + | pub(crate) mod constrained_list_with_indirectly_constrained_aggregate_operation_input_internal {
|
3182 + |
|
3183 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3184 + | /// Holds one variant for each of the ways the builder can fail.
|
3185 + | #[non_exhaustive]
|
3186 + | #[allow(clippy::enum_variant_names)]
|
3187 + | pub(crate) enum ConstraintViolation {
|
3188 + | /// Constraint violation occurred building member `a` when building `ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`.
|
3189 + | #[doc(hidden)]
|
3190 + | A(crate::model::list_with_indirectly_constrained_list_internal::ConstraintViolation),
|
3191 + | /// Constraint violation occurred building member `b` when building `ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`.
|
3192 + | #[doc(hidden)]
|
3193 + | B(crate::model::list_with_indirectly_constrained_map_internal::ConstraintViolation),
|
3194 + | }
|
3195 + | impl ::std::fmt::Display for ConstraintViolation {
|
3196 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3197 + | match self {
|
3198 + | ConstraintViolation::A(_) => write!(f, "constraint violation occurred building member `a` when building `ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`"),
|
3199 + | ConstraintViolation::B(_) => write!(f, "constraint violation occurred building member `b` when building `ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`"),
|
3200 + | }
|
3201 + | }
|
3202 + | }
|
3203 + | impl ::std::error::Error for ConstraintViolation {}
|
3204 + | impl ConstraintViolation {
|
3205 + | pub(crate) fn as_validation_exception_field(
|
3206 + | self,
|
3207 + | path: ::std::string::String,
|
3208 + | ) -> crate::model::ValidationExceptionField {
|
3209 + | match self {
|
3210 + | ConstraintViolation::A(inner) => inner.as_validation_exception_field(path + "/a"),
|
3211 + | ConstraintViolation::B(inner) => inner.as_validation_exception_field(path + "/b"),
|
3212 + | }
|
3213 + | }
|
3214 + | }
|
3215 + | impl ::std::convert::From<ConstraintViolation>
|
3216 + | for ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection
|
3217 + | {
|
3218 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
3219 + | let first_validation_exception_field =
|
3220 + | constraint_violation.as_validation_exception_field("".to_owned());
|
3221 + | let validation_exception = crate::error::ValidationException {
|
3222 + | message: format!(
|
3223 + | "1 validation error detected. {}",
|
3224 + | &first_validation_exception_field.message
|
3225 + | ),
|
3226 + | field_list: Some(vec![first_validation_exception_field]),
|
3227 + | };
|
3228 + | Self::ConstraintViolation(
|
3229 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
3230 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
3231 + | )
|
3232 + | }
|
3233 + | }
|
3234 + | impl ::std::convert::From<Builder>
|
3235 + | for crate::constrained::MaybeConstrained<
|
3236 + | crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput,
|
3237 + | >
|
3238 + | {
|
3239 + | fn from(builder: Builder) -> Self {
|
3240 + | Self::Unconstrained(builder)
|
3241 + | }
|
3242 + | }
|
3243 + | impl ::std::convert::TryFrom<Builder>
|
3244 + | for crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput
|
3245 + | {
|
3246 + | type Error = ConstraintViolation;
|
3247 + |
|
3248 + | fn try_from(builder: Builder) -> Result<Self, Self::Error> {
|
3249 + | builder.build()
|
3250 + | }
|
3251 + | }
|
3252 + | /// A builder for [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
|
3253 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3254 + | pub(crate) struct Builder {
|
3255 + | pub(crate) a: ::std::option::Option<
|
3256 + | crate::constrained::MaybeConstrained<crate::model::ListWithIndirectlyConstrainedList>,
|
3257 + | >,
|
3258 + | pub(crate) b: ::std::option::Option<
|
3259 + | crate::constrained::MaybeConstrained<crate::model::ListWithIndirectlyConstrainedMap>,
|
3260 + | >,
|
3261 + | }
|
3262 + | impl Builder {
|
3263 + | #[allow(missing_docs)] // documentation missing in model
|
3264 + | pub(crate) fn set_a(
|
3265 + | mut self,
|
3266 + | input: Option<
|
3267 + | impl ::std::convert::Into<
|
3268 + | crate::constrained::MaybeConstrained<
|
3269 + | crate::model::ListWithIndirectlyConstrainedList,
|
3270 + | >,
|
3271 + | >,
|
3272 + | >,
|
3273 + | ) -> Self {
|
3274 + | self.a = input.map(|v| v.into());
|
3275 + | self
|
3276 + | }
|
3277 + | #[allow(missing_docs)] // documentation missing in model
|
3278 + | pub(crate) fn set_b(
|
3279 + | mut self,
|
3280 + | input: Option<
|
3281 + | impl ::std::convert::Into<
|
3282 + | crate::constrained::MaybeConstrained<
|
3283 + | crate::model::ListWithIndirectlyConstrainedMap,
|
3284 + | >,
|
3285 + | >,
|
3286 + | >,
|
3287 + | ) -> Self {
|
3288 + | self.b = input.map(|v| v.into());
|
3289 + | self
|
3290 + | }
|
3291 + | /// Consumes the builder and constructs a [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
|
3292 + | ///
|
3293 + | /// The builder fails to construct a [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput) if a [`ConstraintViolation`] occurs.
|
3294 + | ///
|
3295 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
3296 + | pub fn build(
|
3297 + | self,
|
3298 + | ) -> Result<
|
3299 + | crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput,
|
3300 + | ConstraintViolation,
|
3301 + | > {
|
3302 + | self.build_enforcing_all_constraints()
|
3303 + | }
|
3304 + | fn build_enforcing_all_constraints(
|
3305 + | self,
|
3306 + | ) -> Result<
|
3307 + | crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput,
|
3308 + | ConstraintViolation,
|
3309 + | > {
|
3310 + | Ok(
|
3311 + | crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
|
3312 + | a: self
|
3313 + | .a
|
3314 + | .map(|v| match v {
|
3315 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
3316 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
3317 + | })
|
3318 + | .map(|res| res.map_err(ConstraintViolation::A))
|
3319 + | .transpose()?
|
3320 + | .map(|v: crate::model::ListWithIndirectlyConstrainedList| v.into()),
|
3321 + | b: self
|
3322 + | .b
|
3323 + | .map(|v| match v {
|
3324 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
3325 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
3326 + | })
|
3327 + | .map(|res| res.map_err(ConstraintViolation::B))
|
3328 + | .transpose()?
|
3329 + | .map(|v: crate::model::ListWithIndirectlyConstrainedMap| v.into()),
|
3330 + | },
|
3331 + | )
|
3332 + | }
|
3333 + | }
|
3334 + | }
|
3335 + | /// See [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
|
3336 + | pub mod constrained_list_with_indirectly_constrained_aggregate_operation_input {
|
3337 + |
|
3338 + | impl ::std::convert::From<Builder>
|
3339 + | for crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput
|
3340 + | {
|
3341 + | fn from(builder: Builder) -> Self {
|
3342 + | builder.build()
|
3343 + | }
|
3344 + | }
|
3345 + | /// A builder for [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
|
3346 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3347 + | pub struct Builder {
|
3348 + | pub(crate) a:
|
3349 + | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
3350 + | pub(crate) b: ::std::option::Option<
|
3351 + | ::std::vec::Vec<
|
3352 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3353 + | >,
|
3354 + | >,
|
3355 + | }
|
3356 + | impl Builder {
|
3357 + | #[allow(missing_docs)] // documentation missing in model
|
3358 + | pub fn a(
|
3359 + | mut self,
|
3360 + | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
3361 + | ) -> Self {
|
3362 + | self.a = input;
|
3363 + | self
|
3364 + | }
|
3365 + | #[allow(missing_docs)] // documentation missing in model
|
3366 + | pub fn b(
|
3367 + | mut self,
|
3368 + | input: ::std::option::Option<
|
3369 + | ::std::vec::Vec<
|
3370 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3371 + | >,
|
3372 + | >,
|
3373 + | ) -> Self {
|
3374 + | self.b = input;
|
3375 + | self
|
3376 + | }
|
3377 + | /// Consumes the builder and constructs a [`ConstrainedListWithIndirectlyConstrainedAggregateOperationInput`](crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput).
|
3378 + | pub fn build(
|
3379 + | self,
|
3380 + | ) -> crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
|
3381 + | self.build_enforcing_required_and_enum_traits()
|
3382 + | }
|
3383 + | fn build_enforcing_required_and_enum_traits(
|
3384 + | self,
|
3385 + | ) -> crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
|
3386 + | crate::input::ConstrainedListWithIndirectlyConstrainedAggregateOperationInput {
|
3387 + | a: self.a,
|
3388 + | b: self.b,
|
3389 + | }
|
3390 + | }
|
3391 + | }
|
3392 + | }
|
3142 3393 | /// See [`ConstrainedRecursiveShapesOperationInput`](crate::input::ConstrainedRecursiveShapesOperationInput).
|
3143 3394 | pub(crate) mod constrained_recursive_shapes_operation_input_internal {
|
3144 3395 |
|
3145 3396 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3146 3397 | /// Holds one variant for each of the ways the builder can fail.
|
3147 3398 | #[non_exhaustive]
|
3148 3399 | #[allow(clippy::enum_variant_names)]
|
3149 3400 | pub(crate) enum ConstraintViolation {
|
3150 3401 | /// Constraint violation occurred building member `nested` when building `ConstrainedRecursiveShapesOperationInput`.
|
3151 3402 | #[doc(hidden)]
|