Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_enum_string_operation_output.rs

@@ -1,1 +27,45 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_query_params_targeting_map_of_enum_string_operation_output_output_output(
    3      4   
    value: &crate::output::QueryParamsTargetingMapOfEnumStringOperationOutput,
    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_query_params_targeting_map_of_enum_string_operation_output::ser_query_params_targeting_map_of_enum_string_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_query_params_targeting_map_of_enum_string_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::QueryParamsTargetingMapOfEnumStringOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.map_of_enum_string {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("mapOfEnumString").start_object();
          28  +
        /* JsonSerializerGenerator.kt:537 */
   19     29   
        for (key_3, value_4) in var_1 {
          30  +
            /* SerializerUtil.kt:42 */
   20     31   
            {
          32  +
                /* JsonSerializerGenerator.kt:423 */
   21     33   
                object_2.key(key_3.as_str()).string(value_4.as_str());
          34  +
                /* SerializerUtil.kt:42 */
   22     35   
            }
          36  +
            /* JsonSerializerGenerator.kt:537 */
   23     37   
        }
          38  +
        /* JsonSerializerGenerator.kt:515 */
   24     39   
        object_2.finish();
          40  +
        /* JsonSerializerGenerator.kt:382 */
   25     41   
    }
          42  +
    /* JsonSerializerGenerator.kt:372 */
   26     43   
    Ok(())
          44  +
    /* JsonSerializerGenerator.kt:358 */
   27     45   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_length_list_of_pattern_string_operation.rs

@@ -1,1 +119,159 @@
    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_query_params_targeting_map_of_length_list_of_pattern_string_operation_http_request<
    4      6   
    B,
    5      7   
>(
    6      8   
    #[allow(unused_variables)] request: ::http::Request<B>,
    7      9   
) -> std::result::Result<
    8     10   
    crate::input::QueryParamsTargetingMapOfLengthListOfPatternStringOperationInput,
    9     11   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   10     12   
>
   11     13   
where
   12     14   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   13     15   
    B::Data: Send,
   14     16   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   15     17   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   16     18   
{
          19  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   17     20   
    Ok({
          21  +
        /* RustType.kt:516 */
   18     22   
        #[allow(unused_mut)]
   19         -
        let mut input = crate::input::query_params_targeting_map_of_length_list_of_pattern_string_operation_input_internal::Builder::default();
          23  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */let mut input = crate::input::query_params_targeting_map_of_length_list_of_pattern_string_operation_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   20     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   21     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   22     28   
            uri, headers, body, ..
   23     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:1073 */
   24     31   
        let query_string = uri.query().unwrap_or("");
   25     32   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */
   26     34   
        let mut query_params: crate::unconstrained::map_of_length_list_of_pattern_string_unconstrained::MapOfLengthListOfPatternStringUnconstrained =
   27         -
            crate::unconstrained::map_of_length_list_of_pattern_string_unconstrained::MapOfLengthListOfPatternStringUnconstrained(
   28         -
                ::std::collections::HashMap::new()
   29         -
            )
   30         -
        ;
          35  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */crate::unconstrained::map_of_length_list_of_pattern_string_unconstrained::MapOfLengthListOfPatternStringUnconstrained(
          36  +
                /* ServerHttpBoundProtocolGenerator.kt:1090 */::std::collections::HashMap::new()
          37  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */)
          38  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */;
          39  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   31     40   
        for (k, v) in pairs {
          41  +
            /* ServerHttpBoundProtocolGenerator.kt:1187 */
   32     42   
            let entry = query_params.0.entry(String::from(k)).or_insert_with(|| crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained(std::vec::Vec::new()));
   33     43   
            entry.0.push(String::from(v));
          44  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   34     45   
        }
   35         -
        input = input.set_map_of_length_list_of_pattern_string(Some(query_params));
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:1213 */
          47  +
        input = input.set_map_of_length_list_of_pattern_string(
          48  +
            /* ServerHttpBoundProtocolGenerator.kt:1214 */
          49  +
            Some(
          50  +
                /* ServerHttpBoundProtocolGenerator.kt:1215 */
          51  +
                query_params, /* ServerHttpBoundProtocolGenerator.kt:1214 */
          52  +
            ), /* ServerHttpBoundProtocolGenerator.kt:1213 */
          53  +
        );
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   36     55   
        input.build()?
          56  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   37     57   
    })
          58  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   38     59   
}
   39     60   
          61  +
/* RustType.kt:516 */
   40     62   
#[allow(clippy::unnecessary_wraps)]
          63  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   41     64   
pub fn ser_query_params_targeting_map_of_length_list_of_pattern_string_operation_http_response(
   42     65   
    #[allow(unused_variables)]
   43     66   
    output: crate::output::QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput,
   44     67   
) -> std::result::Result<
   45     68   
    ::aws_smithy_http_server::response::Response,
   46     69   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   47     70   
> {
          71  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   48     72   
    Ok({
          73  +
        /* RustType.kt:516 */
   49     74   
        #[allow(unused_mut)]
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   50     76   
        let mut builder = ::http::Response::builder();
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   51     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   52     79   
            builder,
   53     80   
            ::http::header::CONTENT_TYPE,
   54     81   
            "application/json",
   55     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   56     84   
        let http_status: u16 = 200;
   57     85   
        builder = builder.status(http_status);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   58     87   
        let payload =
   59         -
            crate::protocol_serde::shape_query_params_targeting_map_of_length_list_of_pattern_string_operation_output::ser_query_params_targeting_map_of_length_list_of_pattern_string_operation_output_output_output(&output)?
   60         -
        ;
          88  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_query_params_targeting_map_of_length_list_of_pattern_string_operation_output::ser_query_params_targeting_map_of_length_list_of_pattern_string_operation_output_output_output(&output)?
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   61     91   
        let content_length = payload.len();
   62     92   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   63     93   
            builder,
   64     94   
            ::http::header::CONTENT_LENGTH,
   65     95   
            content_length,
   66     96   
        );
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   67     98   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   68    100   
        builder.body(body)?
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   69    102   
    })
         103  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   70    104   
}
   71    105   
         106  +
/* RustType.kt:516 */
   72    107   
#[allow(clippy::unnecessary_wraps)]
         108  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   73    109   
pub fn ser_query_params_targeting_map_of_length_list_of_pattern_string_operation_http_error(
   74    110   
    error: &crate::error::QueryParamsTargetingMapOfLengthListOfPatternStringOperationError,
   75    111   
) -> std::result::Result<
   76    112   
    ::aws_smithy_http_server::response::Response,
   77    113   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78    114   
> {
         115  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   79    116   
    Ok({
         117  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   80    118   
        match error {
   81         -
            crate::error::QueryParamsTargetingMapOfLengthListOfPatternStringOperationError::ValidationException(output) => {
   82         -
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83         -
                #[allow(unused_mut)]
   84         -
                let mut builder = ::http::Response::builder();
   85         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         119  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfLengthListOfPatternStringOperationError::ValidationException(output) => {
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         121  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86    124   
                                builder,
   87    125   
                                ::http::header::CONTENT_TYPE,
   88    126   
                                "application/json",
   89    127   
                            );
   90         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    129   
                                builder,
   92    130   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
   93    131   
                                "ValidationException",
   94    132   
                            );
   95         -
                let content_length = payload.len();
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
   96    134   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
   97         -
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   98         -
            }
   99         -
            crate::error::QueryParamsTargetingMapOfLengthListOfPatternStringOperationError::InternalServerError(output) => {
  100         -
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  101         -
                #[allow(unused_mut)]
  102         -
                let mut builder = ::http::Response::builder();
  103         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
         136  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         137  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfLengthListOfPatternStringOperationError::InternalServerError(output) => {
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         139  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         141  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  104    142   
                                builder,
  105    143   
                                ::http::header::CONTENT_TYPE,
  106    144   
                                "application/json",
  107    145   
                            );
  108         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  109    147   
                                builder,
  110    148   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
  111    149   
                                "InternalServerError",
  112    150   
                            );
  113         -
                let content_length = payload.len();
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
  114    152   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
  115         -
                builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
  116         -
            }
  117         -
        }
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
         154  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         155  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */}
         156  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  118    157   
    })
         158  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  119    159   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_length_list_of_pattern_string_operation_output.rs

