Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_list_a.rs

@@ -1,1 +59,85 @@
    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_list_a<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<
    6      7   
        ::std::vec::Vec<
    7      8   
            ::std::vec::Vec<
    8      9   
                ::std::vec::Vec<
    9     10   
                    ::std::collections::HashMap<
   10     11   
                        ::std::string::String,
   11     12   
                        crate::model::EmptyStructure,
   12     13   
                    >,
   13     14   
                >,
   14     15   
            >,
   15     16   
        >,
   16     17   
    >,
   17     18   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   18     19   
>
   19     20   
where
   20     21   
    I: Iterator<
   21     22   
        Item = Result<
   22     23   
            ::aws_smithy_json::deserialize::Token<'a>,
   23     24   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   24     25   
        >,
   25     26   
    >,
   26     27   
{
          28  +
    /* JsonParserGenerator.kt:712 */
   27     29   
    match tokens.next().transpose()? {
          30  +
        /* JsonParserGenerator.kt:713 */
   28     31   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   29     32   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          33  +
            /* JsonParserGenerator.kt:407 */
   30     34   
            let mut items = Vec::new();
          35  +
            /* JsonParserGenerator.kt:408 */
   31     36   
            loop {
          37  +
                /* JsonParserGenerator.kt:409 */
   32     38   
                match tokens.peek() {
          39  +
                    /* JsonParserGenerator.kt:410 */
   33     40   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          41  +
                        /* JsonParserGenerator.kt:411 */
   34     42   
                        tokens.next().transpose().unwrap();
   35     43   
                        break;
          44  +
                        /* JsonParserGenerator.kt:410 */
   36     45   
                    }
          46  +
                    /* JsonParserGenerator.kt:413 */
   37     47   
                    _ => {
   38         -
                        let value = crate::protocol_serde::shape_list_b::de_list_b(tokens)?;
          48  +
                        /* JsonParserGenerator.kt:419 */
          49  +
                        let value =
          50  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_b::de_list_b(tokens)?
          51  +
                        /* JsonParserGenerator.kt:419 */;
          52  +
                        /* JsonParserGenerator.kt:422 */
   39     53   
                        if let Some(value) = value {
   40     54   
                            items.push(value);
   41         -
                        } else {
          55  +
                        }
          56  +
                        /* JsonParserGenerator.kt:430 */
          57  +
                        else {
   42     58   
                            return Err(
   43     59   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44     60   
                                    "dense list cannot contain null values",
   45     61   
                                ),
   46     62   
                            );
   47     63   
                        }
   48         -
                    }
          64  +
                        /* JsonParserGenerator.kt:413 */
          65  +
                    } /* JsonParserGenerator.kt:409 */
   49     66   
                }
          67  +
                /* JsonParserGenerator.kt:408 */
   50     68   
            }
          69  +
            /* JsonParserGenerator.kt:446 */
   51     70   
            Ok(Some(items))
          71  +
            /* JsonParserGenerator.kt:713 */
   52     72   
        }
   53         -
        _ => Err(
   54         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   55         -
                "expected start array or null",
   56         -
            ),
   57         -
        ),
          73  +
        /* JsonParserGenerator.kt:722 */
          74  +
        _ => {
          75  +
            /* JsonParserGenerator.kt:723 */
          76  +
            Err(
          77  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          78  +
                    "expected start array or null",
          79  +
                ),
          80  +
            )
          81  +
            /* JsonParserGenerator.kt:722 */
          82  +
        } /* JsonParserGenerator.kt:712 */
   58     83   
    }
          84  +
    /* JsonParserGenerator.kt:398 */
   59     85   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_list_b.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_list_b<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<
    6      7   
        ::std::vec::Vec<
    7      8   
            ::std::vec::Vec<
    8      9   
                ::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>,
    9     10   
            >,
   10     11   
        >,
   11     12   
    >,
   12     13   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
>
   14     15   
