Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_recursive_union_one.rs

@@ -1,1 +89,121 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:551 */
    2      3   
pub(crate) fn de_recursive_union_one<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::recursive_union_one_unconstrained::RecursiveUnionOneUnconstrained>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:565 */
   16     18   
    let mut variant = None;
          19  +
    /* JsonParserGenerator.kt:567 */
   17     20   
    match tokens.next().transpose()? {
          21  +
        /* JsonParserGenerator.kt:568 */
   18     22   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   19         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
          23  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          24  +
            /* JsonParserGenerator.kt:684 */
          25  +
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   20     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   21     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   22     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          31  +
                        /* JsonParserGenerator.kt:576 */
   23     32   
                        if let ::std::option::Option::Some(::std::result::Result::Ok(
   24     33   
                            ::aws_smithy_json::deserialize::Token::ValueNull { .. },
   25     34   
                        )) = tokens.peek()
   26     35   
                        {
   27     36   
                            let _ = tokens.next().expect("peek returned a token")?;
   28     37   
                            continue;
   29     38   
                        }
          39  +
                        /* JsonParserGenerator.kt:585 */
   30     40   
                        let key = key.to_unescaped()?;
   31     41   
                        if key == "__type" {
   32     42   
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   33     43   
                            continue;
   34     44   
                        }
   35     45   
                        if variant.is_some() {
   36     46   
                            return Err(
   37     47   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38     48   
                                    "encountered mixed variants in union",
   39     49   
                                ),
   40     50   
                            );
   41     51   
                        }
          52  +
                        /* JsonParserGenerator.kt:598 */
   42     53   
                        variant = match key.as_ref() {
          54  +
                            /* JsonParserGenerator.kt:601 */
   43     55   
                            "string" => {
          56  +
                                /* JsonParserGenerator.kt:611 */
   44     57   
                                Some(crate::unconstrained::recursive_union_one_unconstrained::RecursiveUnionOneUnconstrained::String(
   45         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
   46         -
                                        s.to_unescaped().map(|u|
   47         -
                                            u.into_owned()
   48         -
                                        )
   49         -
                                    ).transpose()?
   50         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'string' cannot be null"))?
   51         -
                                ))
          58  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          59  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          60  +
                                            /* JsonParserGenerator.kt:343 */u.into_owned()
          61  +
                                        /* JsonParserGenerator.kt:339 */)
          62  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          63  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'string' cannot be null"))?
          64  +
                                /* JsonParserGenerator.kt:611 */))
          65  +
                                /* JsonParserGenerator.kt:601 */
   52     66   
                            }
          67  +
                            /* JsonParserGenerator.kt:601 */
   53     68   
                            "union" => {
          69  +
                                /* JsonParserGenerator.kt:611 */
   54     70   
                                Some(crate::unconstrained::recursive_union_one_unconstrained::RecursiveUnionOneUnconstrained::Union(
   55         -
                                    crate::protocol_serde::shape_recursive_union_two::de_recursive_union_two(tokens)?
   56         -
                                    .map(Box::new)
   57         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'union' cannot be null"))?
   58         -
                                ))
          71  +
                                    /* JsonParserGenerator.kt:660 */crate::protocol_serde::shape_recursive_union_two::de_recursive_union_two(tokens)?
          72  +
                                    /* JsonParserGenerator.kt:314 */.map(Box::new)
          73  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'union' cannot be null"))?
          74  +
                                /* JsonParserGenerator.kt:611 */))
          75  +
                                /* JsonParserGenerator.kt:601 */
   59     76   
                            }
   60         -
                            variant => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("unexpected union variant: {}", variant)))
          77  +
                            /* JsonParserGenerator.kt:634 */
          78  +
                            variant => {
          79  +
                                return Err(
          80  +
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          81  +
                                        format!("unexpected union variant: {}", variant),
          82  +
                                    ),
          83  +
                                )
          84  +
                            } /* JsonParserGenerator.kt:598 */
   61     85   
                        };
          86  +
                        /* JsonParserGenerator.kt:686 */
   62     87   
                    }
          88  +
                    /* JsonParserGenerator.kt:695 */
   63     89   
                    other => {
   64     90   
                        return Err(
   65         -
                        ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   66         -
                            "expected object key or end object, found: {:?}",
   67         -
                            other
   68         -
                        )),
          91  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          92  +
                                format!("expected object key or end object, found: {:?}", other),
          93  +
                            ),
   69     94   
                        )
          95  +
                    } /* JsonParserGenerator.kt:685 */
   70     96   
                }
          97  +
                /* JsonParserGenerator.kt:684 */
   71     98   
            }
   72         -
        },
          99  +
            /* JsonParserGenerator.kt:568 */
         100  +
        }
         101  +
        /* JsonParserGenerator.kt:642 */
   73    102   
        _ => {
   74    103   
            return Err(
   75    104   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   76    105   
                    "expected start object or null",
   77    106   
                ),
   78    107   
            )
         108  +
        } /* JsonParserGenerator.kt:567 */
   79    109   
    }
   80         -
    }
         110  +
    /* JsonParserGenerator.kt:649 */
   81    111   
    if variant.is_none() {
   82    112   
        return Err(
   83    113   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   84    114   
                "Union did not contain a valid variant.",
   85    115   
            ),
   86    116   
        );
   87    117   
    }
         118  +
    /* JsonParserGenerator.kt:657 */
   88    119   
    Ok(variant)
         120  +
    /* JsonParserGenerator.kt:551 */
   89    121   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_recursive_union_two.rs

@@ -1,1 +88,120 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:551 */
    2      3   
pub(crate) fn de_recursive_union_two<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::recursive_union_two_unconstrained::RecursiveUnionTwoUnconstrained>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:565 */
   16     18   
    let mut variant = None;
          19  +
    /* JsonParserGenerator.kt:567 */
   17     20   
    match tokens.next().transpose()? {
          21  +
        /* JsonParserGenerator.kt:568 */
   18     22   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   19         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
          23  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          24  +
            /* JsonParserGenerator.kt:684 */
          25  +
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   20     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   21     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   22     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          31  +
                        /* JsonParserGenerator.kt:576 */
   23     32   
                        if let ::std::option::Option::Some(::std::result::Result::Ok(
   24     33   
                            ::aws_smithy_json::deserialize::Token::ValueNull { .. },
   25     34   
                        )) = tokens.peek()
   26     35   
                        {
   27     36   
                            let _ = tokens.next().expect("peek returned a token")?;
   28     37   
                            continue;
   29     38   
                        }
          39  +
                        /* JsonParserGenerator.kt:585 */
   30     40   
                        let key = key.to_unescaped()?;
   31     41   
                        if key == "__type" {
   32     42   
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   33     43   
                            continue;
   34     44   
                        }
   35     45   
                        if variant.is_some() {
   36     46   
                            return Err(
   37     47   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38     48   
                                    "encountered mixed variants in union",
   39     49   
                                ),
   40     50   
                            );
   41     51   
                        }
          52  +
                        /* JsonParserGenerator.kt:598 */
   42     53   
                        variant = match key.as_ref() {
          54  +
                            /* JsonParserGenerator.kt:601 */
   43     55   
                            "string" => {
          56  +
                                /* JsonParserGenerator.kt:611 */
   44     57   
                                Some(crate::unconstrained::recursive_union_two_unconstrained::RecursiveUnionTwoUnconstrained::String(
   45         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
   46         -
                                        s.to_unescaped().map(|u|
   47         -
                                            u.into_owned()
   48         -
                                        )
   49         -
                                    ).transpose()?
   50         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'string' cannot be null"))?
   51         -
                                ))
          58  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          59  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          60  +
                                            /* JsonParserGenerator.kt:343 */u.into_owned()
          61  +
                                        /* JsonParserGenerator.kt:339 */)
          62  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          63  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'string' cannot be null"))?
          64  +
                                /* JsonParserGenerator.kt:611 */))
          65  +
                                /* JsonParserGenerator.kt:601 */
   52     66   
                            }
          67  +
                            /* JsonParserGenerator.kt:601 */
   53     68   
                            "union" => {
          69  +
                                /* JsonParserGenerator.kt:611 */
   54     70   
                                Some(crate::unconstrained::recursive_union_two_unconstrained::RecursiveUnionTwoUnconstrained::Union(
   55         -
                                    crate::protocol_serde::shape_recursive_union_one::de_recursive_union_one(tokens)?
   56         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'union' cannot be null"))?
   57         -
                                ))
          71  +
                                    /* JsonParserGenerator.kt:660 */crate::protocol_serde::shape_recursive_union_one::de_recursive_union_one(tokens)?
          72  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'union' cannot be null"))?
          73  +
                                /* JsonParserGenerator.kt:611 */))
          74  +
                                /* JsonParserGenerator.kt:601 */
   58     75   
                            }
   59         -
                            variant => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("unexpected union variant: {}", variant)))
          76  +
                            /* JsonParserGenerator.kt:634 */
          77  +
                            variant => {
          78  +
                                return Err(
          79  +
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          80  +
                                        format!("unexpected union variant: {}", variant),
          81  +
                                    ),
          82  +
                                )
          83  +
                            } /* JsonParserGenerator.kt:598 */
   60     84   
                        };
          85  +
                        /* JsonParserGenerator.kt:686 */
   61     86   
                    }
          87  +
                    /* JsonParserGenerator.kt:695 */
   62     88   
                    other => {
   63     89   
                        return Err(
   64         -
                        ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   65         -
                            "expected object key or end object, found: {:?}",
   66         -
                            other
   67         -
                        )),
          90  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          91  +
                                format!("expected object key or end object, found: {:?}", other),
          92  +
                            ),
   68     93   
                        )
          94  +
                    } /* JsonParserGenerator.kt:685 */
   69     95   
                }
          96  +
                /* JsonParserGenerator.kt:684 */
   70     97   
            }
   71         -
        },
          98  +
            /* JsonParserGenerator.kt:568 */
          99  +
        }
         100  +
        /* JsonParserGenerator.kt:642 */
   72    101   
        _ => {
   73    102   
            return Err(
   74    103   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   75    104   
                    "expected start object or null",
   76    105   
                ),
   77    106   
            )
         107  +
        } /* JsonParserGenerator.kt:567 */
   78    108   
    }
   79         -
    }
         109  +
    /* JsonParserGenerator.kt:649 */
   80    110   
    if variant.is_none() {
   81    111   
        return Err(
   82    112   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   83    113   
                "Union did not contain a valid variant.",
   84    114   
            ),
   85    115   
        );
   86    116   
    }
         117  +
    /* JsonParserGenerator.kt:657 */
   87    118   
    Ok(variant)
         119  +
    /* JsonParserGenerator.kt:551 */
   88    120   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_sensitive_validation.rs

@@ -1,1 +150,216 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_sensitive_validation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::SensitiveValidationInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::sensitive_validation_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/json"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_sensitive_validation::de_sensitive_validation(
   29     39   
                bytes.as_ref(),
   30     40   
                input,
   31     41   
            )?;
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   32     43   
        }
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   33     45   
        input.build()?
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   34     47   
    })
          48  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   35     49   
}
   36     50   
          51  +
/* RustType.kt:516 */
   37     52   
#[allow(clippy::unnecessary_wraps)]
          53  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   38     54   
pub fn ser_sensitive_validation_http_response(
   39     55   
    #[allow(unused_variables)] output: crate::output::SensitiveValidationOutput,
   40     56   
) -> std::result::Result<
   41     57   
    ::aws_smithy_http_server::response::Response,
   42     58   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     59   