@@ -1,1 +33,57 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_query_params_targeting_map_of_length_list_of_pattern_string_operation_output_output_output(
    3      4   
    value: &crate::output::QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput,
    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_query_params_targeting_map_of_length_list_of_pattern_string_operation_output::ser_query_params_targeting_map_of_length_list_of_pattern_string_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_query_params_targeting_map_of_length_list_of_pattern_string_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::QueryParamsTargetingMapOfLengthListOfPatternStringOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.map_of_length_list_of_pattern_string {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("mapOfLengthListOfPatternString").start_object();
          28  +
        /* JsonSerializerGenerator.kt:537 */
   19     29   
        for (key_3, value_4) in var_1 {
          30  +
            /* SerializerUtil.kt:42 */
   20     31   
            {
          32  +
                /* JsonSerializerGenerator.kt:484 */
   21     33   
                let mut array_5 = object_2.key(key_3.as_str()).start_array();
          34  +
                /* JsonSerializerGenerator.kt:524 */
   22     35   
                for item_6 in value_4 {
          36  +
                    /* SerializerUtil.kt:42 */
   23     37   
                    {
          38  +
                        /* JsonSerializerGenerator.kt:423 */
   24     39   
                        array_5.value().string(item_6.as_str());
          40  +
                        /* SerializerUtil.kt:42 */
   25     41   
                    }
          42  +
                    /* JsonSerializerGenerator.kt:524 */
   26     43   
                }
          44  +
                /* JsonSerializerGenerator.kt:486 */
   27     45   
                array_5.finish();
          46  +
                /* SerializerUtil.kt:42 */
   28     47   
            }
          48  +
            /* JsonSerializerGenerator.kt:537 */
   29     49   
        }
          50  +
        /* JsonSerializerGenerator.kt:515 */
   30     51   
        object_2.finish();
          52  +
        /* JsonSerializerGenerator.kt:382 */
   31     53   
    }
          54  +
    /* JsonSerializerGenerator.kt:372 */
   32     55   
    Ok(())
          56  +
    /* JsonSerializerGenerator.kt:358 */
   33     57   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_length_pattern_string_operation.rs

@@ -1,1 +119,159 @@
    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_query_params_targeting_map_of_length_pattern_string_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::QueryParamsTargetingMapOfLengthPatternStringOperationInput,
    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)]
   17         -
        let mut input = crate::input::query_params_targeting_map_of_length_pattern_string_operation_input_internal::Builder::default();
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */let mut input = crate::input::query_params_targeting_map_of_length_pattern_string_operation_input_internal::Builder::default();
          22  +
        /* RustType.kt:516 */
   18     23   
        #[allow(unused_variables)]
          24  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     25   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     26   
            uri, headers, body, ..
   21     27   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          28  +
        /* ServerHttpBoundProtocolGenerator.kt:1073 */
   22     29   
        let query_string = uri.query().unwrap_or("");
   23     30   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */
   24     32   
        let mut query_params: crate::unconstrained::map_of_length_pattern_string_unconstrained::MapOfLengthPatternStringUnconstrained =
   25         -
            crate::unconstrained::map_of_length_pattern_string_unconstrained::MapOfLengthPatternStringUnconstrained(
   26         -
                ::std::collections::HashMap::new()
   27         -
            )
   28         -
        ;
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */crate::unconstrained::map_of_length_pattern_string_unconstrained::MapOfLengthPatternStringUnconstrained(
          34  +
                /* ServerHttpBoundProtocolGenerator.kt:1090 */::std::collections::HashMap::new()
          35  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */)
          36  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */;
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   29     38   
        for (k, v) in pairs {
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:1180 */
   30     40   
            query_params
   31     41   
                .0
   32     42   
                .entry(String::from(k))
   33     43   
                .or_insert_with(|| String::from(v));
          44  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   34     45   
        }
   35         -
        input = input.set_map_of_length_pattern_string(Some(query_params));
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:1213 */
          47  +
        input = input.set_map_of_length_pattern_string(
          48  +
            /* ServerHttpBoundProtocolGenerator.kt:1214 */
          49  +
            Some(
          50  +
                /* ServerHttpBoundProtocolGenerator.kt:1215 */
          51  +
                query_params, /* ServerHttpBoundProtocolGenerator.kt:1214 */
          52  +
            ), /* ServerHttpBoundProtocolGenerator.kt:1213 */
          53  +
        );
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   36     55   
        input.build()?
          56  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   37     57   
    })
          58  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   38     59   
}
   39     60   
          61  +
/* RustType.kt:516 */
   40     62   
#[allow(clippy::unnecessary_wraps)]
          63  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   41     64   
pub fn ser_query_params_targeting_map_of_length_pattern_string_operation_http_response(
   42     65   
    #[allow(unused_variables)]
   43     66   
    output: crate::output::QueryParamsTargetingMapOfLengthPatternStringOperationOutput,
   44     67   
) -> std::result::Result<
   45     68   
    ::aws_smithy_http_server::response::Response,
   46     69   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   47     70   
> {
          71  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   48     72   
    Ok({
          73  +
        /* RustType.kt:516 */
   49     74   
        #[allow(unused_mut)]
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   50     76   
        let mut builder = ::http::Response::builder();
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   51     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   52     79   
            builder,
   53     80   
            ::http::header::CONTENT_TYPE,
   54     81   
            "application/json",
   55     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   56     84   
        let http_status: u16 = 200;
   57     85   
        builder = builder.status(http_status);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   58     87   
        let payload =
   59         -
            crate::protocol_serde::shape_query_params_targeting_map_of_length_pattern_string_operation_output::ser_query_params_targeting_map_of_length_pattern_string_operation_output_output_output(&output)?
   60         -
        ;
          88  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_query_params_targeting_map_of_length_pattern_string_operation_output::ser_query_params_targeting_map_of_length_pattern_string_operation_output_output_output(&output)?
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   61     91   
        let content_length = payload.len();
   62     92   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   63     93   
            builder,
   64     94   
            ::http::header::CONTENT_LENGTH,
   65     95   
            content_length,
   66     96   
        );
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   67     98   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   68    100   
        builder.body(body)?
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   69    102   
    })
         103  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   70    104   
}
   71    105   
         106  +
/* RustType.kt:516 */
   72    107   
#[allow(clippy::unnecessary_wraps)]
         108  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   73    109   
pub fn ser_query_params_targeting_map_of_length_pattern_string_operation_http_error(
   74    110   
    error: &crate::error::QueryParamsTargetingMapOfLengthPatternStringOperationError,
   75    111   
) -> std::result::Result<
   76    112   
    ::aws_smithy_http_server::response::Response,
   77    113   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78    114   
> {
         115  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   79    116   
    Ok({
         117  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   80    118   
        match error {
   81         -
            crate::error::QueryParamsTargetingMapOfLengthPatternStringOperationError::ValidationException(output) => {
   82         -
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83         -
                #[allow(unused_mut)]
   84         -
                let mut builder = ::http::Response::builder();
   85         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         119  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfLengthPatternStringOperationError::ValidationException(output) => {
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         121  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86    124   
                                builder,
   87    125   
                                ::http::header::CONTENT_TYPE,
   88    126   
                                "application/json",
   89    127   
                            );
   90         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    129   
                                builder,
   92    130   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
   93    131   
                                "ValidationException",
   94    132   
                            );
   95         -
                let content_length = payload.len();
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
   96    134   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
   97         -
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   98         -
            }
   99         -
            crate::error::QueryParamsTargetingMapOfLengthPatternStringOperationError::InternalServerError(output) => {
  100         -
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  101         -
                #[allow(unused_mut)]
  102         -
                let mut builder = ::http::Response::builder();
  103         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
         136  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         137  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfLengthPatternStringOperationError::InternalServerError(output) => {
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         139  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         141  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  104    142   
                                builder,
  105    143   
                                ::http::header::CONTENT_TYPE,
  106    144   
                                "application/json",
  107    145   
                            );
  108         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  109    147   
                                builder,
  110    148   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
  111    149   
                                "InternalServerError",
  112    150   
                            );
  113         -
                let content_length = payload.len();
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
  114    152   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
  115         -
                builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
  116         -
            }
  117         -
        }
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
         154  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         155  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */}
         156  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  118    157   
    })
         158  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  119    159   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_length_pattern_string_operation_output.rs