where
   15     16   
    I: Iterator<
   16     17   
        Item = Result<
   17     18   
            ::aws_smithy_json::deserialize::Token<'a>,
   18     19   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   19     20   
        >,
   20     21   
    >,
   21     22   
{
          23  +
    /* JsonParserGenerator.kt:712 */
   22     24   
    match tokens.next().transpose()? {
          25  +
        /* JsonParserGenerator.kt:713 */
   23     26   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   24     27   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          28  +
            /* JsonParserGenerator.kt:407 */
   25     29   
            let mut items = Vec::new();
          30  +
            /* JsonParserGenerator.kt:408 */
   26     31   
            loop {
          32  +
                /* JsonParserGenerator.kt:409 */
   27     33   
                match tokens.peek() {
          34  +
                    /* JsonParserGenerator.kt:410 */
   28     35   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          36  +
                        /* JsonParserGenerator.kt:411 */
   29     37   
                        tokens.next().transpose().unwrap();
   30     38   
                        break;
          39  +
                        /* JsonParserGenerator.kt:410 */
   31     40   
                    }
          41  +
                    /* JsonParserGenerator.kt:413 */
   32     42   
                    _ => {
   33         -
                        let value = crate::protocol_serde::shape_list_c::de_list_c(tokens)?;
          43  +
                        /* JsonParserGenerator.kt:419 */
          44  +
                        let value =
          45  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_c::de_list_c(tokens)?
          46  +
                        /* JsonParserGenerator.kt:419 */;
          47  +
                        /* JsonParserGenerator.kt:422 */
   34     48   
                        if let Some(value) = value {
   35     49   
                            items.push(value);
   36         -
                        } else {
          50  +
                        }
          51  +
                        /* JsonParserGenerator.kt:430 */
          52  +
                        else {
   37     53   
                            return Err(
   38     54   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   39     55   
                                    "dense list cannot contain null values",
   40     56   
                                ),
   41     57   
                            );
   42     58   
                        }
   43         -
                    }
          59  +
                        /* JsonParserGenerator.kt:413 */
          60  +
                    } /* JsonParserGenerator.kt:409 */
   44     61   
                }
          62  +
                /* JsonParserGenerator.kt:408 */
   45     63   
            }
          64  +
            /* JsonParserGenerator.kt:446 */
   46     65   
            Ok(Some(items))
          66  +
            /* JsonParserGenerator.kt:713 */
   47     67   
        }
   48         -
        _ => Err(
   49         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50         -
                "expected start array or null",
   51         -
            ),
   52         -
        ),
          68  +
        /* JsonParserGenerator.kt:722 */
          69  +
        _ => {
          70  +
            /* JsonParserGenerator.kt:723 */
          71  +
            Err(
          72  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          73  +
                    "expected start array or null",
          74  +
                ),
          75  +
            )
          76  +
            /* JsonParserGenerator.kt:722 */
          77  +
        } /* JsonParserGenerator.kt:712 */
   53     78   
    }
          79  +
    /* JsonParserGenerator.kt:398 */
   54     80   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_list_c.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_list_c<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<
    6      7   
        ::std::vec::Vec<
    7      8   
            ::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>,
    8      9   
        >,
    9     10   
    >,
   10     11   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   11     12   
>
   12     13   
where
   13     14   
    I: Iterator<
   14     15   
        Item = Result<
   15     16   
            ::aws_smithy_json::deserialize::Token<'a>,
   16     17   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   17     18   
        >,
   18     19   
    >,
   19     20   
{
          21  +
    /* JsonParserGenerator.kt:712 */
   20     22   
    match tokens.next().transpose()? {
          23  +
        /* JsonParserGenerator.kt:713 */
   21     24   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   22     25   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          26  +
            /* JsonParserGenerator.kt:407 */
   23     27   
            let mut items = Vec::new();
          28  +
            /* JsonParserGenerator.kt:408 */
   24     29   
            loop {
          30  +
                /* JsonParserGenerator.kt:409 */
   25     31   
                match tokens.peek() {
          32  +
                    /* JsonParserGenerator.kt:410 */
   26     33   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          34  +
                        /* JsonParserGenerator.kt:411 */
   27     35   
                        tokens.next().transpose().unwrap();
   28     36   
                        break;
          37  +
                        /* JsonParserGenerator.kt:410 */
   29     38   
                    }
          39  +
                    /* JsonParserGenerator.kt:413 */
   30     40   
                    _ => {
   31         -
                        let value = crate::protocol_serde::shape_map_a::de_map_a(tokens)?;
          41  +
                        /* JsonParserGenerator.kt:419 */
          42  +
                        let value =
          43  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_a::de_map_a(tokens)?
          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   
                        }
   41         -
                    }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   42     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   43     61   
            }
          62  +
            /* JsonParserGenerator.kt:446 */
   44     63   
            Ok(Some(items))
          64  +
            /* JsonParserGenerator.kt:713 */
   45     65   
        }
   46         -
        _ => Err(
   47         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48         -
                "expected start array or null",
   49         -
            ),
   50         -
        ),
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
          70  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          71  +
                    "expected start array or null",
          72  +
                ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   51     76   
    }
          77  +
    /* JsonParserGenerator.kt:398 */
   52     78   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_map_a.rs