> {
          60  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   44     61   
    Ok({
          62  +
        /* RustType.kt:516 */
   45     63   
        #[allow(unused_mut)]
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   46     65   
        let mut builder = ::http::Response::builder();
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   47     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     68   
            builder,
   49     69   
            ::http::header::CONTENT_TYPE,
   50     70   
            "application/json",
   51     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   52     73   
        let http_status: u16 = 200;
   53     74   
        builder = builder.status(http_status);
   54         -
        let payload = "";
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          76  +
        let payload =
          77  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   55     80   
        let content_length = payload.len();
   56     81   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     82   
            builder,
   58     83   
            ::http::header::CONTENT_LENGTH,
   59     84   
            content_length,
   60     85   
        );
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   61     87   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   62     89   
        builder.body(body)?
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   63     91   
    })
          92  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   64     93   
}
   65     94   
          95  +
/* RustType.kt:516 */
   66     96   
#[allow(clippy::unnecessary_wraps)]
          97  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   67     98   
pub fn ser_sensitive_validation_http_error(
   68     99   
    error: &crate::error::SensitiveValidationError,
   69    100   
) -> std::result::Result<
   70    101   
    ::aws_smithy_http_server::response::Response,
   71    102   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   72    103   
> {
         104  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   73    105   
    Ok({
         106  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   74    107   
        match error {
         108  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   75    109   
            crate::error::SensitiveValidationError::ValidationException(output) => {
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   76    111   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         112  +
                /* RustType.kt:516 */
   77    113   
                #[allow(unused_mut)]
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   78    115   
                let mut builder = ::http::Response::builder();
         116  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   79    117   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   80    118   
                    builder,
   81    119   
                    ::http::header::CONTENT_TYPE,
   82    120   
                    "application/json",
   83    121   
                );
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   84    123   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85    124   
                    builder,
   86    125   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   87    126   
                    "ValidationException",
   88    127   
                );
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   89    129   
                let content_length = payload.len();
   90    130   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    131   
                    builder,
   92    132   
                    ::http::header::CONTENT_LENGTH,
   93    133   
                    content_length,
   94    134   
                );
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   95    136   
                builder
   96    137   
                    .status(400)
   97    138   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         140  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   98    141   
        }
   99         -
        }
         142  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  100    143   
    })
         144  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  101    145   
}
  102    146   
         147  +
/* JsonParserGenerator.kt:148 */
  103    148   
pub(crate) fn de_sensitive_validation(
  104    149   
    value: &[u8],
  105    150   
    mut builder: crate::input::sensitive_validation_input::Builder,
  106    151   
) -> ::std::result::Result<
  107    152   
    crate::input::sensitive_validation_input::Builder,
  108    153   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  109    154   
> {
         155  +
    /* JsonParserGenerator.kt:153 */
  110    156   
    let mut tokens_owned =
  111    157   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  112    158   
            .peekable();
  113    159   
    let tokens = &mut tokens_owned;
  114    160   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         161  +
    /* JsonParserGenerator.kt:684 */
  115    162   
    loop {
         163  +
        /* JsonParserGenerator.kt:685 */
  116    164   
        match tokens.next().transpose()? {
         165  +
            /* JsonParserGenerator.kt:686 */
  117    166   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  118    167   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         168  +
                /* JsonParserGenerator.kt:260 */
  119    169   
                match key.to_unescaped()?.as_ref() {
         170  +
                    /* JsonParserGenerator.kt:262 */
  120    171   
                    "string" => {
         172  +
                        /* JsonParserGenerator.kt:272 */
  121    173   
                        builder = builder.set_string(
         174  +
                            /* JsonParserGenerator.kt:354 */
  122    175   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  123    176   
                                tokens.next(),
  124    177   
                            )?
  125         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  126         -
                            .transpose()?,
         178  +
                            .map(|s|
         179  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         180  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         181  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         182  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  127    183   
                        );
         184  +
                        /* JsonParserGenerator.kt:262 */
  128    185   
                    }
  129         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         186  +
                    /* JsonParserGenerator.kt:290 */
         187  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  130    188   
                }
         189  +
                /* JsonParserGenerator.kt:686 */
  131    190   
            }
         191  +
            /* JsonParserGenerator.kt:695 */
  132    192   
            other => {
  133    193   
                return Err(
  134    194   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  135    195   
                        "expected object key or end object, found: {:?}",
  136    196   
                        other
  137    197   
                    )),
  138    198   
                )
         199  +
            } /* JsonParserGenerator.kt:685 */
  139    200   
        }
         201  +
        /* JsonParserGenerator.kt:684 */
  140    202   
    }
  141         -
    }
         203  +
    /* JsonParserGenerator.kt:250 */
  142    204   
    if tokens.next().is_some() {
         205  +
        /* JsonParserGenerator.kt:251 */
  143    206   
        return Err(
  144    207   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  145    208   
                "found more JSON tokens after completing parsing",
  146    209   
            ),
  147    210   
        );
         211  +
        /* JsonParserGenerator.kt:250 */
  148    212   
    }
         213  +
    /* JsonParserGenerator.kt:163 */
  149    214   
    Ok(builder)
         215  +
    /* JsonParserGenerator.kt:148 */
  150    216   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_short_set.rs

@@ -1,1 +54,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_short_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::short_set_unconstrained::ShortSetUnconstrained>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_number_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   30     40   
                                                .map(i16::try_from)
   31         -
                        .transpose()?;
          41  +
                                                .transpose()?
          42  +
                        /* JsonParserGenerator.kt:419 */;
          43  +
                        /* JsonParserGenerator.kt:422 */
   32     44   
                        if let Some(value) = value {
   33     45   
                            items.push(value);
   34         -
                        } else {
          46  +
                        }
          47  +
                        /* JsonParserGenerator.kt:430 */
          48  +
                        else {
   35     49   
                            return Err(
   36     50   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     51   
                                    "dense list cannot contain null values",
   38     52   
                                ),
   39     53   
                            );
   40     54   
                        }
          55  +
                        /* JsonParserGenerator.kt:413 */
          56  +
                    } /* JsonParserGenerator.kt:409 */
   41     57   
                }
          58  +
                /* JsonParserGenerator.kt:408 */
   42     59   
            }
   43         -
            }
          60  +
            /* JsonParserGenerator.kt:444 */
   44     61   
            Ok(Some(
   45     62   
                crate::unconstrained::short_set_unconstrained::ShortSetUnconstrained(items),
   46     63   
            ))
          64  +
            /* JsonParserGenerator.kt:713 */
   47     65   
        }
   48         -
        _ => Err(
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
   49     70   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50     71   
                    "expected start array or null",
   51     72   
                ),
   52         -
        ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   53     76   
    }
          77  +
    /* JsonParserGenerator.kt:398 */
   54     78   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_string_list.rs

@@ -1,1 +52,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_string_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::std::string::String>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   32     46   
                        if let Some(value) = value {
   33     47   
                            items.push(value);
   34         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   35     51   
                            return Err(
   36     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                    "dense list cannot contain null values",
   38     54   
                                ),
   39     55   
                            );
   40     56   
                        }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   41     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   42     61   
            }
   43         -
            }
          62  +
            /* JsonParserGenerator.kt:446 */
   44     63   
            Ok(Some(items))
          64  +
            /* JsonParserGenerator.kt:713 */
   45     65   
        }
   46         -
        _ => Err(
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
   47     70   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48     71   
                    "expected start array or null",
   49     72   
                ),
   50         -
        ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   51     76   
    }
          77  +
    /* JsonParserGenerator.kt:398 */
   52     78   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_string_set.rs

@@ -1,1 +54,80 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_string_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::string_set_unconstrained::StringSetUnconstrained>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   32     46   
                        if let Some(value) = value {
   33     47   
                            items.push(value);
   34         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   35     51   
                            return Err(
   36     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                    "dense list cannot contain null values",
   38     54   
                                ),
   39     55   
                            );
   40     56   
                        }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   41     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   42     61   
            }
   43         -
            }
          62  +
            /* JsonParserGenerator.kt:444 */
   44     63   
            Ok(Some(
   45     64   
                crate::unconstrained::string_set_unconstrained::StringSetUnconstrained(items),
   46     65   
            ))
          66  +
            /* JsonParserGenerator.kt:713 */
   47     67   
        }
   48         -
        _ => Err(
          68  +
        /* JsonParserGenerator.kt:722 */
          69  +
        _ => {
          70  +
            /* JsonParserGenerator.kt:723 */
          71  +
            Err(
   49     72   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50     73   
                    "expected start array or null",
   51     74   
                ),
   52         -
        ),
          75  +
            )
          76  +
            /* JsonParserGenerator.kt:722 */
          77  +
        } /* JsonParserGenerator.kt:712 */
   53     78   
    }
          79  +
    /* JsonParserGenerator.kt:398 */
   54     80   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_structure_set.rs

@@ -1,1 +53,76 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_structure_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::structure_set_unconstrained::StructureSetUnconstrained>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
          37  +
                        /* JsonParserGenerator.kt:419 */
   27     38   
                        let value =
   28         -
                            crate::protocol_serde::shape_greeting_struct::de_greeting_struct(
   29         -
                                tokens,
   30         -
                            )?;
          39  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_greeting_struct::de_greeting_struct(tokens)?
          40  +
                        /* JsonParserGenerator.kt:419 */;
          41  +
                        /* JsonParserGenerator.kt:422 */
   31     42   
                        if let Some(value) = value {
   32     43   
                            items.push(value);
   33         -
                        } else {
          44  +
                        }
          45  +
                        /* JsonParserGenerator.kt:430 */
          46  +
                        else {
   34     47   
                            return Err(
   35     48   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36     49   
                                    "dense list cannot contain null values",
   37     50   
                                ),
   38     51   
                            );
   39     52   
                        }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   40     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   41     57   
            }
   42         -
            }
          58  +
            /* JsonParserGenerator.kt:444 */
   43     59   
            Ok(Some(
   44     60   
                crate::unconstrained::structure_set_unconstrained::StructureSetUnconstrained(items),
   45     61   
            ))
          62  +
            /* JsonParserGenerator.kt:713 */
   46     63   
        }
   47         -
        _ => Err(
          64  +
        /* JsonParserGenerator.kt:722 */
          65  +
        _ => {
          66  +
            /* JsonParserGenerator.kt:723 */
          67  +
            Err(
   48     68   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   49     69   
                    "expected start array or null",
   50     70   
                ),
   51         -
        ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   52     74   
    }
          75  +
    /* JsonParserGenerator.kt:398 */
   53     76   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_structure_set_with_no_key.rs

@@ -1,1 +38,62 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_structure_set_with_no_key<'a, I>(tokens: &mut ::std::iter::Peekable<I>) -> ::std::result::Result<Option<crate::unconstrained::structure_set_with_no_key_unconstrained::StructureSetWithNoKeyUnconstrained>, ::aws_smithy_json::deserialize::error::DeserializeError>
    3      4   
where I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>{
           5  +
    /* JsonParserGenerator.kt:712 */
    4      6   
    match tokens.next().transpose()? {
           7  +
        /* JsonParserGenerator.kt:713 */
    5      8   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
    6      9   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          10  +
            /* JsonParserGenerator.kt:407 */
    7     11   
            let mut items = Vec::new();
          12  +
            /* JsonParserGenerator.kt:408 */
    8     13   
            loop {
          14  +
                /* JsonParserGenerator.kt:409 */
    9     15   
                match tokens.peek() {
          16  +
                    /* JsonParserGenerator.kt:410 */
   10     17   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          18  +
                        /* JsonParserGenerator.kt:411 */
   11     19   
                        tokens.next().transpose().unwrap();
   12     20   
                        break;
          21  +
                        /* JsonParserGenerator.kt:410 */
   13     22   
                    }
          23  +
                    /* JsonParserGenerator.kt:413 */
   14     24   
                    _ => {
          25  +
                        /* JsonParserGenerator.kt:419 */
   15     26   
                        let value =
   16         -
                            crate::protocol_serde::shape_missing_key_structure::de_missing_key_structure(tokens)?
   17         -
                        ;
          27  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_missing_key_structure::de_missing_key_structure(tokens)?
          28  +
                        /* JsonParserGenerator.kt:419 */;
          29  +
                        /* JsonParserGenerator.kt:422 */
   18     30   
                        if let Some(value) = value {
   19     31   
                            items.push(value);
   20         -
                        } else {
          32  +
                        }
          33  +
                        /* JsonParserGenerator.kt:430 */
          34  +
                        else {
   21     35   
                            return Err(
   22     36   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   23     37   
                                    "dense list cannot contain null values",
   24     38   
                                ),
   25     39   
                            );
   26     40   
                        }
          41  +
                        /* JsonParserGenerator.kt:413 */
          42  +
                    } /* JsonParserGenerator.kt:409 */
   27     43   
                }
          44  +
                /* JsonParserGenerator.kt:408 */
   28     45   
            }
   29         -
            }
          46  +
            /* JsonParserGenerator.kt:444 */
   30     47   
            Ok(Some(crate::unconstrained::structure_set_with_no_key_unconstrained::StructureSetWithNoKeyUnconstrained(items)))
          48  +
            /* JsonParserGenerator.kt:713 */
   31     49   
        }
   32         -
        _ => Err(
          50  +
        /* JsonParserGenerator.kt:722 */
          51  +
        _ => {
          52  +
            /* JsonParserGenerator.kt:723 */
          53  +
            Err(
   33     54   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   34     55   
                    "expected start array or null",
   35     56   
                ),
   36         -
        ),
          57  +
            )
          58  +
            /* JsonParserGenerator.kt:722 */
          59  +
        } /* JsonParserGenerator.kt:712 */
   37     60   
    }
          61  +
    /* JsonParserGenerator.kt:398 */
   38     62   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_timestamp_set.rs