@@ -1,1 +27,45 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_query_params_targeting_map_of_length_pattern_string_operation_output_output_output(
    3      4   
    value: &crate::output::QueryParamsTargetingMapOfLengthPatternStringOperationOutput,
    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_query_params_targeting_map_of_length_pattern_string_operation_output::ser_query_params_targeting_map_of_length_pattern_string_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_query_params_targeting_map_of_length_pattern_string_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::QueryParamsTargetingMapOfLengthPatternStringOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.map_of_length_pattern_string {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("mapOfLengthPatternString").start_object();
          28  +
        /* JsonSerializerGenerator.kt:537 */
   19     29   
        for (key_3, value_4) in var_1 {
          30  +
            /* SerializerUtil.kt:42 */
   20     31   
            {
          32  +
                /* JsonSerializerGenerator.kt:423 */
   21     33   
                object_2.key(key_3.as_str()).string(value_4.as_str());
          34  +
                /* SerializerUtil.kt:42 */
   22     35   
            }
          36  +
            /* JsonSerializerGenerator.kt:537 */
   23     37   
        }
          38  +
        /* JsonSerializerGenerator.kt:515 */
   24     39   
        object_2.finish();
          40  +
        /* JsonSerializerGenerator.kt:382 */
   25     41   
    }
          42  +
    /* JsonSerializerGenerator.kt:372 */
   26     43   
    Ok(())
          44  +
    /* JsonSerializerGenerator.kt:358 */
   27     45   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_length_string_operation.rs

@@ -1,1 +119,159 @@
    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_query_params_targeting_map_of_length_string_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::QueryParamsTargetingMapOfLengthStringOperationInput,
    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)]
   17         -
        let mut input = crate::input::query_params_targeting_map_of_length_string_operation_input_internal::Builder::default();
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */let mut input = crate::input::query_params_targeting_map_of_length_string_operation_input_internal::Builder::default();
          22  +
        /* RustType.kt:516 */
   18     23   
        #[allow(unused_variables)]
          24  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     25   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     26   
            uri, headers, body, ..
   21     27   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          28  +
        /* ServerHttpBoundProtocolGenerator.kt:1073 */
   22     29   
        let query_string = uri.query().unwrap_or("");
   23     30   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */
   24     32   
        let mut query_params: crate::unconstrained::map_of_length_string_unconstrained::MapOfLengthStringUnconstrained =
   25         -
            crate::unconstrained::map_of_length_string_unconstrained::MapOfLengthStringUnconstrained(
   26         -
                ::std::collections::HashMap::new()
   27         -
            )
   28         -
        ;
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */crate::unconstrained::map_of_length_string_unconstrained::MapOfLengthStringUnconstrained(
          34  +
                /* ServerHttpBoundProtocolGenerator.kt:1090 */::std::collections::HashMap::new()
          35  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */)
          36  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */;
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   29     38   
        for (k, v) in pairs {
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:1180 */
   30     40   
            query_params
   31     41   
                .0
   32     42   
                .entry(String::from(k))
   33     43   
                .or_insert_with(|| String::from(v));
          44  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   34     45   
        }
   35         -
        input = input.set_map_of_length_string(Some(query_params));
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:1213 */
          47  +
        input = input.set_map_of_length_string(
          48  +
            /* ServerHttpBoundProtocolGenerator.kt:1214 */
          49  +
            Some(
          50  +
                /* ServerHttpBoundProtocolGenerator.kt:1215 */
          51  +
                query_params, /* ServerHttpBoundProtocolGenerator.kt:1214 */
          52  +
            ), /* ServerHttpBoundProtocolGenerator.kt:1213 */
          53  +
        );
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   36     55   
        input.build()?
          56  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   37     57   
    })
          58  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   38     59   
}
   39     60   
          61  +
/* RustType.kt:516 */
   40     62   
#[allow(clippy::unnecessary_wraps)]
          63  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   41     64   
pub fn ser_query_params_targeting_map_of_length_string_operation_http_response(
   42     65   
    #[allow(unused_variables)]
   43     66   
    output: crate::output::QueryParamsTargetingMapOfLengthStringOperationOutput,
   44     67   
) -> std::result::Result<
   45     68   
    ::aws_smithy_http_server::response::Response,
   46     69   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   47     70   
> {
          71  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   48     72   
    Ok({
          73  +
        /* RustType.kt:516 */
   49     74   
        #[allow(unused_mut)]
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   50     76   
        let mut builder = ::http::Response::builder();
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   51     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   52     79   
            builder,
   53     80   
            ::http::header::CONTENT_TYPE,
   54     81   
            "application/json",
   55     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   56     84   
        let http_status: u16 = 200;
   57     85   
        builder = builder.status(http_status);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   58     87   
        let payload =
   59         -
            crate::protocol_serde::shape_query_params_targeting_map_of_length_string_operation_output::ser_query_params_targeting_map_of_length_string_operation_output_output_output(&output)?
   60         -
        ;
          88  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_query_params_targeting_map_of_length_string_operation_output::ser_query_params_targeting_map_of_length_string_operation_output_output_output(&output)?
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   61     91   
        let content_length = payload.len();
   62     92   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   63     93   
            builder,
   64     94   
            ::http::header::CONTENT_LENGTH,
   65     95   
            content_length,
   66     96   
        );
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   67     98   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   68    100   
        builder.body(body)?
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   69    102   
    })
         103  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   70    104   
}
   71    105   
         106  +
/* RustType.kt:516 */
   72    107   
#[allow(clippy::unnecessary_wraps)]
         108  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   73    109   
pub fn ser_query_params_targeting_map_of_length_string_operation_http_error(
   74    110   
    error: &crate::error::QueryParamsTargetingMapOfLengthStringOperationError,
   75    111   
) -> std::result::Result<
   76    112   
    ::aws_smithy_http_server::response::Response,
   77    113   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78    114   
> {
         115  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   79    116   
    Ok({
         117  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   80    118   
        match error {
   81         -
            crate::error::QueryParamsTargetingMapOfLengthStringOperationError::ValidationException(output) => {
   82         -
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83         -
                #[allow(unused_mut)]
   84         -
                let mut builder = ::http::Response::builder();
   85         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         119  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfLengthStringOperationError::ValidationException(output) => {
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         121  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86    124   
                                builder,
   87    125   
                                ::http::header::CONTENT_TYPE,
   88    126   
                                "application/json",
   89    127   
                            );
   90         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    129   
                                builder,
   92    130   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
   93    131   
                                "ValidationException",
   94    132   
                            );
   95         -
                let content_length = payload.len();
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
   96    134   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
   97         -
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   98         -
            }
   99         -
            crate::error::QueryParamsTargetingMapOfLengthStringOperationError::InternalServerError(output) => {
  100         -
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  101         -
                #[allow(unused_mut)]
  102         -
                let mut builder = ::http::Response::builder();
  103         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
         136  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         137  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfLengthStringOperationError::InternalServerError(output) => {
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         139  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         141  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  104    142   
                                builder,
  105    143   
                                ::http::header::CONTENT_TYPE,
  106    144   
                                "application/json",
  107    145   
                            );
  108         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  109    147   
                                builder,
  110    148   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
  111    149   
                                "InternalServerError",
  112    150   
                            );
  113         -
                let content_length = payload.len();
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
  114    152   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
  115         -
                builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
  116         -
            }
  117         -
        }
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
         154  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         155  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */}
         156  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  118    157   
    })
         158  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  119    159   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_length_string_operation_output.rs