@@ -1,1 +59,83 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_map_a<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>>,
    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::StartObject { .. }) => {
          22  +
            /* JsonParserGenerator.kt:469 */
   19     23   
            let mut map = ::std::collections::HashMap::new();
          24  +
            /* JsonParserGenerator.kt:684 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   21     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   22     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   24         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
          31  +
                        /* JsonParserGenerator.kt:471 */
          32  +
                        let key =
          33  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          34  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                            /* JsonParserGenerator.kt:339 */)
          36  +
                        /* JsonParserGenerator.kt:471 */?;
          37  +
                        /* JsonParserGenerator.kt:474 */
   25     38   
                        let value =
   26         -
                            crate::protocol_serde::shape_empty_structure::de_empty_structure(
   27         -
                                tokens,
   28         -
                            )?;
          39  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_empty_structure::de_empty_structure(tokens)?
          40  +
                        /* JsonParserGenerator.kt:474 */;
          41  +
                        /* JsonParserGenerator.kt:481 */
   29     42   
                        match value {
   30     43   
                            Some(value) => {
   31     44   
                                map.insert(key, value);
   32     45   
                            }
   33     46   
                            None => {
   34     47   
                                return Err(
   35     48   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36     49   
                                        "dense map cannot contain null values",
   37     50   
                                    ),
   38     51   
                                )
   39     52   
                            }
   40     53   
                        }
          54  +
                        /* JsonParserGenerator.kt:686 */
   41     55   
                    }
          56  +
                    /* JsonParserGenerator.kt:695 */
   42     57   
                    other => {
   43     58   
                        return Err(
   44     59   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45     60   
                                format!("expected object key or end object, found: {:?}", other),
   46     61   
                            ),
   47     62   
                        )
   48         -
                    }
          63  +
                    } /* JsonParserGenerator.kt:685 */
   49     64   
                }
          65  +
                /* JsonParserGenerator.kt:684 */
   50     66   
            }
          67  +
            /* JsonParserGenerator.kt:504 */
   51     68   
            Ok(Some(map))
          69  +
            /* JsonParserGenerator.kt:713 */
   52     70   
        }
   53         -
        _ => Err(
   54         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   55         -
                "expected start object or null",
   56         -
            ),
   57         -
        ),
          71  +
        /* JsonParserGenerator.kt:722 */
          72  +
        _ => {
          73  +
            /* JsonParserGenerator.kt:723 */
          74  +
            Err(
          75  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          76  +
                    "expected start object or null",
          77  +
                ),
          78  +
            )
          79  +
            /* JsonParserGenerator.kt:722 */
          80  +
        } /* JsonParserGenerator.kt:712 */
   58     81   
    }
          82  +
    /* JsonParserGenerator.kt:460 */
   59     83   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_required_header_collection_operation.rs

@@ -1,1 +140,196 @@
    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_required_header_collection_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::RequiredHeaderCollectionOperationInput,
    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 =
   18     23   
            crate::input::required_header_collection_operation_input::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   23     31   
        if let Some(value) = crate::protocol_serde::shape_required_header_collection_operation_input::de_required_header_list_header(&headers)? {
   24     32   
                                input = input.set_required_header_list(value)
   25     33   
                            }
          34  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   26     35   
        if let Some(value) = crate::protocol_serde::shape_required_header_collection_operation_input::de_required_header_set_header(&headers)? {
   27     36   
                                input = input.set_required_header_set(value)
   28     37   
                            }
          38  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   29     39   
        input.build()?
          40  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   30     41   
    })
          42  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   31     43   
}
   32     44   
          45  +
/* RustType.kt:516 */
   33     46   
#[allow(clippy::unnecessary_wraps)]
          47  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   34     48   
pub fn ser_required_header_collection_operation_http_response(
   35     49   
    #[allow(unused_variables)] output: crate::output::RequiredHeaderCollectionOperationOutput,
   36     50   
) -> std::result::Result<
   37     51   
    ::aws_smithy_http_server::response::Response,
   38     52   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   39     53   
> {
          54  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   40     55   
    Ok({
          56  +
        /* RustType.kt:516 */
   41     57   
        #[allow(unused_mut)]
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   42     59   
        let mut builder = ::http::Response::builder();
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:629 */
   43     61   
        builder = crate::protocol_serde::shape_required_header_collection_operation::ser_required_header_collection_operation_headers(&output, builder)?;
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     63   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     64   
            builder,
   46     65   
            ::http::header::CONTENT_TYPE,
   47     66   
            "application/json",
   48     67   
        );
          68  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     69   
        let http_status: u16 = 200;
   50     70   
        builder = builder.status(http_status);
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   51     72   
        let payload =
   52         -
            crate::protocol_serde::shape_required_header_collection_operation_output::ser_required_header_collection_operation_output_output_output(&output)?
   53         -
        ;
          73  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_required_header_collection_operation_output::ser_required_header_collection_operation_output_output_output(&output)?
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   54     76   
        let content_length = payload.len();
   55     77   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   56     78   
            builder,
   57     79   
            ::http::header::CONTENT_LENGTH,
   58     80   
            content_length,
   59     81   
        );
          82  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   60     83   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   61     85   
        builder.body(body)?
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   62     87   
    })
          88  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   63     89   
}
   64     90   
          91  +