@@ -1,1 +54,76 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_timestamp_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::timestamp_set_unconstrained::TimestampSetUnconstrained>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
          37  +
                        /* JsonParserGenerator.kt:419 */
   27     38   
                        let value =
   28         -
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   29         -
                                tokens.next(),
   30         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   31         -
                            )?;
          39  +
                            /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
          40  +
                        /* JsonParserGenerator.kt:419 */;
          41  +
                        /* JsonParserGenerator.kt:422 */
   32     42   
                        if let Some(value) = value {
   33     43   
                            items.push(value);
   34         -
                        } else {
          44  +
                        }
          45  +
                        /* JsonParserGenerator.kt:430 */
          46  +
                        else {
   35     47   
                            return Err(
   36     48   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     49   
                                    "dense list cannot contain null values",
   38     50   
                                ),
   39     51   
                            );
   40     52   
                        }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   41     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   42     57   
            }
   43         -
            }
          58  +
            /* JsonParserGenerator.kt:444 */
   44     59   
            Ok(Some(
   45     60   
                crate::unconstrained::timestamp_set_unconstrained::TimestampSetUnconstrained(items),
   46     61   
            ))
          62  +
            /* JsonParserGenerator.kt:713 */
   47     63   
        }
   48         -
        _ => Err(
          64  +
        /* JsonParserGenerator.kt:722 */
          65  +
        _ => {
          66  +
            /* JsonParserGenerator.kt:723 */
          67  +
            Err(
   49     68   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50     69   
                    "expected start array or null",
   51     70   
                ),
   52         -
        ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   53     74   
    }
          75  +
    /* JsonParserGenerator.kt:398 */
   54     76   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_union_set.rs

@@ -1,1 +50,76 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_union_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::union_set_unconstrained::UnionSetUnconstrained>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = crate::protocol_serde::shape_foo_union::de_foo_union(tokens)?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:660 */crate::protocol_serde::shape_foo_union::de_foo_union(tokens)?
          40  +
                        /* JsonParserGenerator.kt:419 */;
          41  +
                        /* JsonParserGenerator.kt:422 */
   28     42   
                        if let Some(value) = value {
   29     43   
                            items.push(value);
   30         -
                        } else {
          44  +
                        }
          45  +
                        /* JsonParserGenerator.kt:430 */
          46  +
                        else {
   31     47   
                            return Err(
   32     48   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   33     49   
                                    "dense list cannot contain null values",
   34     50   
                                ),
   35     51   
                            );
   36     52   
                        }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   37     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   38     57   
            }
   39         -
            }
          58  +
            /* JsonParserGenerator.kt:444 */
   40     59   
            Ok(Some(
   41     60   
                crate::unconstrained::union_set_unconstrained::UnionSetUnconstrained(items),
   42     61   
            ))
          62  +
            /* JsonParserGenerator.kt:713 */
   43     63   
        }
   44         -
        _ => Err(
          64  +
        /* JsonParserGenerator.kt:722 */
          65  +
        _ => {
          66  +
            /* JsonParserGenerator.kt:723 */
          67  +
            Err(
   45     68   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46     69   
                    "expected start array or null",
   47     70   
                ),
   48         -
        ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   49     74   
    }
          75  +
    /* JsonParserGenerator.kt:398 */
   50     76   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_validation_exception.rs

@@ -1,1 +35,58 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_validation_exception_error(
    3      4   
    value: &crate::error::ValidationException,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_validation_exception::ser_validation_exception(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_validation_exception(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::ValidationException,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.field_list {
          27  +
        /* JsonSerializerGenerator.kt:484 */
   20     28   
        let mut array_2 = object.key("fieldList").start_array();
          29  +
        /* JsonSerializerGenerator.kt:524 */
   21     30   
        for item_3 in var_1 {
          31  +
            /* SerializerUtil.kt:42 */
   22     32   
            {
          33  +
                /* JsonSerializerGenerator.kt:495 */
   23     34   
                #[allow(unused_mut)]
          35  +
                /* JsonSerializerGenerator.kt:496 */
   24     36   
                let mut object_4 = array_2.value().start_object();
          37  +
                /* JsonSerializerGenerator.kt:375 */
   25     38   
                crate::protocol_serde::shape_validation_exception_field::ser_validation_exception_field(&mut object_4, item_3)?;
          39  +
                /* JsonSerializerGenerator.kt:515 */
   26     40   
                object_4.finish();
          41  +
                /* SerializerUtil.kt:42 */
   27     42   
            }
          43  +
            /* JsonSerializerGenerator.kt:524 */
   28     44   
        }
          45  +
        /* JsonSerializerGenerator.kt:486 */
   29     46   
        array_2.finish();
          47  +
        /* JsonSerializerGenerator.kt:382 */
   30     48   
    }
          49  +
    /* SerializerUtil.kt:42 */
   31     50   
    {
          51  +
        /* JsonSerializerGenerator.kt:423 */
   32     52   
        object.key("message").string(input.message.as_str());
          53  +
        /* SerializerUtil.kt:42 */
   33     54   
    }
          55  +
    /* JsonSerializerGenerator.kt:372 */
   34     56   
    Ok(())
          57  +
    /* JsonSerializerGenerator.kt:358 */
   35     58   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_validation_exception_field.rs

@@ -1,1 +13,22 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_validation_exception_field(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::model::ValidationExceptionField,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* SerializerUtil.kt:42 */
    6      8   
    {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("path").string(input.path.as_str());
          11  +
        /* SerializerUtil.kt:42 */
    8     12   
    }
          13  +
    /* SerializerUtil.kt:42 */
    9     14   
    {
          15  +
        /* JsonSerializerGenerator.kt:423 */
   10     16   
        object.key("message").string(input.message.as_str());
          17  +
        /* SerializerUtil.kt:42 */
   11     18   
    }
          19  +
    /* JsonSerializerGenerator.kt:372 */
   12     20   
    Ok(())
          21  +
    /* JsonSerializerGenerator.kt:358 */
   13     22   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/service.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerServiceGenerator.kt:795 */
    2      3   
/// The service builder for [`RestJsonValidation`].
    3      4   
///
    4      5   
/// Constructed via [`RestJsonValidation::builder`].
    5      6   
pub struct RestJsonValidationBuilder<Body, L, HttpPl, ModelPl> {
    6      7   
    malformed_enum: Option<::aws_smithy_http_server::routing::Route<Body>>,
    7      8   
    malformed_length: Option<::aws_smithy_http_server::routing::Route<Body>>,
    8      9   
    malformed_length_override: Option<::aws_smithy_http_server::routing::Route<Body>>,
    9     10   
    malformed_length_query_string: Option<::aws_smithy_http_server::routing::Route<Body>>,
   10     11   
    malformed_pattern: Option<::aws_smithy_http_server::routing::Route<Body>>,
   11     12   
    malformed_pattern_override: Option<::aws_smithy_http_server::routing::Route<Body>>,
@@ -2692,2693 +2751,2753 @@
 2712   2713   
            "aws.protocoltests.restjson.validation",
 2713   2714   
            "RestJsonValidation",
 2714   2715   
        );
 2715   2716   
 2716   2717   
    const VERSION: Option<&'static str> = Some("2021-08-19");
 2717   2718   
 2718   2719   
    type Protocol = ::aws_smithy_http_server::protocol::rest_json_1::RestJson1;
 2719   2720   
 2720   2721   
    type Operations = Operation;
 2721   2722   
}
        2723  +
/* ServiceConfigGenerator.kt:178 */
 2722   2724   
/// Configuration for the [`RestJsonValidation`]. This is the central place where to register and
 2723   2725   
/// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
 2724   2726   
///
 2725   2727   
/// ```rust,no_run
 2726   2728   
/// # use rest_json_validation::RestJsonValidationConfig;
 2727   2729   
/// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
 2728   2730   
/// # use ::tower::layer::util::Identity;
 2729   2731   
/// # let authentication_plugin = IdentityPlugin;
 2730   2732   
/// # let authorization_plugin = IdentityPlugin;
 2731   2733   
/// # let server_request_id_provider_layer = Identity::new();
@@ -2813,2815 +2872,2875 @@
 2833   2835   
 2834   2836   
    /// Build the configuration.
 2835   2837   
    pub fn build(self) -> super::RestJsonValidationConfig<L, H, M> {
 2836   2838   
        super::RestJsonValidationConfig {
 2837   2839   
            layers: self.layers,
 2838   2840   
            http_plugins: self.http_plugins,
 2839   2841   
            model_plugins: self.model_plugins,
 2840   2842   
        }
 2841   2843   
    }
 2842   2844   
}
        2845  +
/* ScopeMacroGenerator.kt:81 */
 2843   2846   
/// A macro to help with scoping [plugins](crate::server::plugin) to a subset of all operations.
 2844   2847   
///
 2845   2848   
/// In contrast to [`crate::server::scope`](crate::server::scope), this macro has knowledge
 2846   2849   
/// of the service and any operations _not_ specified will be placed in the opposing group.
 2847   2850   
///
 2848   2851   
/// # Example
 2849   2852   
///
 2850   2853   
/// ```rust
 2851   2854   
/// scope! {
 2852   2855   
///     /// Includes [`MalformedEnum`], excluding all other operations.

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/types.rs

@@ -1,1 +0,7 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* SmithyTypesPubUseExtra.kt:66 */
    2      3   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
           4  +
/* ServerRequiredCustomizations.kt:69 */
    3      5   
pub use ::aws_smithy_types::error::display::DisplayErrorContext;
    4      6   
pub use ::aws_smithy_types::Blob;
    5         -
pub use ::aws_smithy_types::DateTime;
           7  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/unconstrained.rs

@@ -1,1 +924,1197 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/* UnconstrainedUnionGenerator.kt:121 */
    3      4   
impl crate::constrained::Constrained for crate::model::RecursiveUnionOne {
    4      5   
    type Unconstrained =
    5      6   
        crate::unconstrained::recursive_union_one_unconstrained::RecursiveUnionOneUnconstrained;
    6      7   
}
    7      8   
    8      9   
impl From<crate::unconstrained::recursive_union_one_unconstrained::RecursiveUnionOneUnconstrained>
    9     10   
    for crate::constrained::MaybeConstrained<crate::model::RecursiveUnionOne>
   10     11   
{
   11     12   
    fn from(
   12     13   
        value: crate::unconstrained::recursive_union_one_unconstrained::RecursiveUnionOneUnconstrained,
   13     14   
    ) -> Self {
   14     15   
        Self::Unconstrained(value)
   15     16   
    }
   16     17   
}
   17     18   
          19  +
/* UnconstrainedUnionGenerator.kt:121 */
   18     20   
impl crate::constrained::Constrained for crate::model::RecursiveUnionTwo {
   19     21   
    type Unconstrained =
   20     22   
        crate::unconstrained::recursive_union_two_unconstrained::RecursiveUnionTwoUnconstrained;
   21     23   
}
   22     24   
   23     25   
impl From<crate::unconstrained::recursive_union_two_unconstrained::RecursiveUnionTwoUnconstrained>
   24     26   
    for crate::constrained::MaybeConstrained<crate::model::RecursiveUnionTwo>
   25     27   
{
   26     28   
    fn from(
   27     29   
        value: crate::unconstrained::recursive_union_two_unconstrained::RecursiveUnionTwoUnconstrained,
   28     30   
    ) -> Self {
   29     31   
        Self::Unconstrained(value)
   30     32   
    }
   31     33   
}
   32     34   
          35  +
/* UnconstrainedUnionGenerator.kt:121 */
   33     36   
impl crate::constrained::Constrained for crate::model::PatternUnionOverride {
   34     37   
    type Unconstrained = crate::unconstrained::pattern_union_override_unconstrained::PatternUnionOverrideUnconstrained;
   35     38   
}
   36     39   
   37     40   
impl From<crate::unconstrained::pattern_union_override_unconstrained::PatternUnionOverrideUnconstrained> for crate::constrained::MaybeConstrained<crate::model::PatternUnionOverride> {
   38     41   
                fn from(value: crate::unconstrained::pattern_union_override_unconstrained::PatternUnionOverrideUnconstrained) -> Self {
   39     42   
                    Self::Unconstrained(value)
   40     43   
                }
   41     44   
            }
   42     45   
          46  +
/* UnconstrainedUnionGenerator.kt:121 */
   43     47   
impl crate::constrained::Constrained for crate::model::PatternUnion {
   44     48   
    type Unconstrained =
   45     49   
        crate::unconstrained::pattern_union_unconstrained::PatternUnionUnconstrained;
   46     50   
}
   47     51   
   48     52   
impl From<crate::unconstrained::pattern_union_unconstrained::PatternUnionUnconstrained>
   49     53   
    for crate::constrained::MaybeConstrained<crate::model::PatternUnion>
   50     54   
{
   51     55   
    fn from(
   52     56   
        value: crate::unconstrained::pattern_union_unconstrained::PatternUnionUnconstrained,
   53     57   
    ) -> Self {
   54     58   
        Self::Unconstrained(value)
   55     59   
    }
   56     60   
}
   57     61   
          62  +
/* UnconstrainedUnionGenerator.kt:121 */
   58     63   
impl crate::constrained::Constrained for crate::model::EnumUnion {
   59     64   
    type Unconstrained = crate::unconstrained::enum_union_unconstrained::EnumUnionUnconstrained;
   60     65   
}
   61     66   
   62     67   
impl From<crate::unconstrained::enum_union_unconstrained::EnumUnionUnconstrained>
   63     68   
    for crate::constrained::MaybeConstrained<crate::model::EnumUnion>
   64     69   
{
   65     70   
    fn from(value: crate::unconstrained::enum_union_unconstrained::EnumUnionUnconstrained) -> Self {
   66     71   
        Self::Unconstrained(value)
   67     72   
    }
   68     73   
}
   69     74   
   70     75   
pub(crate) mod recursive_union_one_unconstrained {
   71     76   
          77  +
    /* UnconstrainedUnionGenerator.kt:82 */
   72     78   
    #[allow(clippy::enum_variant_names)]
   73     79   
    #[derive(Debug, Clone)]
   74     80   
    pub(crate) enum RecursiveUnionOneUnconstrained {
   75         -
        String(::std::string::String),
   76         -
        Union(::std::boxed::Box<crate::unconstrained::recursive_union_two_unconstrained::RecursiveUnionTwoUnconstrained>),
   77         -
    }
          81  +
        /* UnconstrainedUnionGenerator.kt:95 */String(::std::string::String),
          82  +
        /* UnconstrainedUnionGenerator.kt:95 */Union(::std::boxed::Box<crate::unconstrained::recursive_union_two_unconstrained::RecursiveUnionTwoUnconstrained>),
          83  +
    /* UnconstrainedUnionGenerator.kt:82 */}
          84  +
    /* UnconstrainedUnionGenerator.kt:103 */
   78     85   
    impl ::std::convert::TryFrom<RecursiveUnionOneUnconstrained> for crate::model::RecursiveUnionOne {
   79     86   
        type Error = crate::model::recursive_union_one::ConstraintViolation;
   80     87   
   81     88   
        fn try_from(
   82     89   
            value: RecursiveUnionOneUnconstrained,
   83     90   
        ) -> ::std::result::Result<Self, Self::Error> {
   84     91   
            Ok(
   85     92   
        match value {
   86     93   
            crate::unconstrained::recursive_union_one_unconstrained::RecursiveUnionOneUnconstrained::String(unconstrained) => Self::String(
   87     94   
                unconstrained
   88     95   
                                        .try_into()
   89     96   
                                        
   90     97   
                                        
   91     98   
                                        .map_err(Self::Error::String)?
   92     99   
            ),
   93    100   
            crate::unconstrained::recursive_union_one_unconstrained::RecursiveUnionOneUnconstrained::Union(unconstrained) => Self::Union(
   94    101   
                (*unconstrained)
   95    102   
                                        .try_into()
   96    103   
                                        .map(Box::new)
   97    104   
                                        .map_err(Box::new)
   98    105   
                                        .map_err(Self::Error::Union)?
   99    106   
            ),
  100    107   
        }
  101    108   
    )
  102    109   
        }
  103    110   
    }
         111  +
         112  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  104    113   
}
  105    114   
pub(crate) mod recursive_union_two_unconstrained {
  106    115   
         116  +
    /* UnconstrainedUnionGenerator.kt:82 */
  107    117   
    #[allow(clippy::enum_variant_names)]
  108    118   
    #[derive(Debug, Clone)]
  109    119   
    pub(crate) enum RecursiveUnionTwoUnconstrained {
  110         -
        String(::std::string::String),
         120  +
        /* UnconstrainedUnionGenerator.kt:95 */ String(::std::string::String),
         121  +
        /* UnconstrainedUnionGenerator.kt:95 */
  111    122   
        Union(
  112    123   
            crate::unconstrained::recursive_union_one_unconstrained::RecursiveUnionOneUnconstrained,
  113    124   
        ),
         125  +
        /* UnconstrainedUnionGenerator.kt:82 */
  114    126   
    }
         127  +
    /* UnconstrainedUnionGenerator.kt:103 */
  115    128   
    impl ::std::convert::TryFrom<RecursiveUnionTwoUnconstrained> for crate::model::RecursiveUnionTwo {
  116    129   
        type Error = crate::model::recursive_union_two::ConstraintViolation;
  117    130   
  118    131   
        fn try_from(
  119    132   
            value: RecursiveUnionTwoUnconstrained,
  120    133   
        ) -> ::std::result::Result<Self, Self::Error> {
  121    134   
            Ok(
  122    135   
        match value {
  123    136   
            crate::unconstrained::recursive_union_two_unconstrained::RecursiveUnionTwoUnconstrained::String(unconstrained) => Self::String(
  124    137   
                unconstrained
  125    138   
                                        .try_into()
  126    139   
                                        
  127    140   
                                        
  128    141   
                                        .map_err(Self::Error::String)?
  129    142   
            ),
  130    143   
            crate::unconstrained::recursive_union_two_unconstrained::RecursiveUnionTwoUnconstrained::Union(unconstrained) => Self::Union(
  131    144   
                unconstrained
  132    145   
                                        .try_into()
  133    146   
                                        
  134    147   
                                        
  135    148   
                                        .map_err(Self::Error::Union)?
  136    149   
            ),
  137    150   
        }
  138    151   
    )
  139    152   
        }
  140    153   
    }
         154  +
         155  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  141    156   
}
  142    157   
pub(crate) mod union_set_unconstrained {
  143    158   
         159  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  144    160   
    #[derive(Debug, Clone)]
  145    161   
    pub(crate) struct UnionSetUnconstrained(pub(crate) std::vec::Vec<crate::model::FooUnion>);
  146    162   
  147    163   
    impl From<UnionSetUnconstrained> for crate::constrained::MaybeConstrained<crate::model::UnionSet> {
  148    164   
        fn from(value: UnionSetUnconstrained) -> Self {
  149    165   
            Self::Unconstrained(value)
  150    166   
        }
  151    167   
    }
         168  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  152    169   
    impl std::convert::TryFrom<UnionSetUnconstrained> for crate::model::UnionSet {
         170  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  153    171   
        type Error = crate::model::union_set::ConstraintViolation;
         172  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  154    173   
        fn try_from(value: UnionSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         174  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  155    175   
            let inner = value.0;
         176  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  156    177   
            Self::try_from(inner)
         178  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  157    179   
        }
         180  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  158    181   
    }
         182  +
         183  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  159    184   
}
  160    185   
pub(crate) mod structure_set_with_no_key_unconstrained {
  161    186   
         187  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  162    188   
    #[derive(Debug, Clone)]
  163    189   
    pub(crate) struct StructureSetWithNoKeyUnconstrained(
  164    190   
        pub(crate) std::vec::Vec<crate::model::missing_key_structure::Builder>,
  165    191   
    );
  166    192   
  167    193   
    impl From<StructureSetWithNoKeyUnconstrained>
  168    194   
        for crate::constrained::MaybeConstrained<crate::model::StructureSetWithNoKey>
  169    195   
    {
  170    196   
        fn from(value: StructureSetWithNoKeyUnconstrained) -> Self {
  171    197   
            Self::Unconstrained(value)
  172    198   
        }
  173    199   
    }
         200  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  174    201   
    impl std::convert::TryFrom<StructureSetWithNoKeyUnconstrained>
  175    202   
        for crate::model::StructureSetWithNoKey
  176    203   
    {
         204  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  177    205   
        type Error = crate::model::structure_set_with_no_key::ConstraintViolation;
         206  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  178    207   
        fn try_from(
  179    208   
            value: StructureSetWithNoKeyUnconstrained,
  180    209   
        ) -> std::result::Result<Self, Self::Error> {
         210  +
            /* UnconstrainedCollectionGenerator.kt:127 */
  181    211   
            let res: ::std::result::Result<
  182    212   
                ::std::vec::Vec<crate::model::MissingKeyStructure>,
  183    213   
                (
  184    214   
                    usize,
  185    215   
                    crate::model::missing_key_structure::ConstraintViolation,
  186    216   
                ),
  187    217   
            > = value
  188    218   
                .0
  189    219   
                .into_iter()
  190    220   
                .enumerate()
  191    221   
                .map(|(idx, inner)| {
  192    222   
                    inner
  193    223   
                        .try_into()
  194    224   
                        .map_err(|inner_violation| (idx, inner_violation))
  195    225   
                })
  196    226   
                .collect();
  197    227   
            let inner =
  198    228   
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
         229  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  199    230   
            Self::try_from(inner)
         231  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  200    232   
        }
         233  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  201    234   
    }
         235  +
         236  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  202    237   
}
  203    238   
pub(crate) mod structure_set_unconstrained {
  204    239   
         240  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  205    241   
    #[derive(Debug, Clone)]
  206    242   
    pub(crate) struct StructureSetUnconstrained(
  207    243   
        pub(crate) std::vec::Vec<crate::model::GreetingStruct>,
  208    244   
    );
  209    245   
  210    246   
    impl From<StructureSetUnconstrained>
  211    247   
        for crate::constrained::MaybeConstrained<crate::model::StructureSet>
  212    248   
    {
  213    249   
        fn from(value: StructureSetUnconstrained) -> Self {
  214    250   
            Self::Unconstrained(value)
  215    251   
        }
  216    252   
    }
         253  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  217    254   
    impl std::convert::TryFrom<StructureSetUnconstrained> for crate::model::StructureSet {
         255  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  218    256   
        type Error = crate::model::structure_set::ConstraintViolation;
         257  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  219    258   
        fn try_from(value: StructureSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         259  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  220    260   
            let inner = value.0;
         261  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  221    262   
            Self::try_from(inner)
         263  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  222    264   
        }
         265  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  223    266   
    }
         267  +
         268  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  224    269   
}
  225    270   
pub(crate) mod list_set_unconstrained {
  226    271   
         272  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  227    273   
    #[derive(Debug, Clone)]
  228    274   
    pub(crate) struct ListSetUnconstrained(
  229    275   
        pub(crate) std::vec::Vec<::std::vec::Vec<::std::string::String>>,
  230    276   
    );
  231    277   
  232    278   
    impl From<ListSetUnconstrained> for crate::constrained::MaybeConstrained<crate::model::ListSet> {
  233    279   
        fn from(value: ListSetUnconstrained) -> Self {
  234    280   
            Self::Unconstrained(value)
  235    281   
        }
  236    282   
    }
         283  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  237    284   
    impl std::convert::TryFrom<ListSetUnconstrained> for crate::model::ListSet {
         285  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  238    286   
        type Error = crate::model::list_set::ConstraintViolation;
         287  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  239    288   
        fn try_from(value: ListSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         289  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  240    290   
            let inner = value.0;
         291  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  241    292   
            Self::try_from(inner)
         293  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  242    294   
        }
         295  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  243    296   
    }
         297  +
         298  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  244    299   
}
  245    300   
pub(crate) mod integer_enum_set_unconstrained {
  246    301   
         302  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  247    303   
    #[derive(Debug, Clone)]
  248    304   
    pub(crate) struct IntegerEnumSetUnconstrained(pub(crate) std::vec::Vec<i32>);
  249    305   
  250    306   
    impl From<IntegerEnumSetUnconstrained>
  251    307   
        for crate::constrained::MaybeConstrained<crate::model::IntegerEnumSet>
  252    308   
    {
  253    309   
        fn from(value: IntegerEnumSetUnconstrained) -> Self {
  254    310   
            Self::Unconstrained(value)
  255    311   
        }
  256    312   
    }
         313  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  257    314   
    impl std::convert::TryFrom<IntegerEnumSetUnconstrained> for crate::model::IntegerEnumSet {
         315  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  258    316   
        type Error = crate::model::integer_enum_set::ConstraintViolation;
         317  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  259    318   
        fn try_from(value: IntegerEnumSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         319  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  260    320   
            let inner = value.0;
         321  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  261    322   
            Self::try_from(inner)
         323  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  262    324   
        }
         325  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  263    326   
    }
         327  +
         328  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  264    329   
}
  265    330   
pub(crate) mod foo_enum_set_unconstrained {
  266    331   
         332  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  267    333   
    #[derive(Debug, Clone)]
  268    334   
    pub(crate) struct FooEnumSetUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
  269    335   
  270    336   
    impl From<FooEnumSetUnconstrained>
  271    337   
        for crate::constrained::MaybeConstrained<crate::model::FooEnumSet>
  272    338   
    {
  273    339   
        fn from(value: FooEnumSetUnconstrained) -> Self {
  274    340   
            Self::Unconstrained(value)
  275    341   
        }
  276    342   
    }
         343  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  277    344   
    impl std::convert::TryFrom<FooEnumSetUnconstrained> for crate::model::FooEnumSet {
         345  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  278    346   
        type Error = crate::model::foo_enum_set::ConstraintViolation;
         347  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  279    348   
        fn try_from(value: FooEnumSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         349  +
            /* UnconstrainedCollectionGenerator.kt:127 */
  280    350   
            let res: ::std::result::Result<
  281    351   
                ::std::vec::Vec<crate::model::FooEnum>,
  282    352   
                (usize, crate::model::foo_enum::ConstraintViolation),
  283    353   
            > = value
  284    354   
                .0
  285    355   
                .into_iter()
  286    356   
                .enumerate()
  287    357   
                .map(|(idx, inner)| {
  288    358   
                    inner
  289    359   
                        .try_into()
  290    360   
                        .map_err(|inner_violation| (idx, inner_violation))
  291    361   
                })
  292    362   
                .collect();
  293    363   
            let inner =
  294    364   
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
         365  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  295    366   
            Self::try_from(inner)
         367  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  296    368   
        }
         369  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  297    370   
    }
         371  +
         372  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  298    373   
}
  299    374   
pub(crate) mod http_date_set_unconstrained {
  300    375   
         376  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  301    377   
    #[derive(Debug, Clone)]
  302    378   
    pub(crate) struct HttpDateSetUnconstrained(
  303    379   
        pub(crate) std::vec::Vec<::aws_smithy_types::DateTime>,
  304    380   
    );
  305    381   
  306    382   
    impl From<HttpDateSetUnconstrained>
  307    383   
        for crate::constrained::MaybeConstrained<crate::model::HttpDateSet>
  308    384   
    {
  309    385   
        fn from(value: HttpDateSetUnconstrained) -> Self {
  310    386   
            Self::Unconstrained(value)
  311    387   
        }
  312    388   
    }
         389  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  313    390   
    impl std::convert::TryFrom<HttpDateSetUnconstrained> for crate::model::HttpDateSet {
         391  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  314    392   
        type Error = crate::model::http_date_set::ConstraintViolation;
         393  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  315    394   
        fn try_from(value: HttpDateSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         395  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  316    396   
            let inner = value.0;
         397  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  317    398   
            Self::try_from(inner)
         399  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  318    400   
        }
         401  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  319    402   
    }
         403  +
         404  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  320    405   
}
  321    406   
pub(crate) mod date_time_set_unconstrained {
  322    407   
         408  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  323    409   
    #[derive(Debug, Clone)]
  324    410   
    pub(crate) struct DateTimeSetUnconstrained(
  325    411   
        pub(crate) std::vec::Vec<::aws_smithy_types::DateTime>,
  326    412   
    );
  327    413   
  328    414   
    impl From<DateTimeSetUnconstrained>
  329    415   
        for crate::constrained::MaybeConstrained<crate::model::DateTimeSet>
  330    416   
    {
  331    417   
        fn from(value: DateTimeSetUnconstrained) -> Self {
  332    418   
            Self::Unconstrained(value)
  333    419   
        }
  334    420   
    }
         421  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  335    422   
    impl std::convert::TryFrom<DateTimeSetUnconstrained> for crate::model::DateTimeSet {
         423  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  336    424   
        type Error = crate::model::date_time_set::ConstraintViolation;
         425  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  337    426   
        fn try_from(value: DateTimeSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         427  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  338    428   
            let inner = value.0;
         429  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  339    430   
            Self::try_from(inner)
         431  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  340    432   
        }
         433  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  341    434   
    }
         435  +
         436  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  342    437   
}
  343    438   
pub(crate) mod timestamp_set_unconstrained {
  344    439   
         440  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  345    441   
    #[derive(Debug, Clone)]
  346    442   
    pub(crate) struct TimestampSetUnconstrained(
  347    443   
        pub(crate) std::vec::Vec<::aws_smithy_types::DateTime>,
  348    444   
    );
  349    445   
  350    446   
    impl From<TimestampSetUnconstrained>
  351    447   
        for crate::constrained::MaybeConstrained<crate::model::TimestampSet>
  352    448   
    {
  353    449   
        fn from(value: TimestampSetUnconstrained) -> Self {
  354    450   
            Self::Unconstrained(value)
  355    451   
        }
  356    452   
    }
         453  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  357    454   
    impl std::convert::TryFrom<TimestampSetUnconstrained> for crate::model::TimestampSet {
         455  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  358    456   
        type Error = crate::model::timestamp_set::ConstraintViolation;
         457  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  359    458   
        fn try_from(value: TimestampSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         459  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  360    460   
            let inner = value.0;
         461  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  361    462   
            Self::try_from(inner)
         463  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  362    464   
        }
         465  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  363    466   
    }
         467  +
         468  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  364    469   
}
  365    470   
pub(crate) mod long_set_unconstrained {
  366    471   
         472  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  367    473   
    #[derive(Debug, Clone)]
  368    474   
    pub(crate) struct LongSetUnconstrained(pub(crate) std::vec::Vec<i64>);
  369    475   
  370    476   
    impl From<LongSetUnconstrained> for crate::constrained::MaybeConstrained<crate::model::LongSet> {
  371    477   
        fn from(value: LongSetUnconstrained) -> Self {
  372    478   
            Self::Unconstrained(value)
  373    479   
        }
  374    480   
    }
         481  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  375    482   
    impl std::convert::TryFrom<LongSetUnconstrained> for crate::model::LongSet {
         483  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  376    484   
        type Error = crate::model::long_set::ConstraintViolation;
         485  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  377    486   
        fn try_from(value: LongSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         487  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  378    488   
            let inner = value.0;
         489  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  379    490   
            Self::try_from(inner)
         491  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  380    492   
        }
         493  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  381    494   
    }
         495  +
         496  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  382    497   
}
  383    498   
pub(crate) mod integer_set_unconstrained {
  384    499   
         500  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  385    501   
    #[derive(Debug, Clone)]
  386    502   
    pub(crate) struct IntegerSetUnconstrained(pub(crate) std::vec::Vec<i32>);
  387    503   
  388    504   
    impl From<IntegerSetUnconstrained>
  389    505   
        for crate::constrained::MaybeConstrained<crate::model::IntegerSet>
  390    506   
    {
  391    507   
        fn from(value: IntegerSetUnconstrained) -> Self {
  392    508   
            Self::Unconstrained(value)
  393    509   
        }
  394    510   
    }
         511  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  395    512   
    impl std::convert::TryFrom<IntegerSetUnconstrained> for crate::model::IntegerSet {
         513  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  396    514   
        type Error = crate::model::integer_set::ConstraintViolation;
         515  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  397    516   
        fn try_from(value: IntegerSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         517  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  398    518   
            let inner = value.0;
         519  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  399    520   
            Self::try_from(inner)
         521  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  400    522   
        }
         523  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  401    524   
    }
         525  +
         526  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  402    527   
}
  403    528   
pub(crate) mod short_set_unconstrained {
  404    529   
         530  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  405    531   
    #[derive(Debug, Clone)]
  406    532   
    pub(crate) struct ShortSetUnconstrained(pub(crate) std::vec::Vec<i16>);
  407    533   
  408    534   
    impl From<ShortSetUnconstrained> for crate::constrained::MaybeConstrained<crate::model::ShortSet> {
  409    535   
        fn from(value: ShortSetUnconstrained) -> Self {
  410    536   
            Self::Unconstrained(value)
  411    537   
        }
  412    538   
    }
         539  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  413    540   
    impl std::convert::TryFrom<ShortSetUnconstrained> for crate::model::ShortSet {
         541  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  414    542   
        type Error = crate::model::short_set::ConstraintViolation;
         543  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  415    544   
        fn try_from(value: ShortSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         545  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  416    546   
            let inner = value.0;
         547  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  417    548   
            Self::try_from(inner)
         549  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  418    550   
        }
         551  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  419    552   
    }
         553  +
         554  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  420    555   
}
  421    556   
pub(crate) mod byte_set_unconstrained {
  422    557   
         558  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  423    559   
    #[derive(Debug, Clone)]
  424    560   
    pub(crate) struct ByteSetUnconstrained(pub(crate) std::vec::Vec<i8>);
  425    561   
  426    562   
    impl From<ByteSetUnconstrained> for crate::constrained::MaybeConstrained<crate::model::ByteSet> {
  427    563   
        fn from(value: ByteSetUnconstrained) -> Self {
  428    564   
            Self::Unconstrained(value)
  429    565   
        }
  430    566   
    }
         567  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  431    568   
    impl std::convert::TryFrom<ByteSetUnconstrained> for crate::model::ByteSet {
         569  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  432    570   
        type Error = crate::model::byte_set::ConstraintViolation;
         571  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  433    572   
        fn try_from(value: ByteSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         573  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  434    574   
            let inner = value.0;
         575  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  435    576   
            Self::try_from(inner)
         577  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  436    578   
        }
         579  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  437    580   
    }
         581  +
         582  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  438    583   
}
  439    584   
pub(crate) mod string_set_unconstrained {
  440    585   
         586  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  441    587   
    #[derive(Debug, Clone)]
  442    588   
    pub(crate) struct StringSetUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
  443    589   
  444    590   
    impl From<StringSetUnconstrained>
  445    591   
        for crate::constrained::MaybeConstrained<crate::model::StringSet>
  446    592   
    {
  447    593   
        fn from(value: StringSetUnconstrained) -> Self {
  448    594   
            Self::Unconstrained(value)
  449    595   
        }
  450    596   
    }
         597  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  451    598   
    impl std::convert::TryFrom<StringSetUnconstrained> for crate::model::StringSet {
         599  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  452    600   
        type Error = crate::model::string_set::ConstraintViolation;
         601  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  453    602   
        fn try_from(value: StringSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         603  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  454    604   
            let inner = value.0;
         605  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  455    606   
            Self::try_from(inner)
         607  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  456    608   
        }
         609  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  457    610   
    }
         611  +
         612  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  458    613   
}
  459    614   
pub(crate) mod boolean_set_unconstrained {
  460    615   
         616  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  461    617   
    #[derive(Debug, Clone)]
  462    618   
    pub(crate) struct BooleanSetUnconstrained(pub(crate) std::vec::Vec<bool>);
  463    619   
  464    620   
    impl From<BooleanSetUnconstrained>
  465    621   
        for crate::constrained::MaybeConstrained<crate::model::BooleanSet>
  466    622   
    {
  467    623   
        fn from(value: BooleanSetUnconstrained) -> Self {
  468    624   
            Self::Unconstrained(value)
  469    625   
        }
  470    626   
    }
         627  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  471    628   
    impl std::convert::TryFrom<BooleanSetUnconstrained> for crate::model::BooleanSet {
         629  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  472    630   
        type Error = crate::model::boolean_set::ConstraintViolation;
         631  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  473    632   
        fn try_from(value: BooleanSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         633  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  474    634   
            let inner = value.0;
         635  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  475    636   
            Self::try_from(inner)
         637  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  476    638   
        }
         639  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  477    640   
    }
         641  +
         642  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  478    643   
}
  479    644   
pub(crate) mod blob_set_unconstrained {
  480    645   
         646  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  481    647   
    #[derive(Debug, Clone)]
  482    648   
    pub(crate) struct BlobSetUnconstrained(pub(crate) std::vec::Vec<::aws_smithy_types::Blob>);
  483    649   
  484    650   
    impl From<BlobSetUnconstrained> for crate::constrained::MaybeConstrained<crate::model::BlobSet> {
  485    651   
        fn from(value: BlobSetUnconstrained) -> Self {
  486    652   
            Self::Unconstrained(value)
  487    653   
        }
  488    654   
    }
         655  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  489    656   
    impl std::convert::TryFrom<BlobSetUnconstrained> for crate::model::BlobSet {
         657  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  490    658   
        type Error = crate::model::blob_set::ConstraintViolation;
         659  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  491    660   
        fn try_from(value: BlobSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         661  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  492    662   
            let inner = value.0;
         663  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  493    664   
            Self::try_from(inner)
         665  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  494    666   
        }
         667  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  495    668   
    }
         669  +
         670  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  496    671   
}
  497    672   
pub(crate) mod pattern_union_override_unconstrained {
  498    673   
         674  +
    /* UnconstrainedUnionGenerator.kt:82 */
  499    675   
    #[allow(clippy::enum_variant_names)]
  500    676   
    #[derive(Debug, Clone)]
  501    677   
    pub(crate) enum PatternUnionOverrideUnconstrained {
  502         -
        First(::std::string::String),
         678  +
        /* UnconstrainedUnionGenerator.kt:95 */ First(::std::string::String),
         679  +
        /* UnconstrainedUnionGenerator.kt:95 */
  503    680   
        Second(::std::string::String),
         681  +
        /* UnconstrainedUnionGenerator.kt:82 */
  504    682   
    }
         683  +
    /* UnconstrainedUnionGenerator.kt:103 */
  505    684   
    impl ::std::convert::TryFrom<PatternUnionOverrideUnconstrained>
  506    685   
        for crate::model::PatternUnionOverride
  507    686   
    {
  508    687   
        type Error = crate::model::pattern_union_override::ConstraintViolation;
  509    688   
  510    689   
        fn try_from(
  511    690   
            value: PatternUnionOverrideUnconstrained,
  512    691   
        ) -> ::std::result::Result<Self, Self::Error> {
  513    692   
            Ok(
  514    693   
        match value {
  515    694   
            crate::unconstrained::pattern_union_override_unconstrained::PatternUnionOverrideUnconstrained::First(unconstrained) => Self::First(
  516    695   
                unconstrained
  517    696   
                                        .try_into()
  518    697   
                                        
  519    698   
                                        
  520    699   
                                        .map_err(Self::Error::First)?
  521    700   
            ),
  522    701   
            crate::unconstrained::pattern_union_override_unconstrained::PatternUnionOverrideUnconstrained::Second(unconstrained) => Self::Second(
  523    702   
                unconstrained
  524    703   
                                        .try_into()
  525    704   
                                        
  526    705   
                                        
  527    706   
                                        .map_err(Self::Error::Second)?
  528    707   
            ),
  529    708   
        }
  530    709   
    )
  531    710   
        }
  532    711   
    }
         712  +
         713  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  533    714   
}
  534    715   
pub(crate) mod pattern_map_override_unconstrained {
  535    716   
         717  +
    /* UnconstrainedMapGenerator.kt:79 */
  536    718   
    #[derive(Debug, Clone)]
  537    719   
    pub(crate) struct PatternMapOverrideUnconstrained(
  538    720   
        pub(crate) std::collections::HashMap<::std::string::String, ::std::string::String>,
  539    721   
    );
  540    722   
  541    723   
    impl From<PatternMapOverrideUnconstrained>
  542    724   
        for crate::constrained::MaybeConstrained<
  543    725   
            crate::constrained::pattern_map_override_constrained::PatternMapOverrideConstrained,
  544    726   
        >
  545    727   
    {
  546    728   
        fn from(value: PatternMapOverrideUnconstrained) -> Self {
  547    729   
            Self::Unconstrained(value)
  548    730   
        }
  549    731   
    }
         732  +
    /* UnconstrainedMapGenerator.kt:101 */
  550    733   
    impl std::convert::TryFrom<PatternMapOverrideUnconstrained>
  551    734   
        for crate::constrained::pattern_map_override_constrained::PatternMapOverrideConstrained
  552    735   
    {
         736  +
        /* UnconstrainedMapGenerator.kt:102 */
  553    737   
        type Error = crate::model::pattern_map_override::ConstraintViolation;
         738  +
        /* UnconstrainedMapGenerator.kt:104 */
  554    739   
        fn try_from(
  555    740   
            value: PatternMapOverrideUnconstrained,
  556    741   
        ) -> std::result::Result<Self, Self::Error> {
         742  +
            /* UnconstrainedMapGenerator.kt:186 */
  557    743   
            let res: ::std::result::Result<
  558    744   
                ::std::collections::HashMap<
  559    745   
                    crate::model::pattern_map_override::Key,
  560    746   
                    crate::model::pattern_map_override::Value,
  561    747   
                >,
  562    748   
                Self::Error,
  563    749   
            > = value
  564    750   
                .0
  565    751   
                .into_iter()
  566    752   
                .map(|(k, v)| {
  567    753   
                    let k: crate::model::pattern_map_override::Key =
  568    754   
                        k.try_into().map_err(Self::Error::Key)?;
  569    755   
  570    756   
                    match crate::model::pattern_map_override::Value::try_from(v) {
  571    757   
                        Ok(v) => Ok((k, v)),
  572    758   
                        Err(inner_constraint_violation) => {
  573    759   
                            Err(Self::Error::Value(k, inner_constraint_violation))
  574    760   
                        }
  575    761   
                    }
  576    762   
                })
  577    763   
                .collect();
  578    764   
            let hm = res?;
         765  +
            /* UnconstrainedMapGenerator.kt:247 */
  579    766   
            Ok(Self(hm))
         767  +
            /* UnconstrainedMapGenerator.kt:104 */
  580    768   
        }
         769  +
        /* UnconstrainedMapGenerator.kt:101 */
  581    770   
    }
         771  +
         772  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  582    773   
}
  583    774   
pub(crate) mod pattern_list_override_unconstrained {
  584    775   
         776  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  585    777   
    #[derive(Debug, Clone)]
  586    778   
    pub(crate) struct PatternListOverrideUnconstrained(
  587    779   
        pub(crate) std::vec::Vec<::std::string::String>,
  588    780   
    );
  589    781   
  590    782   
    impl From<PatternListOverrideUnconstrained>
  591    783   
        for crate::constrained::MaybeConstrained<
  592    784   
            crate::constrained::pattern_list_override_constrained::PatternListOverrideConstrained,
  593    785   
        >
  594    786   
    {
  595    787   
        fn from(value: PatternListOverrideUnconstrained) -> Self {
  596    788   
            Self::Unconstrained(value)
  597    789   
        }
  598    790   
    }
         791  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  599    792   
    impl std::convert::TryFrom<PatternListOverrideUnconstrained>
  600    793   
        for crate::constrained::pattern_list_override_constrained::PatternListOverrideConstrained
  601    794   
    {
         795  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  602    796   
        type Error = crate::model::pattern_list_override::ConstraintViolation;
         797  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  603    798   
        fn try_from(
  604    799   
            value: PatternListOverrideUnconstrained,
  605    800   
        ) -> std::result::Result<Self, Self::Error> {
         801  +
            /* UnconstrainedCollectionGenerator.kt:127 */
  606    802   
            let res: ::std::result::Result<
  607    803   
                ::std::vec::Vec<crate::model::pattern_list_override::Member>,
  608    804   
                (
  609    805   
                    usize,
  610    806   
                    crate::model::pattern_list_override::member::ConstraintViolation,
  611    807   
                ),
  612    808   
            > = value
  613    809   
                .0
  614    810   
                .into_iter()
  615    811   
                .enumerate()
  616    812   
                .map(|(idx, inner)| {
  617    813   
                    inner
  618    814   
                        .try_into()
  619    815   
                        .map_err(|inner_violation| (idx, inner_violation))
  620    816   
                })
  621    817   
                .collect();
  622    818   
            let inner =
  623    819   
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
         820  +
            /* UnconstrainedCollectionGenerator.kt:191 */
  624    821   
            Ok(Self(inner))
         822  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  625    823   
        }
         824  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  626    825   
    }
         826  +
         827  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  627    828   
}
  628    829   
pub(crate) mod pattern_union_unconstrained {
  629    830   
         831  +
    /* UnconstrainedUnionGenerator.kt:82 */
  630    832   
    #[allow(clippy::enum_variant_names)]
  631    833   
    #[derive(Debug, Clone)]
  632    834   
    pub(crate) enum PatternUnionUnconstrained {
  633         -
        First(::std::string::String),
         835  +
        /* UnconstrainedUnionGenerator.kt:95 */ First(::std::string::String),
         836  +
        /* UnconstrainedUnionGenerator.kt:95 */
  634    837   
        Second(::std::string::String),
         838  +
        /* UnconstrainedUnionGenerator.kt:82 */
  635    839   
    }
         840  +
    /* UnconstrainedUnionGenerator.kt:103 */
  636    841   
    impl ::std::convert::TryFrom<PatternUnionUnconstrained> for crate::model::PatternUnion {
  637    842   
        type Error = crate::model::pattern_union::ConstraintViolation;
  638    843   
  639    844   
        fn try_from(value: PatternUnionUnconstrained) -> ::std::result::Result<Self, Self::Error> {
  640    845   
            Ok(
  641    846   
        match value {
  642    847   
            crate::unconstrained::pattern_union_unconstrained::PatternUnionUnconstrained::First(unconstrained) => Self::First(
  643    848   
                unconstrained
  644    849   
                                        .try_into()
  645    850   
                                        
  646    851   
                                        
  647    852   
                                        .map_err(Self::Error::First)?
  648    853   
            ),
  649    854   
            crate::unconstrained::pattern_union_unconstrained::PatternUnionUnconstrained::Second(unconstrained) => Self::Second(
  650    855   
                unconstrained
  651    856   
                                        .try_into()
  652    857   
                                        
  653    858   
                                        
  654    859   
                                        .map_err(Self::Error::Second)?
  655    860   
            ),
  656    861   
        }
  657    862   
    )
  658    863   
        }
  659    864   
    }
         865  +
         866  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  660    867   
}
  661    868   
pub(crate) mod pattern_map_unconstrained {
  662    869   
         870  +
    /* UnconstrainedMapGenerator.kt:79 */
  663    871   
    #[derive(Debug, Clone)]
  664    872   
    pub(crate) struct PatternMapUnconstrained(
  665    873   
        pub(crate) std::collections::HashMap<::std::string::String, ::std::string::String>,
  666    874   
    );
  667    875   
  668    876   
    impl From<PatternMapUnconstrained>
  669    877   
        for crate::constrained::MaybeConstrained<
  670    878   
            crate::constrained::pattern_map_constrained::PatternMapConstrained,
  671    879   
        >
  672    880   
    {
  673    881   
        fn from(value: PatternMapUnconstrained) -> Self {
  674    882   
            Self::Unconstrained(value)
  675    883   
        }
  676    884   
    }
         885  +
    /* UnconstrainedMapGenerator.kt:101 */
  677    886   
    impl std::convert::TryFrom<PatternMapUnconstrained>
  678    887   
        for crate::constrained::pattern_map_constrained::PatternMapConstrained
  679    888   
    {
         889  +
        /* UnconstrainedMapGenerator.kt:102 */
  680    890   
        type Error = crate::model::pattern_map::ConstraintViolation;
         891  +
        /* UnconstrainedMapGenerator.kt:104 */
  681    892   
        fn try_from(value: PatternMapUnconstrained) -> std::result::Result<Self, Self::Error> {
         893  +
            /* UnconstrainedMapGenerator.kt:186 */
  682    894   
            let res: ::std::result::Result<
  683    895   
                ::std::collections::HashMap<
  684    896   
                    crate::model::PatternString,
  685    897   
                    crate::model::PatternString,
  686    898   
                >,
  687    899   
                Self::Error,
  688    900   
            > = value
  689    901   
                .0
  690    902   
                .into_iter()
  691    903   
                .map(|(k, v)| {
  692    904   
                    let k: crate::model::PatternString = k.try_into().map_err(Self::Error::Key)?;
  693    905   
  694    906   
                    match crate::model::PatternString::try_from(v) {
  695    907   
                        Ok(v) => Ok((k, v)),
  696    908   
                        Err(inner_constraint_violation) => {
  697    909   
                            Err(Self::Error::Value(k, inner_constraint_violation))
  698    910   
                        }
  699    911   
                    }
  700    912   
                })
  701    913   
                .collect();
  702    914   
            let hm = res?;
         915  +
            /* UnconstrainedMapGenerator.kt:247 */
  703    916   
            Ok(Self(hm))
         917  +
            /* UnconstrainedMapGenerator.kt:104 */
  704    918   
        }
         919  +
        /* UnconstrainedMapGenerator.kt:101 */
  705    920   
    }
         921  +
         922  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  706    923   
}
  707    924   
pub(crate) mod pattern_list_unconstrained {
  708    925   
         926  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  709    927   
    #[derive(Debug, Clone)]
  710    928   
    pub(crate) struct PatternListUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
  711    929   
  712    930   
    impl From<PatternListUnconstrained>
  713    931   
        for crate::constrained::MaybeConstrained<
  714    932   
            crate::constrained::pattern_list_constrained::PatternListConstrained,
  715    933   
        >
  716    934   
    {
  717    935   
        fn from(value: PatternListUnconstrained) -> Self {
  718    936   
            Self::Unconstrained(value)
  719    937   
        }
  720    938   
    }
         939  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  721    940   
    impl std::convert::TryFrom<PatternListUnconstrained>
  722    941   
        for crate::constrained::pattern_list_constrained::PatternListConstrained
  723    942   
    {
         943  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  724    944   
        type Error = crate::model::pattern_list::ConstraintViolation;
         945  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  725    946   
        fn try_from(value: PatternListUnconstrained) -> std::result::Result<Self, Self::Error> {
         947  +
            /* UnconstrainedCollectionGenerator.kt:127 */
  726    948   
            let res: ::std::result::Result<
  727    949   
                ::std::vec::Vec<crate::model::PatternString>,
  728    950   
                (usize, crate::model::pattern_string::ConstraintViolation),
  729    951   
            > = value
  730    952   
                .0
  731    953   
                .into_iter()
  732    954   
                .enumerate()
  733    955   
                .map(|(idx, inner)| {
  734    956   
                    inner
  735    957   
                        .try_into()
  736    958   
                        .map_err(|inner_violation| (idx, inner_violation))
  737    959   
                })
  738    960   
                .collect();
  739    961   
            let inner =
  740    962   
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
         963  +
            /* UnconstrainedCollectionGenerator.kt:191 */
  741    964   
            Ok(Self(inner))
         965  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  742    966   
        }
         967  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  743    968   
    }
         969  +
         970  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  744    971   
}
  745    972   
pub(crate) mod length_list_unconstrained {
  746    973   
         974  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  747    975   
    #[derive(Debug, Clone)]
  748    976   
    pub(crate) struct LengthListUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
  749    977   
  750    978   
    impl From<LengthListUnconstrained>
  751    979   
        for crate::constrained::MaybeConstrained<crate::model::LengthList>
  752    980   
    {
  753    981   
        fn from(value: LengthListUnconstrained) -> Self {
  754    982   
            Self::Unconstrained(value)
  755    983   
        }
  756    984   
    }
         985  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  757    986   
    impl std::convert::TryFrom<LengthListUnconstrained> for crate::model::LengthList {
         987  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  758    988   
        type Error = crate::model::length_list::ConstraintViolation;
         989  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  759    990   
        fn try_from(value: LengthListUnconstrained) -> std::result::Result<Self, Self::Error> {
         991  +
            /* UnconstrainedCollectionGenerator.kt:127 */
  760    992   
            let res: ::std::result::Result<
  761    993   
                ::std::vec::Vec<crate::model::LengthString>,
  762    994   
                (usize, crate::model::length_string::ConstraintViolation),
  763    995   
            > = value
  764    996   
                .0
  765    997   
                .into_iter()
  766    998   
                .enumerate()
  767    999   
                .map(|(idx, inner)| {
  768   1000   
                    inner
  769   1001   
                        .try_into()
  770   1002   
                        .map_err(|inner_violation| (idx, inner_violation))
  771   1003   
                })
  772   1004   
                .collect();
  773   1005   
            let inner =
  774   1006   
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
        1007  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  775   1008   
            Self::try_from(inner)
        1009  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  776   1010   
        }
        1011  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  777   1012   
    }
        1013  +
        1014  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  778   1015   
}
  779   1016   
pub(crate) mod length_map_unconstrained {
  780   1017   
        1018  +
    /* UnconstrainedMapGenerator.kt:79 */
  781   1019   
    #[derive(Debug, Clone)]
  782   1020   
    pub(crate) struct LengthMapUnconstrained(
  783   1021   
        pub(crate)  std::collections::HashMap<
  784   1022   
            ::std::string::String,
  785   1023   
            crate::unconstrained::length_list_unconstrained::LengthListUnconstrained,
  786   1024   
        >,
  787   1025   
    );
  788   1026   
  789   1027   
    impl From<LengthMapUnconstrained>
  790   1028   
        for crate::constrained::MaybeConstrained<crate::model::LengthMap>
  791   1029   
    {
  792   1030   
        fn from(value: LengthMapUnconstrained) -> Self {
  793   1031   
            Self::Unconstrained(value)
  794   1032   
        }
  795   1033   
    }
        1034  +
    /* UnconstrainedMapGenerator.kt:101 */
  796   1035   
    impl std::convert::TryFrom<LengthMapUnconstrained> for crate::model::LengthMap {
        1036  +
        /* UnconstrainedMapGenerator.kt:102 */
  797   1037   
        type Error = crate::model::length_map::ConstraintViolation;
        1038  +
        /* UnconstrainedMapGenerator.kt:104 */
  798   1039   
        fn try_from(value: LengthMapUnconstrained) -> std::result::Result<Self, Self::Error> {
        1040  +
            /* UnconstrainedMapGenerator.kt:186 */
  799   1041   
            let res: ::std::result::Result<
  800   1042   
                ::std::collections::HashMap<crate::model::LengthString, crate::model::LengthList>,
  801   1043   
                Self::Error,
  802   1044   
            > = value
  803   1045   
                .0
  804   1046   
                .into_iter()
  805   1047   
                .map(|(k, v)| {
  806   1048   
                    let k: crate::model::LengthString = k.try_into().map_err(Self::Error::Key)?;
  807   1049   
  808   1050   
                    match crate::model::LengthList::try_from(v) {
  809   1051   
                        Ok(v) => Ok((k, v)),
  810   1052   
                        Err(inner_constraint_violation) => {
  811   1053   
                            Err(Self::Error::Value(k, inner_constraint_violation))
  812   1054   
                        }
  813   1055   
                    }
  814   1056   
                })
  815   1057   
                .collect();
  816   1058   
            let hm = res?;
        1059  +
            /* UnconstrainedMapGenerator.kt:245 */
  817   1060   
            Self::try_from(hm)
        1061  +
            /* UnconstrainedMapGenerator.kt:104 */
  818   1062   
        }
        1063  +
        /* UnconstrainedMapGenerator.kt:101 */
  819   1064   
    }
        1065  +
        1066  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  820   1067   
}
  821   1068   
pub(crate) mod enum_union_unconstrained {
  822   1069   
        1070  +
    /* UnconstrainedUnionGenerator.kt:82 */
  823   1071   
    #[allow(clippy::enum_variant_names)]
  824   1072   
    #[derive(Debug, Clone)]
  825   1073   
    pub(crate) enum EnumUnionUnconstrained {
  826         -
        First(::std::string::String),
        1074  +
        /* UnconstrainedUnionGenerator.kt:95 */ First(::std::string::String),
        1075  +
        /* UnconstrainedUnionGenerator.kt:95 */
  827   1076   
        Second(::std::string::String),
        1077  +
        /* UnconstrainedUnionGenerator.kt:82 */
  828   1078   
    }
        1079  +
    /* UnconstrainedUnionGenerator.kt:103 */
  829   1080   
    impl ::std::convert::TryFrom<EnumUnionUnconstrained> for crate::model::EnumUnion {
  830   1081   
        type Error = crate::model::enum_union::ConstraintViolation;
  831   1082   
  832   1083   
        fn try_from(value: EnumUnionUnconstrained) -> ::std::result::Result<Self, Self::Error> {
  833   1084   
            Ok(match value {
  834   1085   
                crate::unconstrained::enum_union_unconstrained::EnumUnionUnconstrained::First(
  835   1086   
                    unconstrained,
  836   1087   
                ) => Self::First(unconstrained.try_into().map_err(Self::Error::First)?),
  837   1088   
                crate::unconstrained::enum_union_unconstrained::EnumUnionUnconstrained::Second(
  838   1089   
                    unconstrained,
  839   1090   
                ) => Self::Second(unconstrained.try_into().map_err(Self::Error::Second)?),
  840   1091   
            })
  841   1092   
        }
  842   1093   
    }
        1094  +
        1095  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  843   1096   
}
  844   1097   
pub(crate) mod enum_map_unconstrained {
  845   1098   
        1099  +
    /* UnconstrainedMapGenerator.kt:79 */
  846   1100   
    #[derive(Debug, Clone)]
  847   1101   
    pub(crate) struct EnumMapUnconstrained(
  848   1102   
        pub(crate) std::collections::HashMap<::std::string::String, ::std::string::String>,
  849   1103   
    );
  850   1104   
  851   1105   
    impl From<EnumMapUnconstrained>
  852   1106   
        for crate::constrained::MaybeConstrained<
  853   1107   
            crate::constrained::enum_map_constrained::EnumMapConstrained,
  854   1108   
        >
  855   1109   
    {
  856   1110   
        fn from(value: EnumMapUnconstrained) -> Self {
  857   1111   
            Self::Unconstrained(value)
  858   1112   
        }
  859   1113   
    }
        1114  +
    /* UnconstrainedMapGenerator.kt:101 */
  860   1115   
    impl std::convert::TryFrom<EnumMapUnconstrained>
  861   1116   
        for crate::constrained::enum_map_constrained::EnumMapConstrained
  862   1117   
    {
        1118  +
        /* UnconstrainedMapGenerator.kt:102 */
  863   1119   
        type Error = crate::model::enum_map::ConstraintViolation;
        1120  +
        /* UnconstrainedMapGenerator.kt:104 */
  864   1121   
        fn try_from(value: EnumMapUnconstrained) -> std::result::Result<Self, Self::Error> {
        1122  +
            /* UnconstrainedMapGenerator.kt:186 */
  865   1123   
            let res: ::std::result::Result<
  866   1124   
                ::std::collections::HashMap<crate::model::EnumString, crate::model::EnumString>,
  867   1125   
                Self::Error,
  868   1126   
            > = value
  869   1127   
                .0
  870   1128   
                .into_iter()
  871   1129   
                .map(|(k, v)| {
  872   1130   
                    let k: crate::model::EnumString = k.try_into().map_err(Self::Error::Key)?;
  873   1131   
  874   1132   
                    match crate::model::EnumString::try_from(v) {
  875   1133   
                        Ok(v) => Ok((k, v)),
  876   1134   
                        Err(inner_constraint_violation) => {
  877   1135   
                            Err(Self::Error::Value(k, inner_constraint_violation))
  878   1136   
                        }
  879   1137   
                    }
  880   1138   
                })
  881   1139   
                .collect();
  882   1140   
            let hm = res?;
        1141  +
            /* UnconstrainedMapGenerator.kt:247 */
  883   1142   
            Ok(Self(hm))
        1143  +
            /* UnconstrainedMapGenerator.kt:104 */
  884   1144   
        }
        1145  +
        /* UnconstrainedMapGenerator.kt:101 */
  885   1146   
    }
        1147  +
        1148  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  886   1149   
}
  887   1150   
pub(crate) mod enum_list_unconstrained {
  888   1151   
        1152  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  889   1153   
    #[derive(Debug, Clone)]
  890   1154   
    pub(crate) struct EnumListUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
  891   1155   
  892   1156   
    impl From<EnumListUnconstrained>
  893   1157   
        for crate::constrained::MaybeConstrained<
  894   1158   
            crate::constrained::enum_list_constrained::EnumListConstrained,
  895   1159   
        >
  896   1160   
    {
  897   1161   
        fn from(value: EnumListUnconstrained) -> Self {
  898   1162   
            Self::Unconstrained(value)
  899   1163   
        }
  900   1164   
    }
        1165  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  901   1166   
    impl std::convert::TryFrom<EnumListUnconstrained>
  902   1167   
        for crate::constrained::enum_list_constrained::EnumListConstrained
  903   1168   
    {
        1169  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  904   1170   
        type Error = crate::model::enum_list::ConstraintViolation;
        1171  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  905   1172   
        fn try_from(value: EnumListUnconstrained) -> std::result::Result<Self, Self::Error> {
        1173  +
            /* UnconstrainedCollectionGenerator.kt:127 */
  906   1174   
            let res: ::std::result::Result<
  907   1175   
                ::std::vec::Vec<crate::model::EnumString>,
  908   1176   
                (usize, crate::model::enum_string::ConstraintViolation),
  909   1177   
            > = value
  910   1178   
                .0
  911   1179   
                .into_iter()
  912   1180   
                .enumerate()
  913   1181   
                .map(|(idx, inner)| {
  914   1182   
                    inner
  915   1183   
                        .try_into()
  916   1184   
                        .map_err(|inner_violation| (idx, inner_violation))
  917   1185   
                })
  918   1186   
                .collect();
  919   1187   
            let inner =
  920   1188   
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
        1189  +
            /* UnconstrainedCollectionGenerator.kt:191 */
  921   1190   
            Ok(Self(inner))
        1191  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  922   1192   
        }
        1193  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  923   1194   
    }
        1195  +
        1196  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  924   1197   
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor/rust-server-codegen/src/constrained.rs

@@ -1,1 +113,125 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3      3   
pub(crate) mod sparse_set_map_constrained {
    4      4   
           5  +
    /* PubCrateConstrainedMapGenerator.kt:80 */
    5      6   
    #[derive(Debug, Clone)]
    6      7   
    pub(crate) struct SparseSetMapConstrained(
    7      8   
        pub(crate)  std::collections::HashMap<
    8      9   
            ::std::string::String,
    9     10   
            ::std::option::Option<crate::model::StringSet>,
   10     11   
        >,
   11     12   
    );
   12     13   
   13     14   
    impl crate::constrained::Constrained for SparseSetMapConstrained {
   14     15   
        type Unconstrained =
   15     16   
            crate::unconstrained::sparse_set_map_unconstrained::SparseSetMapUnconstrained;
   16     17   
    }
          18  +
    /* PubCrateConstrainedMapGenerator.kt:99 */
   17     19   
    impl
   18     20   
        ::std::convert::From<
   19     21   
            ::std::collections::HashMap<
   20     22   
                ::std::string::String,
   21     23   
                ::std::option::Option<crate::model::StringSet>,
   22     24   
            >,
   23     25   
        > for SparseSetMapConstrained
   24     26   
    {
   25     27   
        fn from(
   26     28   
            v: ::std::collections::HashMap<
   27     29   
                ::std::string::String,
   28     30   
                ::std::option::Option<crate::model::StringSet>,
   29     31   
            >,
   30     32   
        ) -> Self {
   31     33   
            Self(v)
   32     34   
        }
   33     35   
    }
   34     36   
   35     37   
    impl ::std::convert::From<SparseSetMapConstrained>
   36     38   
        for ::std::collections::HashMap<
   37     39   
            ::std::string::String,
   38     40   
            ::std::option::Option<crate::model::StringSet>,
   39     41   
        >
   40     42   
    {
   41     43   
        fn from(v: SparseSetMapConstrained) -> Self {
   42     44   
            v.0
   43     45   
        }
   44     46   
    }
          47  +
          48  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   45     49   
}
   46     50   
pub(crate) mod dense_set_map_constrained {
   47     51   
          52  +
    /* PubCrateConstrainedMapGenerator.kt:80 */
   48     53   
    #[derive(Debug, Clone)]
   49     54   
    pub(crate) struct DenseSetMapConstrained(
   50     55   
        pub(crate) std::collections::HashMap<::std::string::String, crate::model::StringSet>,
   51     56   
    );
   52     57   
   53     58   
    impl crate::constrained::Constrained for DenseSetMapConstrained {
   54     59   
        type Unconstrained =
   55     60   
            crate::unconstrained::dense_set_map_unconstrained::DenseSetMapUnconstrained;
   56     61   
    }
          62  +
    /* PubCrateConstrainedMapGenerator.kt:99 */
   57     63   
    impl
   58     64   
        ::std::convert::From<
   59     65   
            ::std::collections::HashMap<::std::string::String, crate::model::StringSet>,
   60     66   
        > for DenseSetMapConstrained
   61     67   
    {
   62     68   
        fn from(
   63     69   
            v: ::std::collections::HashMap<::std::string::String, crate::model::StringSet>,
   64     70   
        ) -> Self {
   65     71   
            Self(v)
   66     72   
        }
   67     73   
    }
   68     74   
   69     75   
    impl ::std::convert::From<DenseSetMapConstrained>
   70     76   
        for ::std::collections::HashMap<::std::string::String, crate::model::StringSet>
   71     77   
    {
   72     78   
        fn from(v: DenseSetMapConstrained) -> Self {
   73     79   
            v.0
   74     80   
        }
   75     81   
    }
          82  +
          83  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   76     84   
}
   77     85   
pub(crate) mod foo_enum_list_constrained {
   78     86   
          87  +
    /* PubCrateConstrainedCollectionGenerator.kt:79 */
   79     88   
    #[derive(Debug, Clone)]
   80     89   
    pub(crate) struct FooEnumListConstrained(pub(crate) std::vec::Vec<crate::model::FooEnum>);
   81     90   
   82     91   
    impl crate::constrained::Constrained for FooEnumListConstrained {
   83     92   
        type Unconstrained =
   84     93   
            crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained;
   85     94   
    }
          95  +
    /* PubCrateConstrainedCollectionGenerator.kt:108 */
   86     96   
    impl ::std::convert::From<::std::vec::Vec<crate::model::FooEnum>> for FooEnumListConstrained {
   87     97   
        fn from(v: ::std::vec::Vec<crate::model::FooEnum>) -> Self {
   88     98   
            Self(v)
   89     99   
        }
   90    100   
    }
   91    101   
   92    102   
    impl ::std::convert::From<FooEnumListConstrained> for ::std::vec::Vec<crate::model::FooEnum> {
   93    103   
        fn from(v: FooEnumListConstrained) -> Self {
   94    104   
            v.0
   95    105   
        }
   96    106   
    }
         107  +
         108  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   97    109   
}
   98    110   
   99    111   
/*
  100    112   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
  101    113   
 * SPDX-License-Identifier: Apache-2.0
  102    114   
 */
  103    115   
  104    116   
pub(crate) trait Constrained {
  105    117   
    type Unconstrained;
  106    118   
}