@@ -1,1 +27,45 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_query_params_targeting_map_of_length_string_operation_output_output_output(
    3      4   
    value: &crate::output::QueryParamsTargetingMapOfLengthStringOperationOutput,
    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_query_params_targeting_map_of_length_string_operation_output::ser_query_params_targeting_map_of_length_string_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_query_params_targeting_map_of_length_string_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::QueryParamsTargetingMapOfLengthStringOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.map_of_length_string {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("mapOfLengthString").start_object();
          28  +
        /* JsonSerializerGenerator.kt:537 */
   19     29   
        for (key_3, value_4) in var_1 {
          30  +
            /* SerializerUtil.kt:42 */
   20     31   
            {
          32  +
                /* JsonSerializerGenerator.kt:423 */
   21     33   
                object_2.key(key_3.as_str()).string(value_4.as_str());
          34  +
                /* SerializerUtil.kt:42 */
   22     35   
            }
          36  +
            /* JsonSerializerGenerator.kt:537 */
   23     37   
        }
          38  +
        /* JsonSerializerGenerator.kt:515 */
   24     39   
        object_2.finish();
          40  +
        /* JsonSerializerGenerator.kt:382 */
   25     41   
    }
          42  +
    /* JsonSerializerGenerator.kt:372 */
   26     43   
    Ok(())
          44  +
    /* JsonSerializerGenerator.kt:358 */
   27     45   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_list_of_enum_string_operation.rs

@@ -1,1 +117,157 @@
    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_query_params_targeting_map_of_list_of_enum_string_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::QueryParamsTargetingMapOfListOfEnumStringOperationInput,
    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)]
   17         -
        let mut input = crate::input::query_params_targeting_map_of_list_of_enum_string_operation_input_internal::Builder::default();
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */let mut input = crate::input::query_params_targeting_map_of_list_of_enum_string_operation_input_internal::Builder::default();
          22  +
        /* RustType.kt:516 */
   18     23   
        #[allow(unused_variables)]
          24  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     25   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     26   
            uri, headers, body, ..
   21     27   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          28  +
        /* ServerHttpBoundProtocolGenerator.kt:1073 */
   22     29   
        let query_string = uri.query().unwrap_or("");
   23     30   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */
   24     32   
        let mut query_params: crate::unconstrained::map_of_list_of_enum_string_unconstrained::MapOfListOfEnumStringUnconstrained =
   25         -
            crate::unconstrained::map_of_list_of_enum_string_unconstrained::MapOfListOfEnumStringUnconstrained(
   26         -
                ::std::collections::HashMap::new()
   27         -
            )
   28         -
        ;
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */crate::unconstrained::map_of_list_of_enum_string_unconstrained::MapOfListOfEnumStringUnconstrained(
          34  +
                /* ServerHttpBoundProtocolGenerator.kt:1090 */::std::collections::HashMap::new()
          35  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */)
          36  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */;
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   29     38   
        for (k, v) in pairs {
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:1187 */
   30     40   
            let entry = query_params.0.entry(String::from(k)).or_insert_with(|| crate::unconstrained::list_of_enum_string_unconstrained::ListOfEnumStringUnconstrained(std::vec::Vec::new()));
   31     41   
            entry.0.push(String::from(v));
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   32     43   
        }
   33         -
        input = input.set_map_of_list_of_enum_string(Some(query_params));
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:1213 */
          45  +
        input = input.set_map_of_list_of_enum_string(
          46  +
            /* ServerHttpBoundProtocolGenerator.kt:1214 */
          47  +
            Some(
          48  +
                /* ServerHttpBoundProtocolGenerator.kt:1215 */
          49  +
                query_params, /* ServerHttpBoundProtocolGenerator.kt:1214 */
          50  +
            ), /* ServerHttpBoundProtocolGenerator.kt:1213 */
          51  +
        );
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   34     53   
        input.build()?
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   35     55   
    })
          56  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   36     57   
}
   37     58   
          59  +
/* RustType.kt:516 */
   38     60   
#[allow(clippy::unnecessary_wraps)]
          61  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   39     62   
pub fn ser_query_params_targeting_map_of_list_of_enum_string_operation_http_response(
   40     63   
    #[allow(unused_variables)]
   41     64   
    output: crate::output::QueryParamsTargetingMapOfListOfEnumStringOperationOutput,
   42     65   
) -> std::result::Result<
   43     66   
    ::aws_smithy_http_server::response::Response,
   44     67   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   45     68   
> {
          69  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   46     70   
    Ok({
          71  +
        /* RustType.kt:516 */
   47     72   
        #[allow(unused_mut)]
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   48     74   
        let mut builder = ::http::Response::builder();
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   49     76   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     77   
            builder,
   51     78   
            ::http::header::CONTENT_TYPE,
   52     79   
            "application/json",
   53     80   
        );
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   54     82   
        let http_status: u16 = 200;
   55     83   
        builder = builder.status(http_status);
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   56     85   
        let payload =
   57         -
            crate::protocol_serde::shape_query_params_targeting_map_of_list_of_enum_string_operation_output::ser_query_params_targeting_map_of_list_of_enum_string_operation_output_output_output(&output)?
   58         -
        ;
          86  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_query_params_targeting_map_of_list_of_enum_string_operation_output::ser_query_params_targeting_map_of_list_of_enum_string_operation_output_output_output(&output)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   59     89   
        let content_length = payload.len();
   60     90   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   61     91   
            builder,
   62     92   
            ::http::header::CONTENT_LENGTH,
   63     93   
            content_length,
   64     94   
        );
          95  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   65     96   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   66     98   
        builder.body(body)?
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   67    100   
    })
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   68    102   
}
   69    103   
         104  +
/* RustType.kt:516 */
   70    105   
#[allow(clippy::unnecessary_wraps)]
         106  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   71    107   
pub fn ser_query_params_targeting_map_of_list_of_enum_string_operation_http_error(
   72    108   
    error: &crate::error::QueryParamsTargetingMapOfListOfEnumStringOperationError,
   73    109   
) -> std::result::Result<
   74    110   
    ::aws_smithy_http_server::response::Response,
   75    111   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   76    112   
> {
         113  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   77    114   
    Ok({
         115  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   78    116   
        match error {
   79         -
            crate::error::QueryParamsTargetingMapOfListOfEnumStringOperationError::ValidationException(output) => {
   80         -
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   81         -
                #[allow(unused_mut)]
   82         -
                let mut builder = ::http::Response::builder();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         117  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfListOfEnumStringOperationError::ValidationException(output) => {
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         119  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84    122   
                                builder,
   85    123   
                                ::http::header::CONTENT_TYPE,
   86    124   
                                "application/json",
   87    125   
                            );
   88         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   89    127   
                                builder,
   90    128   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
   91    129   
                                "ValidationException",
   92    130   
                            );
   93         -
                let content_length = payload.len();
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
   94    132   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
   95         -
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   96         -
            }
   97         -
            crate::error::QueryParamsTargetingMapOfListOfEnumStringOperationError::InternalServerError(output) => {
   98         -
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   99         -
                #[allow(unused_mut)]
  100         -
                let mut builder = ::http::Response::builder();
  101         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
         134  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         135  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfListOfEnumStringOperationError::InternalServerError(output) => {
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         137  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  102    140   
                                builder,
  103    141   
                                ::http::header::CONTENT_TYPE,
  104    142   
                                "application/json",
  105    143   
                            );
  106         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         144  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  107    145   
                                builder,
  108    146   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
  109    147   
                                "InternalServerError",
  110    148   
                            );
  111         -
                let content_length = payload.len();
         149  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
  112    150   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
  113         -
                builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
  114         -
            }
  115         -
        }
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
         152  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         153  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */}
         154  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  116    155   
    })
         156  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  117    157   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_list_of_enum_string_operation_output.rs