/* RustType.kt:516 */
   65     92   
#[allow(clippy::unnecessary_wraps)]
          93  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   66     94   
pub fn ser_required_header_collection_operation_http_error(
   67     95   
    error: &crate::error::RequiredHeaderCollectionOperationError,
   68     96   
) -> std::result::Result<
   69     97   
    ::aws_smithy_http_server::response::Response,
   70     98   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   71     99   
> {
         100  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   72    101   
    Ok({
         102  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   73    103   
        match error {
         104  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   74    105   
            crate::error::RequiredHeaderCollectionOperationError::ValidationException(output) => {
         106  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   75    107   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         108  +
                /* RustType.kt:516 */
   76    109   
                #[allow(unused_mut)]
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   77    111   
                let mut builder = ::http::Response::builder();
         112  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   78    113   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79    114   
                    builder,
   80    115   
                    ::http::header::CONTENT_TYPE,
   81    116   
                    "application/json",
   82    117   
                );
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   83    119   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84    120   
                    builder,
   85    121   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   86    122   
                    "ValidationException",
   87    123   
                );
         124  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   88    125   
                let content_length = payload.len();
   89    126   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   90    127   
                    builder,
   91    128   
                    ::http::header::CONTENT_LENGTH,
   92    129   
                    content_length,
   93    130   
                );
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   94    132   
                builder
   95    133   
                    .status(400)
   96    134   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   97         -
            }
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         136  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   98    137   
        }
         138  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   99    139   
    })
         140  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  100    141   
}
  101    142   
         143  +
/* HttpBindingGenerator.kt:542 */
  102    144   
pub fn ser_required_header_collection_operation_headers(
  103    145   
    input: &crate::output::RequiredHeaderCollectionOperationOutput,
  104    146   
    mut builder: ::http::response::Builder,
  105    147   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  106    148   
{
         149  +
    /* HttpBindingGenerator.kt:646 */
  107    150   
    for inner_1 in &input.required_header_list {
         151  +
        /* HttpBindingGenerator.kt:704 */
  108    152   
        let formatted_2 = ::aws_smithy_http::header::quote_header_value(inner_1.as_str());
         153  +
        /* HttpBindingGenerator.kt:705 */
  109    154   
        if !formatted_2.is_empty() {
         155  +
            /* HttpBindingGenerator.kt:706 */
  110    156   
            let header_value = formatted_2;
  111    157   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  112    158   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  113    159   
                    "required_header_list",
  114    160   
                    format!(
  115    161   
                        "`{}` cannot be used as a header value: {}",
  116    162   
                        &header_value, err
  117    163   
                    ),
  118    164   
                )
  119    165   
            })?;
  120    166   
            builder = builder.header("X-Required-List", header_value);
         167  +
            /* HttpBindingGenerator.kt:705 */
  121    168   
        }
         169  +
        /* HttpBindingGenerator.kt:646 */
  122    170   
    }
         171  +
    /* HttpBindingGenerator.kt:646 */
  123    172   
    for inner_3 in &input.required_header_set.0 {
         173  +
        /* HttpBindingGenerator.kt:704 */
  124    174   
        let formatted_4 = ::aws_smithy_http::header::quote_header_value(inner_3.as_str());
         175  +
        /* HttpBindingGenerator.kt:705 */
  125    176   
        if !formatted_4.is_empty() {
         177  +
            /* HttpBindingGenerator.kt:706 */
  126    178   
            let header_value = formatted_4;
  127    179   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  128    180   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  129    181   
                    "required_header_set",
  130    182   
                    format!(
  131    183   
                        "`{}` cannot be used as a header value: {}",
  132    184   
                        &header_value, err
  133    185   
                    ),
  134    186   
                )
  135    187   
            })?;
  136    188   
            builder = builder.header("X-Required-Set", header_value);
         189  +
            /* HttpBindingGenerator.kt:705 */
  137    190   
        }
         191  +
        /* HttpBindingGenerator.kt:646 */
  138    192   
    }
         193  +
    /* HttpBindingGenerator.kt:555 */
  139    194   
    Ok(builder)
         195  +
    /* HttpBindingGenerator.kt:542 */
  140    196   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_required_header_collection_operation_input.rs

@@ -1,1 +26,36 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:153 */
    2      3   
pub(crate) fn de_required_header_list_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    6      7   
    ::aws_smithy_http::header::ParseError,
    7      8   