@@ -1,1 +33,57 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_query_params_targeting_map_of_list_of_enum_string_operation_output_output_output(
    3      4   
    value: &crate::output::QueryParamsTargetingMapOfListOfEnumStringOperationOutput,
    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_query_params_targeting_map_of_list_of_enum_string_operation_output::ser_query_params_targeting_map_of_list_of_enum_string_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_query_params_targeting_map_of_list_of_enum_string_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::QueryParamsTargetingMapOfListOfEnumStringOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.map_of_list_of_enum_string {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("mapOfListOfEnumString").start_object();
          28  +
        /* JsonSerializerGenerator.kt:537 */
   19     29   
        for (key_3, value_4) in var_1 {
          30  +
            /* SerializerUtil.kt:42 */
   20     31   
            {
          32  +
                /* JsonSerializerGenerator.kt:484 */
   21     33   
                let mut array_5 = object_2.key(key_3.as_str()).start_array();
          34  +
                /* JsonSerializerGenerator.kt:524 */
   22     35   
                for item_6 in value_4 {
          36  +
                    /* SerializerUtil.kt:42 */
   23     37   
                    {
          38  +
                        /* JsonSerializerGenerator.kt:423 */
   24     39   
                        array_5.value().string(item_6.as_str());
          40  +
                        /* SerializerUtil.kt:42 */
   25     41   
                    }
          42  +
                    /* JsonSerializerGenerator.kt:524 */
   26     43   
                }
          44  +
                /* JsonSerializerGenerator.kt:486 */
   27     45   
                array_5.finish();
          46  +
                /* SerializerUtil.kt:42 */
   28     47   
            }
          48  +
            /* JsonSerializerGenerator.kt:537 */
   29     49   
        }
          50  +
        /* JsonSerializerGenerator.kt:515 */
   30     51   
        object_2.finish();
          52  +
        /* JsonSerializerGenerator.kt:382 */
   31     53   
    }
          54  +
    /* JsonSerializerGenerator.kt:372 */
   32     55   
    Ok(())
          56  +
    /* JsonSerializerGenerator.kt:358 */
   33     57   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_list_of_length_pattern_string_operation.rs

@@ -1,1 +119,159 @@
    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_query_params_targeting_map_of_list_of_length_pattern_string_operation_http_request<
    4      6   
    B,
    5      7   
>(
    6      8   
    #[allow(unused_variables)] request: ::http::Request<B>,
    7      9   
) -> std::result::Result<
    8     10   
    crate::input::QueryParamsTargetingMapOfListOfLengthPatternStringOperationInput,
    9     11   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   10     12   
>
   11     13   
where
   12     14   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   13     15   
    B::Data: Send,
   14     16   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   15     17   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   16     18   
{
          19  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   17     20   
    Ok({
          21  +
        /* RustType.kt:516 */
   18     22   
        #[allow(unused_mut)]
   19         -
        let mut input = crate::input::query_params_targeting_map_of_list_of_length_pattern_string_operation_input_internal::Builder::default();
          23  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */let mut input = crate::input::query_params_targeting_map_of_list_of_length_pattern_string_operation_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   20     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   21     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   22     28   
            uri, headers, body, ..
   23     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:1073 */
   24     31   
        let query_string = uri.query().unwrap_or("");
   25     32   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */
   26     34   
        let mut query_params: crate::unconstrained::map_of_list_of_length_pattern_string_unconstrained::MapOfListOfLengthPatternStringUnconstrained =
   27         -
            crate::unconstrained::map_of_list_of_length_pattern_string_unconstrained::MapOfListOfLengthPatternStringUnconstrained(
   28         -
                ::std::collections::HashMap::new()
   29         -
            )
   30         -
        ;
          35  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */crate::unconstrained::map_of_list_of_length_pattern_string_unconstrained::MapOfListOfLengthPatternStringUnconstrained(
          36  +
                /* ServerHttpBoundProtocolGenerator.kt:1090 */::std::collections::HashMap::new()
          37  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */)
          38  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */;
          39  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   31     40   
        for (k, v) in pairs {
          41  +
            /* ServerHttpBoundProtocolGenerator.kt:1187 */
   32     42   
            let entry = query_params.0.entry(String::from(k)).or_insert_with(|| crate::unconstrained::list_of_length_pattern_string_unconstrained::ListOfLengthPatternStringUnconstrained(std::vec::Vec::new()));
   33     43   
            entry.0.push(String::from(v));
          44  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   34     45   
        }
   35         -
        input = input.set_map_of_length_pattern_string(Some(query_params));
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:1213 */
          47  +
        input = input.set_map_of_length_pattern_string(
          48  +
            /* ServerHttpBoundProtocolGenerator.kt:1214 */
          49  +
            Some(
          50  +
                /* ServerHttpBoundProtocolGenerator.kt:1215 */
          51  +
                query_params, /* ServerHttpBoundProtocolGenerator.kt:1214 */
          52  +
            ), /* ServerHttpBoundProtocolGenerator.kt:1213 */
          53  +
        );
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   36     55   
        input.build()?
          56  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   37     57   
    })
          58  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   38     59   
}
   39     60   
          61  +
/* RustType.kt:516 */
   40     62   
#[allow(clippy::unnecessary_wraps)]
          63  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   41     64   
pub fn ser_query_params_targeting_map_of_list_of_length_pattern_string_operation_http_response(
   42     65   
    #[allow(unused_variables)]
   43     66   
    output: crate::output::QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput,
   44     67   
) -> std::result::Result<
   45     68   
    ::aws_smithy_http_server::response::Response,
   46     69   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   47     70   
> {
          71  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   48     72   
    Ok({
          73  +
        /* RustType.kt:516 */
   49     74   
        #[allow(unused_mut)]
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   50     76   
        let mut builder = ::http::Response::builder();
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   51     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   52     79   
            builder,
   53     80   
            ::http::header::CONTENT_TYPE,
   54     81   
            "application/json",
   55     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   56     84   
        let http_status: u16 = 200;
   57     85   
        builder = builder.status(http_status);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   58     87   
        let payload =
   59         -
            crate::protocol_serde::shape_query_params_targeting_map_of_list_of_length_pattern_string_operation_output::ser_query_params_targeting_map_of_list_of_length_pattern_string_operation_output_output_output(&output)?
   60         -
        ;
          88  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_query_params_targeting_map_of_list_of_length_pattern_string_operation_output::ser_query_params_targeting_map_of_list_of_length_pattern_string_operation_output_output_output(&output)?
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   61     91   
        let content_length = payload.len();
   62     92   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   63     93   
            builder,
   64     94   
            ::http::header::CONTENT_LENGTH,
   65     95   
            content_length,
   66     96   
        );
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   67     98   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   68    100   
        builder.body(body)?
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   69    102   
    })
         103  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   70    104   
}
   71    105   
         106  +
/* RustType.kt:516 */
   72    107   
#[allow(clippy::unnecessary_wraps)]
         108  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   73    109   
pub fn ser_query_params_targeting_map_of_list_of_length_pattern_string_operation_http_error(
   74    110   
    error: &crate::error::QueryParamsTargetingMapOfListOfLengthPatternStringOperationError,
   75    111   
) -> std::result::Result<
   76    112   
    ::aws_smithy_http_server::response::Response,
   77    113   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78    114   
> {
         115  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   79    116   
    Ok({
         117  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   80    118   
        match error {
   81         -
            crate::error::QueryParamsTargetingMapOfListOfLengthPatternStringOperationError::ValidationException(output) => {
   82         -
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83         -
                #[allow(unused_mut)]
   84         -
                let mut builder = ::http::Response::builder();
   85         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         119  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfListOfLengthPatternStringOperationError::ValidationException(output) => {
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         121  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86    124   
                                builder,
   87    125   
                                ::http::header::CONTENT_TYPE,
   88    126   
                                "application/json",
   89    127   
                            );
   90         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    129   
                                builder,
   92    130   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
   93    131   
                                "ValidationException",
   94    132   
                            );
   95         -
                let content_length = payload.len();
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
   96    134   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
   97         -
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   98         -
            }
   99         -
            crate::error::QueryParamsTargetingMapOfListOfLengthPatternStringOperationError::InternalServerError(output) => {
  100         -
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  101         -
                #[allow(unused_mut)]
  102         -
                let mut builder = ::http::Response::builder();
  103         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
         136  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         137  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfListOfLengthPatternStringOperationError::InternalServerError(output) => {
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         139  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         141  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  104    142   
                                builder,
  105    143   
                                ::http::header::CONTENT_TYPE,
  106    144   
                                "application/json",
  107    145   
                            );
  108         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  109    147   
                                builder,
  110    148   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
  111    149   
                                "InternalServerError",
  112    150   
                            );
  113         -
                let content_length = payload.len();
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
  114    152   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
  115         -
                builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
  116         -
            }
  117         -
        }
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
         154  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         155  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */}
         156  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  118    157   
    })
         158  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  119    159   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_list_of_length_pattern_string_operation_output.rs

@@ -1,1 +33,57 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_query_params_targeting_map_of_list_of_length_pattern_string_operation_output_output_output(
    3      4   
    value: &crate::output::QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput,
    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_query_params_targeting_map_of_list_of_length_pattern_string_operation_output::ser_query_params_targeting_map_of_list_of_length_pattern_string_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_query_params_targeting_map_of_list_of_length_pattern_string_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::QueryParamsTargetingMapOfListOfLengthPatternStringOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.map_of_length_pattern_string {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("mapOfLengthPatternString").start_object();
          28  +
        /* JsonSerializerGenerator.kt:537 */
   19     29   
        for (key_3, value_4) in var_1 {
          30  +
            /* SerializerUtil.kt:42 */
   20     31   
            {
          32  +
                /* JsonSerializerGenerator.kt:484 */
   21     33   
                let mut array_5 = object_2.key(key_3.as_str()).start_array();
          34  +
                /* JsonSerializerGenerator.kt:524 */
   22     35   
                for item_6 in value_4 {
          36  +
                    /* SerializerUtil.kt:42 */
   23     37   
                    {
          38  +
                        /* JsonSerializerGenerator.kt:423 */
   24     39   
                        array_5.value().string(item_6.as_str());
          40  +
                        /* SerializerUtil.kt:42 */
   25     41   
                    }
          42  +
                    /* JsonSerializerGenerator.kt:524 */
   26     43   
                }
          44  +
                /* JsonSerializerGenerator.kt:486 */
   27     45   
                array_5.finish();
          46  +
                /* SerializerUtil.kt:42 */
   28     47   
            }
          48  +
            /* JsonSerializerGenerator.kt:537 */
   29     49   
        }
          50  +
        /* JsonSerializerGenerator.kt:515 */
   30     51   
        object_2.finish();
          52  +
        /* JsonSerializerGenerator.kt:382 */
   31     53   
    }
          54  +
    /* JsonSerializerGenerator.kt:372 */
   32     55   
    Ok(())
          56  +
    /* JsonSerializerGenerator.kt:358 */
   33     57   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_list_of_length_string_operation.rs

@@ -1,1 +117,157 @@
    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_query_params_targeting_map_of_list_of_length_string_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::QueryParamsTargetingMapOfListOfLengthStringOperationInput,
    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)]
   17         -
        let mut input = crate::input::query_params_targeting_map_of_list_of_length_string_operation_input_internal::Builder::default();
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */let mut input = crate::input::query_params_targeting_map_of_list_of_length_string_operation_input_internal::Builder::default();
          22  +
        /* RustType.kt:516 */
   18     23   
        #[allow(unused_variables)]
          24  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     25   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     26   
            uri, headers, body, ..
   21     27   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          28  +
        /* ServerHttpBoundProtocolGenerator.kt:1073 */
   22     29   
        let query_string = uri.query().unwrap_or("");
   23     30   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */
   24     32   
        let mut query_params: crate::unconstrained::map_of_list_of_length_string_unconstrained::MapOfListOfLengthStringUnconstrained =
   25         -
            crate::unconstrained::map_of_list_of_length_string_unconstrained::MapOfListOfLengthStringUnconstrained(
   26         -
                ::std::collections::HashMap::new()
   27         -
            )
   28         -
        ;
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */crate::unconstrained::map_of_list_of_length_string_unconstrained::MapOfListOfLengthStringUnconstrained(
          34  +
                /* ServerHttpBoundProtocolGenerator.kt:1090 */::std::collections::HashMap::new()
          35  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */)
          36  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */;
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   29     38   
        for (k, v) in pairs {
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:1187 */
   30     40   
            let entry = query_params.0.entry(String::from(k)).or_insert_with(|| crate::unconstrained::list_of_length_string_unconstrained::ListOfLengthStringUnconstrained(std::vec::Vec::new()));
   31     41   
            entry.0.push(String::from(v));
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   32     43   
        }
   33         -
        input = input.set_map_of_list_of_length_string(Some(query_params));
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:1213 */
          45  +
        input = input.set_map_of_list_of_length_string(
          46  +
            /* ServerHttpBoundProtocolGenerator.kt:1214 */
          47  +
            Some(
          48  +
                /* ServerHttpBoundProtocolGenerator.kt:1215 */
          49  +
                query_params, /* ServerHttpBoundProtocolGenerator.kt:1214 */
          50  +
            ), /* ServerHttpBoundProtocolGenerator.kt:1213 */
          51  +
        );
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   34     53   
        input.build()?
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   35     55   
    })
          56  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   36     57   
}
   37     58   
          59  +
/* RustType.kt:516 */
   38     60   
#[allow(clippy::unnecessary_wraps)]
          61  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   39     62   
pub fn ser_query_params_targeting_map_of_list_of_length_string_operation_http_response(
   40     63   
    #[allow(unused_variables)]
   41     64   
    output: crate::output::QueryParamsTargetingMapOfListOfLengthStringOperationOutput,
   42     65   
) -> std::result::Result<
   43     66   
    ::aws_smithy_http_server::response::Response,
   44     67   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   45     68   
> {
          69  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   46     70   
    Ok({
          71  +
        /* RustType.kt:516 */
   47     72   
        #[allow(unused_mut)]
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   48     74   
        let mut builder = ::http::Response::builder();
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   49     76   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     77   
            builder,
   51     78   
            ::http::header::CONTENT_TYPE,
   52     79   
            "application/json",
   53     80   
        );
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   54     82   
        let http_status: u16 = 200;
   55     83   
        builder = builder.status(http_status);
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   56     85   
        let payload =
   57         -
            crate::protocol_serde::shape_query_params_targeting_map_of_list_of_length_string_operation_output::ser_query_params_targeting_map_of_list_of_length_string_operation_output_output_output(&output)?
   58         -
        ;
          86  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_query_params_targeting_map_of_list_of_length_string_operation_output::ser_query_params_targeting_map_of_list_of_length_string_operation_output_output_output(&output)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   59     89   
        let content_length = payload.len();
   60     90   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   61     91   
            builder,
   62     92   
            ::http::header::CONTENT_LENGTH,
   63     93   
            content_length,
   64     94   
        );
          95  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   65     96   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   66     98   
        builder.body(body)?
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   67    100   
    })
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   68    102   
}
   69    103   
         104  +
/* RustType.kt:516 */
   70    105   
#[allow(clippy::unnecessary_wraps)]
         106  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   71    107   
pub fn ser_query_params_targeting_map_of_list_of_length_string_operation_http_error(
   72    108   
    error: &crate::error::QueryParamsTargetingMapOfListOfLengthStringOperationError,
   73    109   
) -> std::result::Result<
   74    110   
    ::aws_smithy_http_server::response::Response,
   75    111   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   76    112   
> {
         113  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   77    114   
    Ok({
         115  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   78    116   
        match error {
   79         -
            crate::error::QueryParamsTargetingMapOfListOfLengthStringOperationError::ValidationException(output) => {
   80         -
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   81         -
                #[allow(unused_mut)]
   82         -
                let mut builder = ::http::Response::builder();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         117  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfListOfLengthStringOperationError::ValidationException(output) => {
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         119  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84    122   
                                builder,
   85    123   
                                ::http::header::CONTENT_TYPE,
   86    124   
                                "application/json",
   87    125   
                            );
   88         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   89    127   
                                builder,
   90    128   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
   91    129   
                                "ValidationException",
   92    130   
                            );
   93         -
                let content_length = payload.len();
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
   94    132   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
   95         -
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   96         -
            }
   97         -
            crate::error::QueryParamsTargetingMapOfListOfLengthStringOperationError::InternalServerError(output) => {
   98         -
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   99         -
                #[allow(unused_mut)]
  100         -
                let mut builder = ::http::Response::builder();
  101         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
         134  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         135  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfListOfLengthStringOperationError::InternalServerError(output) => {
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         137  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  102    140   
                                builder,
  103    141   
                                ::http::header::CONTENT_TYPE,
  104    142   
                                "application/json",
  105    143   
                            );
  106         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         144  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  107    145   
                                builder,
  108    146   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
  109    147   
                                "InternalServerError",
  110    148   
                            );
  111         -
                let content_length = payload.len();
         149  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
  112    150   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
  113         -
                builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
  114         -
            }
  115         -
        }
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
         152  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         153  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */}
         154  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  116    155   
    })
         156  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  117    157   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_list_of_length_string_operation_output.rs