> {
           9  +
    /* HttpBindingGenerator.kt:160 */
    8     10   
    let headers = header_map.get_all("X-Required-List");
          11  +
    /* HttpBindingGenerator.kt:409 */
    9     12   
    let var_1: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
          13  +
    /* HttpBindingGenerator.kt:430 */
   10     14   
    Ok(if !var_1.is_empty() { Some(var_1) } else { None })
          15  +
    /* HttpBindingGenerator.kt:153 */
   11     16   
}
   12     17   
          18  +
/* HttpBindingGenerator.kt:153 */
   13     19   
pub(crate) fn de_required_header_set_header(
   14     20   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   15     21   
) -> ::std::result::Result<
   16     22   
    ::std::option::Option<crate::unconstrained::header_set_unconstrained::HeaderSetUnconstrained>,
   17     23   
    ::aws_smithy_http::header::ParseError,
   18     24   
> {
          25  +
    /* HttpBindingGenerator.kt:160 */
   19     26   
    let headers = header_map.get_all("X-Required-Set");
          27  +
    /* HttpBindingGenerator.kt:409 */
   20     28   
    let var_2: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
          29  +
    /* HttpBindingGenerator.kt:456 */
   21     30   
    Ok(if !var_2.is_empty() {
   22     31   
        Some(crate::unconstrained::header_set_unconstrained::HeaderSetUnconstrained(var_2))
   23     32   
    } else {
   24     33   
        None
   25     34   
    })
          35  +
    /* HttpBindingGenerator.kt:153 */
   26     36   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_required_header_collection_operation_output.rs

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_required_header_collection_operation_output_output_output(
    3      4   
    value: &crate::output::RequiredHeaderCollectionOperationOutput,
    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_required_header_collection_operation_output::ser_required_header_collection_operation_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_required_header_collection_operation_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::RequiredHeaderCollectionOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_required_inner_shape_operation.rs

@@ -1,1 +145,205 @@
    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_required_inner_shape_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::RequiredInnerShapeOperationInput,
    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::required_inner_shape_operation_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_required_inner_shape_operation::de_required_inner_shape_operation(bytes.as_ref(), input)?;
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   29     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     42   
        input.build()?
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     44   
    })
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     46   
}
   33     47   
          48  +
/* RustType.kt:516 */
   34     49   
#[allow(clippy::unnecessary_wraps)]
          50  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     51   
pub fn ser_required_inner_shape_operation_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::RequiredInnerShapeOperationOutput,
   37     53   
) -> std::result::Result<
   38     54   
    ::aws_smithy_http_server::response::Response,
   39     55   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   40     56   
> {
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     58   
    Ok({
          59  +
        /* RustType.kt:516 */
   42     60   
        #[allow(unused_mut)]
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     62   
        let mut builder = ::http::Response::builder();
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     65   
            builder,
   46     66   
            ::http::header::CONTENT_TYPE,
   47     67   
            "application/json",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   51     73   
        let payload =
   52         -
            crate::protocol_serde::shape_required_inner_shape_operation_output::ser_required_inner_shape_operation_output_output_output(&output)?
   53         -
        ;
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_required_inner_shape_operation_output::ser_required_inner_shape_operation_output_output_output(&output)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   54     77   
        let content_length = payload.len();
   55     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   56     79   
            builder,
   57     80   
            ::http::header::CONTENT_LENGTH,
   58     81   
            content_length,
   59     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   60     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   61     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   62     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   63     90   
}
   64     91   
          92  +
/* RustType.kt:516 */
   65     93   
#[allow(clippy::unnecessary_wraps)]
          94  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   66     95   
pub fn ser_required_inner_shape_operation_http_error(
   67     96   
    error: &crate::error::RequiredInnerShapeOperationError,
   68     97   
) -> std::result::Result<
   69     98   
    ::aws_smithy_http_server::response::Response,
   70     99   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   71    100   
> {
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   72    102   
    Ok({
         103  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   73    104   
        match error {
         105  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   74    106   
            crate::error::RequiredInnerShapeOperationError::ValidationException(output) => {
         107  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   75    108   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         109  +
                /* RustType.kt:516 */
   76    110   
                #[allow(unused_mut)]
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   77    112   
                let mut builder = ::http::Response::builder();
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   78    114   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79    115   
                    builder,
   80    116   
                    ::http::header::CONTENT_TYPE,
   81    117   
                    "application/json",
   82    118   
                );
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   83    120   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84    121   
                    builder,
   85    122   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   86    123   
                    "ValidationException",
   87    124   
                );
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   88    126   
                let content_length = payload.len();
   89    127   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   90    128   
                    builder,
   91    129   
                    ::http::header::CONTENT_LENGTH,
   92    130   
                    content_length,
   93    131   
                );
         132  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   94    133   
                builder
   95    134   
                    .status(400)
   96    135   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   97         -
            }
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         137  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   98    138   
        }
         139  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   99    140   
    })
         141  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  100    142   
}
  101    143   
         144  +