@@ -1,1 +33,57 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_query_params_targeting_map_of_list_of_length_string_operation_output_output_output(
    3      4   
    value: &crate::output::QueryParamsTargetingMapOfListOfLengthStringOperationOutput,
    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_query_params_targeting_map_of_list_of_length_string_operation_output::ser_query_params_targeting_map_of_list_of_length_string_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_query_params_targeting_map_of_list_of_length_string_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::QueryParamsTargetingMapOfListOfLengthStringOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.map_of_list_of_length_string {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("mapOfListOfLengthString").start_object();
          28  +
        /* JsonSerializerGenerator.kt:537 */
   19     29   
        for (key_3, value_4) in var_1 {
          30  +
            /* SerializerUtil.kt:42 */
   20     31   
            {
          32  +
                /* JsonSerializerGenerator.kt:484 */
   21     33   
                let mut array_5 = object_2.key(key_3.as_str()).start_array();
          34  +
                /* JsonSerializerGenerator.kt:524 */
   22     35   
                for item_6 in value_4 {
          36  +
                    /* SerializerUtil.kt:42 */
   23     37   
                    {
          38  +
                        /* JsonSerializerGenerator.kt:423 */
   24     39   
                        array_5.value().string(item_6.as_str());
          40  +
                        /* SerializerUtil.kt:42 */
   25     41   
                    }
          42  +
                    /* JsonSerializerGenerator.kt:524 */
   26     43   
                }
          44  +
                /* JsonSerializerGenerator.kt:486 */
   27     45   
                array_5.finish();
          46  +
                /* SerializerUtil.kt:42 */
   28     47   
            }
          48  +
            /* JsonSerializerGenerator.kt:537 */
   29     49   
        }
          50  +
        /* JsonSerializerGenerator.kt:515 */
   30     51   
        object_2.finish();
          52  +
        /* JsonSerializerGenerator.kt:382 */
   31     53   
    }
          54  +
    /* JsonSerializerGenerator.kt:372 */
   32     55   
    Ok(())
          56  +
    /* JsonSerializerGenerator.kt:358 */
   33     57   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_list_of_pattern_string_operation.rs

@@ -1,1 +117,157 @@
    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_query_params_targeting_map_of_list_of_pattern_string_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::QueryParamsTargetingMapOfListOfPatternStringOperationInput,
    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)]
   17         -
        let mut input = crate::input::query_params_targeting_map_of_list_of_pattern_string_operation_input_internal::Builder::default();
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */let mut input = crate::input::query_params_targeting_map_of_list_of_pattern_string_operation_input_internal::Builder::default();
          22  +
        /* RustType.kt:516 */
   18     23   
        #[allow(unused_variables)]
          24  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     25   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     26   
            uri, headers, body, ..
   21     27   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          28  +
        /* ServerHttpBoundProtocolGenerator.kt:1073 */
   22     29   
        let query_string = uri.query().unwrap_or("");
   23     30   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */
   24     32   
        let mut query_params: crate::unconstrained::map_of_list_of_pattern_string_unconstrained::MapOfListOfPatternStringUnconstrained =
   25         -
            crate::unconstrained::map_of_list_of_pattern_string_unconstrained::MapOfListOfPatternStringUnconstrained(
   26         -
                ::std::collections::HashMap::new()
   27         -
            )
   28         -
        ;
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */crate::unconstrained::map_of_list_of_pattern_string_unconstrained::MapOfListOfPatternStringUnconstrained(
          34  +
                /* ServerHttpBoundProtocolGenerator.kt:1090 */::std::collections::HashMap::new()
          35  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */)
          36  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */;
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   29     38   
        for (k, v) in pairs {
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:1187 */
   30     40   
            let entry = query_params.0.entry(String::from(k)).or_insert_with(|| crate::unconstrained::list_of_pattern_string_unconstrained::ListOfPatternStringUnconstrained(std::vec::Vec::new()));
   31     41   
            entry.0.push(String::from(v));
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   32     43   
        }
   33         -
        input = input.set_map_of_list_of_pattern_string(Some(query_params));
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:1213 */
          45  +
        input = input.set_map_of_list_of_pattern_string(
          46  +
            /* ServerHttpBoundProtocolGenerator.kt:1214 */
          47  +
            Some(
          48  +
                /* ServerHttpBoundProtocolGenerator.kt:1215 */
          49  +
                query_params, /* ServerHttpBoundProtocolGenerator.kt:1214 */
          50  +
            ), /* ServerHttpBoundProtocolGenerator.kt:1213 */
          51  +
        );
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   34     53   
        input.build()?
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   35     55   
    })
          56  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   36     57   
}
   37     58   
          59  +
/* RustType.kt:516 */
   38     60   
#[allow(clippy::unnecessary_wraps)]
          61  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   39     62   
pub fn ser_query_params_targeting_map_of_list_of_pattern_string_operation_http_response(
   40     63   
    #[allow(unused_variables)]
   41     64   
    output: crate::output::QueryParamsTargetingMapOfListOfPatternStringOperationOutput,
   42     65   
) -> std::result::Result<
   43     66   
    ::aws_smithy_http_server::response::Response,
   44     67   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   45     68   
> {
          69  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   46     70   
    Ok({
          71  +
        /* RustType.kt:516 */
   47     72   
        #[allow(unused_mut)]
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   48     74   
        let mut builder = ::http::Response::builder();
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   49     76   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     77   
            builder,
   51     78   
            ::http::header::CONTENT_TYPE,
   52     79   
            "application/json",
   53     80   
        );
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   54     82   
        let http_status: u16 = 200;
   55     83   
        builder = builder.status(http_status);
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   56     85   
        let payload =
   57         -
            crate::protocol_serde::shape_query_params_targeting_map_of_list_of_pattern_string_operation_output::ser_query_params_targeting_map_of_list_of_pattern_string_operation_output_output_output(&output)?
   58         -
        ;
          86  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_query_params_targeting_map_of_list_of_pattern_string_operation_output::ser_query_params_targeting_map_of_list_of_pattern_string_operation_output_output_output(&output)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   59     89   
        let content_length = payload.len();
   60     90   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   61     91   
            builder,
   62     92   
            ::http::header::CONTENT_LENGTH,
   63     93   
            content_length,
   64     94   
        );
          95  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   65     96   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   66     98   
        builder.body(body)?
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   67    100   
    })
         101  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   68    102   
}
   69    103   
         104  +
/* RustType.kt:516 */
   70    105   
#[allow(clippy::unnecessary_wraps)]
         106  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   71    107   
pub fn ser_query_params_targeting_map_of_list_of_pattern_string_operation_http_error(
   72    108   
    error: &crate::error::QueryParamsTargetingMapOfListOfPatternStringOperationError,
   73    109   
) -> std::result::Result<
   74    110   
    ::aws_smithy_http_server::response::Response,
   75    111   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   76    112   
> {
         113  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   77    114   
    Ok({
         115  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   78    116   
        match error {
   79         -
            crate::error::QueryParamsTargetingMapOfListOfPatternStringOperationError::ValidationException(output) => {
   80         -
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   81         -
                #[allow(unused_mut)]
   82         -
                let mut builder = ::http::Response::builder();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         117  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfListOfPatternStringOperationError::ValidationException(output) => {
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         119  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84    122   
                                builder,
   85    123   
                                ::http::header::CONTENT_TYPE,
   86    124   
                                "application/json",
   87    125   
                            );
   88         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   89    127   
                                builder,
   90    128   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
   91    129   
                                "ValidationException",
   92    130   
                            );
   93         -
                let content_length = payload.len();
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
   94    132   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
   95         -
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   96         -
            }
   97         -
            crate::error::QueryParamsTargetingMapOfListOfPatternStringOperationError::InternalServerError(output) => {
   98         -
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   99         -
                #[allow(unused_mut)]
  100         -
                let mut builder = ::http::Response::builder();
  101         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
         134  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         135  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfListOfPatternStringOperationError::InternalServerError(output) => {
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         137  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  102    140   
                                builder,
  103    141   
                                ::http::header::CONTENT_TYPE,
  104    142   
                                "application/json",
  105    143   
                            );
  106         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         144  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  107    145   
                                builder,
  108    146   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
  109    147   
                                "InternalServerError",
  110    148   
                            );
  111         -
                let content_length = payload.len();
         149  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
  112    150   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
  113         -
                builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
  114         -
            }
  115         -
        }
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
         152  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         153  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */}
         154  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  116    155   
    })
         156  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  117    157   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_list_of_pattern_string_operation_output.rs