/* JsonParserGenerator.kt:148 */
  102    145   
pub(crate) fn de_required_inner_shape_operation(
  103    146   
    value: &[u8],
  104    147   
    mut builder: crate::input::required_inner_shape_operation_input::Builder,
  105    148   
) -> ::std::result::Result<
  106    149   
    crate::input::required_inner_shape_operation_input::Builder,
  107    150   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  108    151   
> {
         152  +
    /* JsonParserGenerator.kt:153 */
  109    153   
    let mut tokens_owned =
  110    154   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  111    155   
            .peekable();
  112    156   
    let tokens = &mut tokens_owned;
  113    157   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         158  +
    /* JsonParserGenerator.kt:684 */
  114    159   
    loop {
         160  +
        /* JsonParserGenerator.kt:685 */
  115    161   
        match tokens.next().transpose()? {
         162  +
            /* JsonParserGenerator.kt:686 */
  116    163   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  117    164   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         165  +
                /* JsonParserGenerator.kt:260 */
  118    166   
                match key.to_unescaped()?.as_ref() {
         167  +
                    /* JsonParserGenerator.kt:262 */
  119    168   
                    "inner" => {
         169  +
                        /* JsonParserGenerator.kt:272 */
  120    170   
                        builder = builder.set_inner(
  121         -
                            crate::protocol_serde::shape_inner_shape::de_inner_shape(tokens)?,
  122         -
                        );
         171  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_inner_shape::de_inner_shape(tokens)?
         172  +
                        /* JsonParserGenerator.kt:272 */);
         173  +
                        /* JsonParserGenerator.kt:262 */
  123    174   
                    }
  124         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         175  +
                    /* JsonParserGenerator.kt:290 */
         176  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  125    177   
                }
         178  +
                /* JsonParserGenerator.kt:686 */
  126    179   
            }
         180  +
            /* JsonParserGenerator.kt:695 */
  127    181   
            other => {
  128    182   
                return Err(
  129    183   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  130    184   
                        "expected object key or end object, found: {:?}",
  131    185   
                        other
  132    186   
                    )),
  133    187   
                )
  134         -
            }
         188  +
            } /* JsonParserGenerator.kt:685 */
  135    189   
        }
         190  +
        /* JsonParserGenerator.kt:684 */
  136    191   
    }
         192  +
    /* JsonParserGenerator.kt:250 */
  137    193   
    if tokens.next().is_some() {
         194  +
        /* JsonParserGenerator.kt:251 */
  138    195   
        return Err(
  139    196   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  140    197   
                "found more JSON tokens after completing parsing",
  141    198   
            ),
  142    199   
        );
         200  +
        /* JsonParserGenerator.kt:250 */
  143    201   
    }
         202  +
    /* JsonParserGenerator.kt:163 */
  144    203   
    Ok(builder)
         204  +
    /* JsonParserGenerator.kt:148 */
  145    205   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_required_inner_shape_operation_output.rs

@@ -1,1 +23,37 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_required_inner_shape_operation_output_output_output(
    3      4   
    value: &crate::output::RequiredInnerShapeOperationOutput,
    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_required_inner_shape_operation_output::ser_required_inner_shape_operation_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_required_inner_shape_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::RequiredInnerShapeOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.inner {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("inner").start_object();
          28  +
        /* JsonSerializerGenerator.kt:375 */
   19     29   
        crate::protocol_serde::shape_inner_shape::ser_inner_shape(&mut object_2, var_1)?;
          30  +
        /* JsonSerializerGenerator.kt:515 */
   20     31   
        object_2.finish();
          32  +
        /* JsonSerializerGenerator.kt:382 */
   21     33   
    }
          34  +
    /* JsonSerializerGenerator.kt:372 */
   22     35   
    Ok(())
          36  +
    /* JsonSerializerGenerator.kt:358 */
   23     37   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_response_code_default_operation.rs

@@ -1,1 +55,78 @@
    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_response_code_default_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ResponseCodeDefaultOperationInput,
    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::response_code_default_operation_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:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_response_code_default_operation_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::ResponseCodeDefaultOperationOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/json",
   40     56   
        );
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   41     58   
        let http_status: u16 = 200;
   42     59   
        builder = builder.status(http_status);
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   43     61   
        let payload =
   44         -
            crate::protocol_serde::shape_response_code_default_operation_output::ser_response_code_default_operation_output_output_output(&output)?
   45         -
        ;
          62  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_response_code_default_operation_output::ser_response_code_default_operation_output_output_output(&output)?
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   46     65   
        let content_length = payload.len();
   47     66   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     67   
            builder,
   49     68   
            ::http::header::CONTENT_LENGTH,
   50     69   
            content_length,
   51     70   
        );
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   52     72   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   53     74   
        builder.body(body)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   54     76   
    })
          77  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   55     78   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_response_code_default_operation_output.rs

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_response_code_default_operation_output_output_output(
    3      4   
    value: &crate::output::ResponseCodeDefaultOperationOutput,
    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_response_code_default_operation_output::ser_response_code_default_operation_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_response_code_default_operation_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::ResponseCodeDefaultOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_response_code_http_fallback_operation.rs

@@ -1,1 +56,79 @@
    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_response_code_http_fallback_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ResponseCodeHttpFallbackOperationInput,
    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 =
   18     23   
            crate::input::response_code_http_fallback_operation_input::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   23     31   
        input.build()
          32  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   24     33   
    })
          34  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   25     35   
}
   26     36   
          37  +
/* RustType.kt:516 */
   27     38   
#[allow(clippy::unnecessary_wraps)]
          39  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   28     40   
pub fn ser_response_code_http_fallback_operation_http_response(
   29     41   
    #[allow(unused_variables)] output: crate::output::ResponseCodeHttpFallbackOperationOutput,
   30     42   
) -> std::result::Result<
   31     43   
    ::aws_smithy_http_server::response::Response,
   32     44   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     45   
> {
          46  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   34     47   
    Ok({
          48  +
        /* RustType.kt:516 */
   35     49   
        #[allow(unused_mut)]
          50  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   36     51   
        let mut builder = ::http::Response::builder();
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   37     53   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     54   
            builder,
   39     55   
            ::http::header::CONTENT_TYPE,
   40     56   
            "application/json",
   41     57   
        );
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   42     59   
        let http_status: u16 = 201;
   43     60   
        builder = builder.status(http_status);
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   44     62   
        let payload =
   45         -
            crate::protocol_serde::shape_response_code_http_fallback_operation_output::ser_response_code_http_fallback_operation_output_output_output(&output)?
   46         -
        ;
          63  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_response_code_http_fallback_operation_output::ser_response_code_http_fallback_operation_output_output_output(&output)?
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   47     66   
        let content_length = payload.len();
   48     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     68   
            builder,
   50     69   
            ::http::header::CONTENT_LENGTH,
   51     70   
            content_length,
   52     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   53     73   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   54     75   
        builder.body(body)?
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   55     77   
    })
          78  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   56     79   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_response_code_http_fallback_operation_output.rs

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_response_code_http_fallback_operation_output_output_output(
    3      4   
    value: &crate::output::ResponseCodeHttpFallbackOperationOutput,
    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_response_code_http_fallback_operation_output::ser_response_code_http_fallback_operation_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_response_code_http_fallback_operation_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::ResponseCodeHttpFallbackOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_response_code_required_operation.rs

@@ -1,1 +56,81 @@
    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_response_code_required_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ResponseCodeRequiredOperationInput,
    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::response_code_required_operation_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:834 */
   22     30   
        input.build()
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   23     32   
    })
          33  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   24     34   
}
   25     35   
          36  +
/* RustType.kt:516 */
   26     37   
#[allow(clippy::unnecessary_wraps)]
          38  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   27     39   
pub fn ser_response_code_required_operation_http_response(
   28     40   
    #[allow(unused_variables)] output: crate::output::ResponseCodeRequiredOperationOutput,
   29     41   
) -> std::result::Result<
   30     42   
    ::aws_smithy_http_server::response::Response,
   31     43   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   32     44   
> {
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   33     46   
    Ok({
          47  +
        /* RustType.kt:516 */
   34     48   
        #[allow(unused_mut)]
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   35     50   
        let mut builder = ::http::Response::builder();
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   36     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     53   
            builder,
   38     54   
            ::http::header::CONTENT_TYPE,
   39     55   
            "application/json",
   40     56   
        );
   41         -
        let status = output.response_code;
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:701 */
          58  +
        let status = output.response_code
          59  +
        /* ServerHttpBoundProtocolGenerator.kt:701 */;
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:706 */
   42     61   
        let http_status: u16 = status.try_into().map_err(::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection::InvalidHttpStatusCode)?;
   43     62   
        builder = builder.status(http_status);
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   44     64   
        let payload =
   45         -
            crate::protocol_serde::shape_response_code_required_operation_output::ser_response_code_required_operation_output_output_output(&output)?
   46         -
        ;
          65  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_response_code_required_operation_output::ser_response_code_required_operation_output_output_output(&output)?
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   47     68   
        let content_length = payload.len();
   48     69   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     70   
            builder,
   50     71   
            ::http::header::CONTENT_LENGTH,
   51     72   
            content_length,
   52     73   
        );
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   53     75   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   54     77   
        builder.body(body)?
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   55     79   
    })
          80  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   56     81   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_response_code_required_operation_output.rs

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_response_code_required_operation_output_output_output(
    3      4   
    value: &crate::output::ResponseCodeRequiredOperationOutput,
    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_response_code_required_operation_output::ser_response_code_required_operation_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_response_code_required_operation_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::ResponseCodeRequiredOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_type_complexity_operation.rs

@@ -1,1 +107,153 @@
    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_type_complexity_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::TypeComplexityOperationInput,
    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::type_complexity_operation_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_type_complexity_operation::de_type_complexity_operation(bytes.as_ref(), input)?;
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   29     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     42   
        input.build()
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     44   
    })
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     46   
}
   33     47   
          48  +