@@ -1,1 +33,57 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_query_params_targeting_map_of_list_of_pattern_string_operation_output_output_output(
    3      4   
    value: &crate::output::QueryParamsTargetingMapOfListOfPatternStringOperationOutput,
    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_query_params_targeting_map_of_list_of_pattern_string_operation_output::ser_query_params_targeting_map_of_list_of_pattern_string_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_query_params_targeting_map_of_list_of_pattern_string_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::QueryParamsTargetingMapOfListOfPatternStringOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.map_of_list_of_pattern_string {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("mapOfListOfPatternString").start_object();
          28  +
        /* JsonSerializerGenerator.kt:537 */
   19     29   
        for (key_3, value_4) in var_1 {
          30  +
            /* SerializerUtil.kt:42 */
   20     31   
            {
          32  +
                /* JsonSerializerGenerator.kt:484 */
   21     33   
                let mut array_5 = object_2.key(key_3.as_str()).start_array();
          34  +
                /* JsonSerializerGenerator.kt:524 */
   22     35   
                for item_6 in value_4 {
          36  +
                    /* SerializerUtil.kt:42 */
   23     37   
                    {
          38  +
                        /* JsonSerializerGenerator.kt:423 */
   24     39   
                        array_5.value().string(item_6.as_str());
          40  +
                        /* SerializerUtil.kt:42 */
   25     41   
                    }
          42  +
                    /* JsonSerializerGenerator.kt:524 */
   26     43   
                }
          44  +
                /* JsonSerializerGenerator.kt:486 */
   27     45   
                array_5.finish();
          46  +
                /* SerializerUtil.kt:42 */
   28     47   
            }
          48  +
            /* JsonSerializerGenerator.kt:537 */
   29     49   
        }
          50  +
        /* JsonSerializerGenerator.kt:515 */
   30     51   
        object_2.finish();
          52  +
        /* JsonSerializerGenerator.kt:382 */
   31     53   
    }
          54  +
    /* JsonSerializerGenerator.kt:372 */
   32     55   
    Ok(())
          56  +
    /* JsonSerializerGenerator.kt:358 */
   33     57   
}

tmp-codegen-diff/codegen-server-test-python/constraints/rust-server-codegen-python/src/protocol_serde/shape_query_params_targeting_map_of_pattern_string_operation.rs

@@ -1,1 +119,159 @@
    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_query_params_targeting_map_of_pattern_string_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::QueryParamsTargetingMapOfPatternStringOperationInput,
    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)]
   17         -
        let mut input = crate::input::query_params_targeting_map_of_pattern_string_operation_input_internal::Builder::default();
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */let mut input = crate::input::query_params_targeting_map_of_pattern_string_operation_input_internal::Builder::default();
          22  +
        /* RustType.kt:516 */
   18     23   
        #[allow(unused_variables)]
          24  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     25   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     26   
            uri, headers, body, ..
   21     27   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          28  +
        /* ServerHttpBoundProtocolGenerator.kt:1073 */
   22     29   
        let query_string = uri.query().unwrap_or("");
   23     30   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */
   24     32   
        let mut query_params: crate::unconstrained::map_of_pattern_string_unconstrained::MapOfPatternStringUnconstrained =
   25         -
            crate::unconstrained::map_of_pattern_string_unconstrained::MapOfPatternStringUnconstrained(
   26         -
                ::std::collections::HashMap::new()
   27         -
            )
   28         -
        ;
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */crate::unconstrained::map_of_pattern_string_unconstrained::MapOfPatternStringUnconstrained(
          34  +
                /* ServerHttpBoundProtocolGenerator.kt:1090 */::std::collections::HashMap::new()
          35  +
            /* ServerHttpBoundProtocolGenerator.kt:1089 */)
          36  +
        /* ServerHttpBoundProtocolGenerator.kt:1088 */;
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   29     38   
        for (k, v) in pairs {
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:1180 */
   30     40   
            query_params
   31     41   
                .0
   32     42   
                .entry(String::from(k))
   33     43   
                .or_insert_with(|| String::from(v));
          44  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   34     45   
        }
   35         -
        input = input.set_map_of_pattern_string(Some(query_params));
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:1213 */
          47  +
        input = input.set_map_of_pattern_string(
          48  +
            /* ServerHttpBoundProtocolGenerator.kt:1214 */
          49  +
            Some(
          50  +
                /* ServerHttpBoundProtocolGenerator.kt:1215 */
          51  +
                query_params, /* ServerHttpBoundProtocolGenerator.kt:1214 */
          52  +
            ), /* ServerHttpBoundProtocolGenerator.kt:1213 */
          53  +
        );
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   36     55   
        input.build()?
          56  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   37     57   
    })
          58  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   38     59   
}
   39     60   
          61  +
/* RustType.kt:516 */
   40     62   
#[allow(clippy::unnecessary_wraps)]
          63  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   41     64   
pub fn ser_query_params_targeting_map_of_pattern_string_operation_http_response(
   42     65   
    #[allow(unused_variables)]
   43     66   
    output: crate::output::QueryParamsTargetingMapOfPatternStringOperationOutput,
   44     67   
) -> std::result::Result<
   45     68   
    ::aws_smithy_http_server::response::Response,
   46     69   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   47     70   
> {
          71  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   48     72   
    Ok({
          73  +
        /* RustType.kt:516 */
   49     74   
        #[allow(unused_mut)]
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   50     76   
        let mut builder = ::http::Response::builder();
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   51     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   52     79   
            builder,
   53     80   
            ::http::header::CONTENT_TYPE,
   54     81   
            "application/json",
   55     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   56     84   
        let http_status: u16 = 200;
   57     85   
        builder = builder.status(http_status);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   58     87   
        let payload =
   59         -
            crate::protocol_serde::shape_query_params_targeting_map_of_pattern_string_operation_output::ser_query_params_targeting_map_of_pattern_string_operation_output_output_output(&output)?
   60         -
        ;
          88  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_query_params_targeting_map_of_pattern_string_operation_output::ser_query_params_targeting_map_of_pattern_string_operation_output_output_output(&output)?
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   61     91   
        let content_length = payload.len();
   62     92   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   63     93   
            builder,
   64     94   
            ::http::header::CONTENT_LENGTH,
   65     95   
            content_length,
   66     96   
        );
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   67     98   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   68    100   
        builder.body(body)?
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   69    102   
    })
         103  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   70    104   
}
   71    105   
         106  +
/* RustType.kt:516 */
   72    107   
#[allow(clippy::unnecessary_wraps)]
         108  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   73    109   
pub fn ser_query_params_targeting_map_of_pattern_string_operation_http_error(
   74    110   
    error: &crate::error::QueryParamsTargetingMapOfPatternStringOperationError,
   75    111   
) -> std::result::Result<
   76    112   
    ::aws_smithy_http_server::response::Response,
   77    113   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78    114   
> {
         115  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   79    116   
    Ok({
         117  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   80    118   
        match error {
   81         -
            crate::error::QueryParamsTargetingMapOfPatternStringOperationError::ValidationException(output) => {
   82         -
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83         -
                #[allow(unused_mut)]
   84         -
                let mut builder = ::http::Response::builder();
   85         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         119  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfPatternStringOperationError::ValidationException(output) => {
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         121  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86    124   
                                builder,
   87    125   
                                ::http::header::CONTENT_TYPE,
   88    126   
                                "application/json",
   89    127   
                            );
   90         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    129   
                                builder,
   92    130   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
   93    131   
                                "ValidationException",
   94    132   
                            );
   95         -
                let content_length = payload.len();
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
   96    134   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
   97         -
                builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
   98         -
            }
   99         -
            crate::error::QueryParamsTargetingMapOfPatternStringOperationError::InternalServerError(output) => {
  100         -
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  101         -
                #[allow(unused_mut)]
  102         -
                let mut builder = ::http::Response::builder();
  103         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(400).body(::aws_smithy_http_server::body::to_boxed(payload))?
         136  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         137  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */crate::error::QueryParamsTargetingMapOfPatternStringOperationError::InternalServerError(output) => {
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         139  +
                /* RustType.kt:516 */#[allow(unused_mut)]
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */let mut builder = ::http::Response::builder();
         141  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  104    142   
                                builder,
  105    143   
                                ::http::header::CONTENT_TYPE,
  106    144   
                                "application/json",
  107    145   
                            );
  108         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         146  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */builder = ::aws_smithy_http::header::set_response_header_if_absent(
  109    147   
                                builder,
  110    148   
                                ::http::header::HeaderName::from_static("x-amzn-errortype"),
  111    149   
                                "InternalServerError",
  112    150   
                            );
  113         -
                let content_length = payload.len();
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */let content_length = payload.len();
  114    152   
                            builder = ::aws_smithy_http::header::set_response_header_if_absent(builder, ::http::header::CONTENT_LENGTH, content_length);
  115         -
                builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
  116         -
            }
  117         -
        }
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */builder.status(500).body(::aws_smithy_http_server::body::to_boxed(payload))?
         154  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */}
         155  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */}
         156  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  118    157   
    })
         158  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  119    159   
}