/* RustType.kt:516 */
   34     49   
#[allow(clippy::unnecessary_wraps)]
          50  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     51   
pub fn ser_type_complexity_operation_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::TypeComplexityOperationOutput,
   37     53   
) -> std::result::Result<
   38     54   
    ::aws_smithy_http_server::response::Response,
   39     55   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   40     56   
> {
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     58   
    Ok({
          59  +
        /* RustType.kt:516 */
   42     60   
        #[allow(unused_mut)]
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     62   
        let mut builder = ::http::Response::builder();
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     65   
            builder,
   46     66   
            ::http::header::CONTENT_TYPE,
   47     67   
            "application/json",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   51     73   
        let payload =
   52         -
            crate::protocol_serde::shape_type_complexity_operation_output::ser_type_complexity_operation_output_output_output(&output)?
   53         -
        ;
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_type_complexity_operation_output::ser_type_complexity_operation_output_output_output(&output)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   54     77   
        let content_length = payload.len();
   55     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   56     79   
            builder,
   57     80   
            ::http::header::CONTENT_LENGTH,
   58     81   
            content_length,
   59     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   60     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   61     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   62     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   63     90   
}
   64     91   
          92  +
/* JsonParserGenerator.kt:148 */
   65     93   
pub(crate) fn de_type_complexity_operation(
   66     94   
    value: &[u8],
   67     95   
    mut builder: crate::input::type_complexity_operation_input::Builder,
   68     96   
) -> ::std::result::Result<
   69     97   
    crate::input::type_complexity_operation_input::Builder,
   70     98   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   71     99   
> {
         100  +
    /* JsonParserGenerator.kt:153 */
   72    101   
    let mut tokens_owned =
   73    102   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
   74    103   
            .peekable();
   75    104   
    let tokens = &mut tokens_owned;
   76    105   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         106  +
    /* JsonParserGenerator.kt:684 */
   77    107   
    loop {
         108  +
        /* JsonParserGenerator.kt:685 */
   78    109   
        match tokens.next().transpose()? {
         110  +
            /* JsonParserGenerator.kt:686 */
   79    111   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   80    112   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         113  +
                /* JsonParserGenerator.kt:260 */
   81    114   
                match key.to_unescaped()?.as_ref() {
         115  +
                    /* JsonParserGenerator.kt:262 */
   82    116   
                    "list" => {
   83         -
                        builder = builder
   84         -
                            .set_list(crate::protocol_serde::shape_list_a::de_list_a(tokens)?);
         117  +
                        /* JsonParserGenerator.kt:272 */
         118  +
                        builder = builder.set_list(
         119  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_a::de_list_a(tokens)?
         120  +
                        /* JsonParserGenerator.kt:272 */);
         121  +
                        /* JsonParserGenerator.kt:262 */
   85    122   
                    }
   86         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         123  +
                    /* JsonParserGenerator.kt:290 */
         124  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   87    125   
                }
         126  +
                /* JsonParserGenerator.kt:686 */
   88    127   
            }
         128  +
            /* JsonParserGenerator.kt:695 */
   89    129   
            other => {
   90    130   
                return Err(
   91    131   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   92    132   
                        "expected object key or end object, found: {:?}",
   93    133   
                        other
   94    134   
                    )),
   95    135   
                )
   96         -
            }
         136  +
            } /* JsonParserGenerator.kt:685 */
   97    137   
        }
         138  +
        /* JsonParserGenerator.kt:684 */
   98    139   
    }
         140  +
    /* JsonParserGenerator.kt:250 */
   99    141   
    if tokens.next().is_some() {
         142  +
        /* JsonParserGenerator.kt:251 */
  100    143   
        return Err(
  101    144   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  102    145   
                "found more JSON tokens after completing parsing",
  103    146   
            ),
  104    147   
        );
         148  +
        /* JsonParserGenerator.kt:250 */
  105    149   
    }
         150  +
    /* JsonParserGenerator.kt:163 */
  106    151   
    Ok(builder)
         152  +
    /* JsonParserGenerator.kt:148 */
  107    153   
}