Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_get_bucket_location_input.rs

@@ -1,1 +12,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
    2      3   
pub fn de_bucket(
    3      4   
    value: &str,
    4      5   
) -> std::result::Result<
    5      6   
    ::std::string::String,
    6      7   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
    7      8   
> {
           9  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
    8     10   
    let value = ::percent_encoding::percent_decode_str(value)
    9     11   
        .decode_utf8()?
   10     12   
        .into_owned();
          13  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   11     14   
    Ok(value)
          15  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   12     16   
}

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_get_bucket_location_output.rs

@@ -1,1 +14,27 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_get_bucket_location_output_output(
    3      4   
    input: &crate::output::GetBucketLocationOutput,
    4      5   
    writer: ::aws_smithy_xml::encode::ElWriter,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* RustType.kt:516 */
    6      8   
    #[allow(unused_mut)]
           9  +
    /* XmlBindingTraitSerializerGenerator.kt:299 */
    7     10   
    let mut scope = writer.finish();
          11  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
    8     12   
    if let Some(var_1) = &input.location_constraint {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
    9     14   
        let mut inner_writer = scope.start_el("LocationConstraint").finish();
   10         -
        inner_writer.data(var_1.as_str());
          15  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          16  +
        inner_writer.data(
          17  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
          18  +
            var_1.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          19  +
        );
          20  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   11     21   
    }
          22  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   12     23   
    scope.finish();
          24  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   13     25   
    Ok(())
          26  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   14     27   
}

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_get_object.rs

@@ -1,1 +95,136 @@
    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_get_object_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::GetObjectInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_xml::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_xml::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::get_object_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:986 */
   22     30   
        let input_string = uri.path();
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   23     32   
        let (input_string, (m0, m1)) =
   24     33   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   25     34   
                ::nom::sequence::preceded(
   26     35   
                    ::nom::bytes::complete::tag("/"),
   27     36   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   28     37   
                        ::nom::bytes::complete::take_until("/"),
   29     38   
                        ::nom::combinator::rest,
   30     39   
                    )),
   31     40   
                ),
   32     41   
                ::nom::sequence::preceded(
   33     42   
                    ::nom::bytes::complete::tag("/"),
   34     43   
                    ::nom::combinator::rest::<_, ::nom::error::Error<&str>>,
   35     44   
                ),
   36     45   
            ))(input_string)?;
   37     46   
        debug_assert_eq!("", input_string);
          47  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   38     48   
        input = input.set_bucket(crate::protocol_serde::shape_get_object_input::de_bucket(
   39     49   
            m0,
   40     50   
        )?);
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   41     52   
        input = input.set_key(crate::protocol_serde::shape_get_object_input::de_key(m1)?);
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   42     54   
        input.build()?
          55  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   43     56   
    })
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   44     58   
}
   45     59   
          60  +
/* RustType.kt:516 */
   46     61   
#[allow(clippy::unnecessary_wraps)]
          62  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   47     63   
pub fn ser_get_object_http_response(
   48     64   
    #[allow(unused_variables)] output: crate::output::GetObjectOutput,
   49     65   
) -> std::result::Result<
   50     66   
    ::aws_smithy_http_server::response::Response,
   51     67   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
   52     68   
> {
          69  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   53     70   
    Ok({
          71  +
        /* RustType.kt:516 */
   54     72   
        #[allow(unused_mut)]
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   55     74   
        let mut builder = ::http::Response::builder();
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   56     76   
        let http_status: u16 = 200;
   57     77   
        builder = builder.status(http_status);
   58         -
        let payload = "";
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          79  +
        let payload =
          80  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          81  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          82  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   59     83   
        let content_length = payload.len();
   60     84   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   61     85   
            builder,
   62     86   
            ::http::header::CONTENT_LENGTH,
   63     87   
            content_length,
   64     88   
        );
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   65     90   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   66     92   
        builder.body(body)?
          93  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   67     94   
    })
          95  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   68     96   
}
   69     97   
          98  +
/* RustType.kt:516 */
   70     99   
#[allow(clippy::unnecessary_wraps)]
         100  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   71    101   
pub fn ser_get_object_http_error(
   72    102   
    error: &crate::error::GetObjectError,
   73    103   
) -> std::result::Result<
   74    104   
    ::aws_smithy_http_server::response::Response,
   75    105   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
   76    106   
> {
         107  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   77    108   
    Ok({
         109  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   78    110   
        match error {
         111  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   79    112   
            crate::error::GetObjectError::ValidationException(output) => {
         113  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   80    114   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         115  +
                /* RustType.kt:516 */
   81    116   
                #[allow(unused_mut)]
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   82    118   
                let mut builder = ::http::Response::builder();
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   83    120   
                let content_length = payload.len();
   84    121   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85    122   
                    builder,
   86    123   
                    ::http::header::CONTENT_LENGTH,
   87    124   
                    content_length,
   88    125   
                );
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   89    127   
                builder
   90    128   
                    .status(400)
   91    129   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         130  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         131  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   92    132   
        }
   93         -
        }
         133  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   94    134   
    })
         135  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   95    136   
}

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_get_object_input.rs

@@ -1,1 +24,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
    2      3   
pub fn de_bucket(
    3      4   
    value: &str,
    4      5   
) -> std::result::Result<
    5      6   
    ::std::string::String,
    6      7   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
    7      8   
> {
           9  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
    8     10   
    let value = ::percent_encoding::percent_decode_str(value)
    9     11   
        .decode_utf8()?
   10     12   
        .into_owned();
          13  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   11     14   
    Ok(value)
          15  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   12     16   
}
   13     17   
          18  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   14     19   
pub fn de_key(
   15     20   
    value: &str,
   16     21   
) -> std::result::Result<
   17     22   
    ::std::string::String,
   18     23   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
   19     24   
> {
          25  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
   20     26   
    let value = ::percent_encoding::percent_decode_str(value)
   21     27   
        .decode_utf8()?
   22     28   
        .into_owned();
          29  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   23     30   
    Ok(value)
          31  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   24     32   
}

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_list_objects_v2.rs

@@ -1,1 +198,274 @@
    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_list_objects_v2_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ListObjectsV2Input,
    7      9   
    ::aws_smithy_http_server::protocol::rest_xml::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_xml::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::list_objects_v2_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   22     30   
        if let Some(value) =
   23     31   
            crate::protocol_serde::shape_list_objects_v2_input::de_expected_bucket_owner_header(
   24     32   
                &headers,
   25     33   
            )?
   26     34   
        {
   27     35   
            input = input.set_expected_bucket_owner(Some(value))
   28     36   
        }
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   29     38   
        if let Some(value) =
   30     39   
            crate::protocol_serde::shape_list_objects_v2_input::de_request_payer_header(&headers)?
   31     40   
        {
   32     41   
            input = input.set_request_payer(Some(value))
   33     42   
        }
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:986 */
   34     44   
        let input_string = uri.path();
          45  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   35     46   
        let (input_string, m0) = ::nom::sequence::preceded(
   36     47   
            ::nom::bytes::complete::tag("/"),
   37     48   
            ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   38     49   
                ::nom::bytes::complete::take_until("/"),
   39     50   
                ::nom::combinator::rest,
   40     51   
            )),
   41     52   
        )(input_string)?;
   42     53   
        debug_assert_eq!("", input_string);
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   43     55   
        input =
   44     56   
            input.set_bucket(crate::protocol_serde::shape_list_objects_v2_input::de_bucket(m0)?);
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:1073 */
   45     58   
        let query_string = uri.query().unwrap_or("");
   46     59   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   47     61   
        let mut continuation_token_seen = false;
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   48     63   
        let mut delimiter_seen = false;
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   49     65   
        let mut encoding_type_seen = false;
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   50     67   
        let mut fetch_owner_seen = false;
          68  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   51     69   
        let mut max_keys_seen = false;
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   52     71   
        let mut prefix_seen = false;
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:1099 */
   53     73   
        let mut start_after_seen = false;
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:1105 */
   54     75   
        for (k, v) in pairs {
          76  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   55     77   
            if !continuation_token_seen && k == "continuation-token" {
   56     78   
                input = input.set_continuation_token(
   57     79   
                    crate::protocol_serde::shape_list_objects_v2_input::de_continuation_token(&v)?,
   58     80   
                );
   59     81   
                continuation_token_seen = true;
   60     82   
            }
          83  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   61     84   
            if !delimiter_seen && k == "delimiter" {
   62     85   
                input = input.set_delimiter(
   63     86   
                    crate::protocol_serde::shape_list_objects_v2_input::de_delimiter(&v)?,
   64     87   
                );
   65     88   
                delimiter_seen = true;
   66     89   
            }
          90  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   67     91   
            if !encoding_type_seen && k == "encoding-type" {
   68     92   
                input = input.set_encoding_type(
   69     93   
                    crate::protocol_serde::shape_list_objects_v2_input::de_encoding_type(&v)?,
   70     94   
                );
   71     95   
                encoding_type_seen = true;
   72     96   
            }
          97  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   73     98   
            if !fetch_owner_seen && k == "fetch-owner" {
   74     99   
                input = input.set_fetch_owner(
   75    100   
                    crate::protocol_serde::shape_list_objects_v2_input::de_fetch_owner(&v)?,
   76    101   
                );
   77    102   
                fetch_owner_seen = true;
   78    103   
            }
         104  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   79    105   
            if !max_keys_seen && k == "max-keys" {
   80    106   
                input = input.set_max_keys(
   81    107   
                    crate::protocol_serde::shape_list_objects_v2_input::de_max_keys(&v)?,
   82    108   
                );
   83    109   
                max_keys_seen = true;
   84    110   
            }
         111  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   85    112   
            if !prefix_seen && k == "prefix" {
   86    113   
                input = input
   87    114   
                    .set_prefix(crate::protocol_serde::shape_list_objects_v2_input::de_prefix(&v)?);
   88    115   
                prefix_seen = true;
   89    116   
            }
         117  +
            /* ServerHttpBoundProtocolGenerator.kt:1109 */
   90    118   
            if !start_after_seen && k == "start-after" {
   91    119   
                input = input.set_start_after(
   92    120   
                    crate::protocol_serde::shape_list_objects_v2_input::de_start_after(&v)?,
   93    121   
                );
   94    122   
                start_after_seen = true;
   95    123   
            }
         124  +
            /* ServerHttpBoundProtocolGenerator.kt:1105 */
   96    125   
        }
         126  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   97    127   
        input.build()?
         128  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   98    129   
    })
         130  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   99    131   
}
  100    132   
         133  +
/* RustType.kt:516 */
  101    134   
#[allow(clippy::unnecessary_wraps)]
         135  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
  102    136   
pub fn ser_list_objects_v2_http_response(
  103    137   
    #[allow(unused_variables)] output: crate::output::ListObjectsV2Output,
  104    138   
) -> std::result::Result<
  105    139   
    ::aws_smithy_http_server::response::Response,
  106    140   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
  107    141   
> {
         142  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
  108    143   
    Ok({
         144  +
        /* RustType.kt:516 */
  109    145   
        #[allow(unused_mut)]
         146  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
  110    147   
        let mut builder = ::http::Response::builder();
         148  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
  111    149   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  112    150   
            builder,
  113    151   
            ::http::header::CONTENT_TYPE,
  114    152   
            "application/xml",
  115    153   
        );
         154  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
  116    155   
        let http_status: u16 = 200;
  117    156   
        builder = builder.status(http_status);
         157  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
  118    158   
        let payload =
  119         -
            crate::protocol_serde::shape_list_objects_v2::ser_list_objects_v2_output(&output)?;
         159  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_list_objects_v2::ser_list_objects_v2_output(&output)?
         160  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
         161  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
  120    162   
        let content_length = payload.len();
  121    163   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  122    164   
            builder,
  123    165   
            ::http::header::CONTENT_LENGTH,
  124    166   
            content_length,
  125    167   
        );
         168  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
  126    169   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         170  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
  127    171   
        builder.body(body)?
         172  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
  128    173   
    })
         174  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
  129    175   
}
  130    176   
         177  +
/* RustType.kt:516 */
  131    178   
#[allow(clippy::unnecessary_wraps)]
         179  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
  132    180   
pub fn ser_list_objects_v2_http_error(
  133    181   
    error: &crate::error::ListObjectsV2Error,
  134    182   
) -> std::result::Result<
  135    183   
    ::aws_smithy_http_server::response::Response,
  136    184   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::ResponseRejection,
  137    185   
> {
         186  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
  138    187   
    Ok({
         188  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
  139    189   
        match error {
         190  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  140    191   
            crate::error::ListObjectsV2Error::NoSuchBucket(output) => {
         192  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  141    193   
                let payload =
  142    194   
                    crate::protocol_serde::shape_no_such_bucket::ser_no_such_bucket_error(output)?;
         195  +
                /* RustType.kt:516 */
  143    196   
                #[allow(unused_mut)]
         197  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  144    198   
                let mut builder = ::http::Response::builder();
         199  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  145    200   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  146    201   
                    builder,
  147    202   
                    ::http::header::CONTENT_TYPE,
  148    203   
                    "application/xml",
  149    204   
                );
         205  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  150    206   
                let content_length = payload.len();
  151    207   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  152    208   
                    builder,
  153    209   
                    ::http::header::CONTENT_LENGTH,
  154    210   
                    content_length,
  155    211   
                );
         212  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  156    213   
                builder
  157    214   
                    .status(400)
  158    215   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         216  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  159    217   
            }
         218  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  160    219   
            crate::error::ListObjectsV2Error::ValidationException(output) => {
         220  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  161    221   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         222  +
                /* RustType.kt:516 */
  162    223   
                #[allow(unused_mut)]
         224  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  163    225   
                let mut builder = ::http::Response::builder();
         226  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  164    227   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  165    228   
                    builder,
  166    229   
                    ::http::header::CONTENT_TYPE,
  167    230   
                    "application/xml",
  168    231   
                );
         232  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  169    233   
                let content_length = payload.len();
  170    234   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  171    235   
                    builder,
  172    236   
                    ::http::header::CONTENT_LENGTH,
  173    237   
                    content_length,
  174    238   
                );
         239  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  175    240   
                builder
  176    241   
                    .status(400)
  177    242   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         243  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         244  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  178    245   
        }
  179         -
        }
         246  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  180    247   
    })
         248  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  181    249   
}
  182    250   
         251  +
/* XmlBindingTraitSerializerGenerator.kt:217 */
  183    252   
pub fn ser_list_objects_v2_output(
  184    253   
    output: &crate::output::ListObjectsV2Output,
  185    254   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
         255  +
    /* XmlBindingTraitSerializerGenerator.kt:221 */
  186    256   
    let mut out = String::new();
         257  +
    /* XmlBindingTraitSerializerGenerator.kt:225 */
  187    258   
    {
         259  +
        /* XmlBindingTraitSerializerGenerator.kt:226 */
  188    260   
        let mut writer = ::aws_smithy_xml::encode::XmlWriter::new(&mut out);
  189    261   
        #[allow(unused_mut)]
  190    262   
        let mut root = writer
  191    263   
            .start_el("ListObjectsV2Output")
  192    264   
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
         265  +
        /* XmlBindingTraitSerializerGenerator.kt:440 */
  193    266   
        crate::protocol_serde::shape_list_objects_v2_output::ser_list_objects_v2_output_output(
  194    267   
            output, root,
  195    268   
        )?
         269  +
        /* XmlBindingTraitSerializerGenerator.kt:225 */
  196    270   
    }
         271  +
    /* XmlBindingTraitSerializerGenerator.kt:238 */
  197    272   
    Ok(out)
         273  +
    /* XmlBindingTraitSerializerGenerator.kt:217 */
  198    274   
}

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_list_objects_v2_input.rs

@@ -1,1 +102,142 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:153 */
    2      3   
pub(crate) fn de_expected_bucket_owner_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::option::Option<::std::string::String>,
    6      7   
    ::aws_smithy_http::header::ParseError,
    7      8   
> {
           9  +
    /* HttpBindingGenerator.kt:160 */
    8     10   
    let headers = header_map.get_all("x-amz-expected-bucket-owner");
          11  +
    /* HttpBindingGenerator.kt:375 */
    9     12   
    ::aws_smithy_http::header::one_or_none(headers)
          13  +
    /* HttpBindingGenerator.kt:153 */
   10     14   
}
   11     15   
          16  +
/* HttpBindingGenerator.kt:153 */
   12     17   
pub(crate) fn de_request_payer_header(
   13     18   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   14     19   
) -> ::std::result::Result<
   15     20   
    ::std::option::Option<::std::string::String>,
   16     21   
    ::aws_smithy_http::header::ParseError,
   17     22   
> {
          23  +
    /* HttpBindingGenerator.kt:160 */
   18     24   
    let headers = header_map.get_all("x-amz-request-payer");
          25  +
    /* HttpBindingGenerator.kt:375 */
   19     26   
    ::aws_smithy_http::header::one_or_none(headers)
          27  +
    /* HttpBindingGenerator.kt:153 */
   20     28   
}
   21     29   
          30  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   22     31   
pub fn de_bucket(
   23     32   
    value: &str,
   24     33   
) -> std::result::Result<
   25     34   
    ::std::string::String,
   26     35   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
   27     36   
> {
          37  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
   28     38   
    let value = ::percent_encoding::percent_decode_str(value)
   29     39   
        .decode_utf8()?
   30     40   
        .into_owned();
          41  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   31     42   
    Ok(value)
          43  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   32     44   
}
   33     45   
          46  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   34     47   
pub fn de_continuation_token(
   35     48   
    value: &str,
   36     49   
) -> std::result::Result<
   37     50   
    ::std::option::Option<::std::string::String>,
   38     51   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
   39     52   
> {
          53  +
    /* ServerHttpBoundProtocolGenerator.kt:1309 */
   40     54   
    let value = value.to_owned();
          55  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   41     56   
    Ok(Some(value))
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   42     58   
}
   43     59   
          60  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   44     61   
pub fn de_delimiter(
   45     62   
    value: &str,
   46     63   
) -> std::result::Result<
   47     64   
    ::std::option::Option<::std::string::String>,
   48     65   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
   49     66   
> {
          67  +
    /* ServerHttpBoundProtocolGenerator.kt:1309 */
   50     68   
    let value = value.to_owned();
          69  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   51     70   
    Ok(Some(value))
          71  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   52     72   
}
   53     73   
          74  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   54     75   
pub fn de_encoding_type(
   55     76   
    value: &str,
   56     77   
) -> std::result::Result<
   57     78   
    ::std::option::Option<::std::string::String>,
   58     79   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
   59     80   
> {
          81  +
    /* ServerHttpBoundProtocolGenerator.kt:1309 */
   60     82   
    let value = value.to_owned();
          83  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   61     84   
    Ok(Some(value))
          85  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   62     86   
}
   63     87   
          88  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   64     89   
pub fn de_fetch_owner(
   65     90   
    value: &str,
   66     91   
) -> std::result::Result<
   67     92   
    ::std::option::Option<bool>,
   68     93   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
   69     94   
> {
          95  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   70     96   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
          97  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   71     98   
    Ok(Some(value))
          99  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   72    100   
}
   73    101   
         102  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   74    103   
pub fn de_max_keys(
   75    104   
    value: &str,
   76    105   
) -> std::result::Result<
   77    106   
    ::std::option::Option<i32>,
   78    107   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
   79    108   
> {
         109  +
    /* ServerHttpBoundProtocolGenerator.kt:1347 */
   80    110   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
         111  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   81    112   
    Ok(Some(value))
         113  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   82    114   
}
   83    115   
         116  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   84    117   
pub fn de_prefix(
   85    118   
    value: &str,
   86    119   
) -> std::result::Result<
   87    120   
    ::std::option::Option<::std::string::String>,
   88    121   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
   89    122   
> {
         123  +
    /* ServerHttpBoundProtocolGenerator.kt:1309 */
   90    124   
    let value = value.to_owned();
         125  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   91    126   
    Ok(Some(value))
         127  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   92    128   
}
   93    129   
         130  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
   94    131   
pub fn de_start_after(
   95    132   
    value: &str,
   96    133   
) -> std::result::Result<
   97    134   
    ::std::option::Option<::std::string::String>,
   98    135   
    ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection,
   99    136   
> {
         137  +
    /* ServerHttpBoundProtocolGenerator.kt:1309 */
  100    138   
    let value = value.to_owned();
         139  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
  101    140   
    Ok(Some(value))
         141  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
  102    142   
}

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_list_objects_v2_output.rs

@@ -1,1 +69,158 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_list_objects_v2_output_output(
    3      4   
    input: &crate::output::ListObjectsV2Output,
    4      5   
    writer: ::aws_smithy_xml::encode::ElWriter,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* RustType.kt:516 */
    6      8   
    #[allow(unused_mut)]
           9  +
    /* XmlBindingTraitSerializerGenerator.kt:299 */
    7     10   
    let mut scope = writer.finish();
          11  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
    8     12   
    if let Some(var_1) = &input.common_prefixes {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:500 */
    9     14   
        for list_item_2 in var_1 {
          15  +
            /* SerializerUtil.kt:42 */
   10     16   
            {
          17  +
                /* XmlBindingTraitSerializerGenerator.kt:399 */
   11     18   
                let inner_writer = scope.start_el("CommonPrefixes");
          19  +
                /* XmlBindingTraitSerializerGenerator.kt:440 */
   12     20   
                crate::protocol_serde::shape_common_prefix::ser_common_prefix(
   13     21   
                    list_item_2,
   14     22   
                    inner_writer,
   15     23   
                )?
          24  +
                /* SerializerUtil.kt:42 */
   16     25   
            }
          26  +
            /* XmlBindingTraitSerializerGenerator.kt:500 */
   17     27   
        }
          28  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   18     29   
    }
          30  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   19     31   
    if let Some(var_3) = &input.contents {
          32  +
        /* XmlBindingTraitSerializerGenerator.kt:500 */
   20     33   
        for list_item_4 in var_3 {
          34  +
            /* SerializerUtil.kt:42 */
   21     35   
            {
          36  +
                /* XmlBindingTraitSerializerGenerator.kt:399 */
   22     37   
                let inner_writer = scope.start_el("Contents");
          38  +
                /* XmlBindingTraitSerializerGenerator.kt:440 */
   23     39   
                crate::protocol_serde::shape_object::ser_object(list_item_4, inner_writer)?
          40  +
                /* SerializerUtil.kt:42 */
   24     41   
            }
          42  +
            /* XmlBindingTraitSerializerGenerator.kt:500 */
   25     43   
        }
          44  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   26     45   
    }
          46  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   27     47   
    if let Some(var_5) = &input.continuation_token {
          48  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   28     49   
        let mut inner_writer = scope.start_el("ContinuationToken").finish();
   29         -
        inner_writer.data(var_5.as_str());
   30         -
    }
          50  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          51  +
        inner_writer.data(
          52  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
          53  +
            var_5.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          54  +
        );
          55  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
          56  +
    }
          57  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   31     58   
    if let Some(var_6) = &input.delimiter {
          59  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   32     60   
        let mut inner_writer = scope.start_el("Delimiter").finish();
   33         -
        inner_writer.data(var_6.as_str());
   34         -
    }
          61  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          62  +
        inner_writer.data(
          63  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
          64  +
            var_6.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          65  +
        );
          66  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
          67  +
    }
          68  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   35     69   
    if let Some(var_7) = &input.encoding_type {
          70  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   36     71   
        let mut inner_writer = scope.start_el("EncodingType").finish();
   37         -
        inner_writer.data(var_7.as_str());
   38         -
    }
          72  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          73  +
        inner_writer.data(
          74  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
          75  +
            var_7.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          76  +
        );
          77  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
          78  +
    }
          79  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   39     80   
    if let Some(var_8) = &input.is_truncated {
          81  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   40     82   
        let mut inner_writer = scope.start_el("IsTruncated").finish();
   41         -
        inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*var_8).encode());
          83  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          84  +
        inner_writer.data(
          85  +
            /* XmlBindingTraitSerializerGenerator.kt:325 */::aws_smithy_types::primitive::Encoder::from(*var_8).encode()
          86  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */);
          87  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   42     88   
    }
          89  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   43     90   
    if let Some(var_9) = &input.key_count {
          91  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   44     92   
        let mut inner_writer = scope.start_el("KeyCount").finish();
   45         -
        inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*var_9).encode());
          93  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          94  +
        inner_writer.data(
          95  +
            /* XmlBindingTraitSerializerGenerator.kt:325 */::aws_smithy_types::primitive::Encoder::from(*var_9).encode()
          96  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */);
          97  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   46     98   
    }
          99  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   47    100   
    if let Some(var_10) = &input.max_keys {
         101  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   48    102   
        let mut inner_writer = scope.start_el("MaxKeys").finish();
   49         -
        inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*var_10).encode());
         103  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
         104  +
        inner_writer.data(
         105  +
            /* XmlBindingTraitSerializerGenerator.kt:325 */::aws_smithy_types::primitive::Encoder::from(*var_10).encode()
         106  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */);
         107  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   50    108   
    }
         109  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   51    110   
    if let Some(var_11) = &input.name {
         111  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   52    112   
        let mut inner_writer = scope.start_el("Name").finish();
   53         -
        inner_writer.data(var_11.as_str());
   54         -
    }
         113  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
         114  +
        inner_writer.data(
         115  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
         116  +
            var_11.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         117  +
        );
         118  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
         119  +
    }
         120  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   55    121   
    if let Some(var_12) = &input.next_continuation_token {
         122  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   56    123   
        let mut inner_writer = scope.start_el("NextContinuationToken").finish();
   57         -
        inner_writer.data(var_12.as_str());
   58         -
    }
         124  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
         125  +
        inner_writer.data(
         126  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
         127  +
            var_12.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         128  +
        );
         129  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
         130  +
    }
         131  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   59    132   
    if let Some(var_13) = &input.prefix {
         133  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   60    134   
        let mut inner_writer = scope.start_el("Prefix").finish();
   61         -
        inner_writer.data(var_13.as_str());
   62         -
    }
         135  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
         136  +
        inner_writer.data(
         137  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
         138  +
            var_13.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         139  +
        );
         140  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
         141  +
    }
         142  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   63    143   
    if let Some(var_14) = &input.start_after {
         144  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   64    145   
        let mut inner_writer = scope.start_el("StartAfter").finish();
   65         -
        inner_writer.data(var_14.as_str());
   66         -
    }
         146  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
         147  +
        inner_writer.data(
         148  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
         149  +
            var_14.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
         150  +
        );
         151  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
         152  +
    }
         153  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   67    154   
    scope.finish();
         155  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   68    156   
    Ok(())
         157  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   69    158   
}

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_no_such_bucket.rs

@@ -1,1 +26,41 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:250 */
    2      3   
pub fn ser_no_such_bucket_error(
    3      4   
    error: &crate::error::NoSuchBucket,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* XmlBindingTraitSerializerGenerator.kt:254 */
    5      7   
    let mut out = String::new();
           8  +
    /* XmlBindingTraitSerializerGenerator.kt:258 */
    6      9   
    {
          10  +
        /* XmlBindingTraitSerializerGenerator.kt:259 */
    7     11   
        let mut writer = ::aws_smithy_xml::encode::XmlWriter::new(&mut out);
    8     12   
        #[allow(unused_mut)]
    9     13   
        let mut root = writer
   10     14   
            .start_el("Error")
   11     15   
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
          16  +
        /* XmlBindingTraitSerializerGenerator.kt:440 */
   12     17   
        crate::protocol_serde::shape_no_such_bucket::ser_no_such_bucket(error, root)?
          18  +
        /* XmlBindingTraitSerializerGenerator.kt:258 */
   13     19   
    }
          20  +
    /* XmlBindingTraitSerializerGenerator.kt:273 */
   14     21   
    Ok(out)
          22  +
    /* XmlBindingTraitSerializerGenerator.kt:250 */
   15     23   
}
   16     24   
          25  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
   17     26   
pub fn ser_no_such_bucket(
   18     27   
    input: &crate::error::NoSuchBucket,
   19     28   
    writer: ::aws_smithy_xml::encode::ElWriter,
   20     29   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          30  +
    /* XmlBindingTraitSerializerGenerator.kt:434 */
   21     31   
    let _ = input;
          32  +
    /* RustType.kt:516 */
   22     33   
    #[allow(unused_mut)]
          34  +
    /* XmlBindingTraitSerializerGenerator.kt:299 */
   23     35   
    let mut scope = writer.finish();
          36  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   24     37   
    scope.finish();
          38  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   25     39   
    Ok(())
          40  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   26     41   
}

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_object.rs

@@ -1,1 +38,80 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_object(
    3      4   
    input: &crate::model::Object,
    4      5   
    writer: ::aws_smithy_xml::encode::ElWriter,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* RustType.kt:516 */
    6      8   
    #[allow(unused_mut)]
           9  +
    /* XmlBindingTraitSerializerGenerator.kt:299 */
    7     10   
    let mut scope = writer.finish();
          11  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
    8     12   
    if let Some(var_1) = &input.key {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
    9     14   
        let mut inner_writer = scope.start_el("Key").finish();
   10         -
        inner_writer.data(var_1.as_str());
          15  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          16  +
        inner_writer.data(
          17  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
          18  +
            var_1.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          19  +
        );
          20  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   11     21   
    }
          22  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   12     23   
    if let Some(var_2) = &input.last_modified {
          24  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   13     25   
        let mut inner_writer = scope.start_el("LastModified").finish();
          26  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
   14     27   
        inner_writer.data(
          28  +
            /* XmlBindingTraitSerializerGenerator.kt:340 */
   15     29   
            var_2
   16     30   
                .fmt(::aws_smithy_types::date_time::Format::DateTime)?
   17         -
                .as_ref(),
          31  +
                .as_ref(), /* XmlBindingTraitSerializerGenerator.kt:360 */
   18     32   
        );
          33  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   19     34   
    }
          35  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   20     36   
    if let Some(var_3) = &input.e_tag {
          37  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   21     38   
        let mut inner_writer = scope.start_el("ETag").finish();
   22         -
        inner_writer.data(var_3.as_str());
          39  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          40  +
        inner_writer.data(
          41  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
          42  +
            var_3.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          43  +
        );
          44  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   23     45   
    }
          46  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   24     47   
    if let Some(var_4) = &input.size {
          48  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   25     49   
        let mut inner_writer = scope.start_el("Size").finish();
   26         -
        inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*var_4).encode());
          50  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          51  +
        inner_writer.data(
          52  +
            /* XmlBindingTraitSerializerGenerator.kt:325 */::aws_smithy_types::primitive::Encoder::from(*var_4).encode()
          53  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */);
          54  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   27     55   
    }
          56  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   28     57   
    if let Some(var_5) = &input.storage_class {
          58  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   29     59   
        let mut inner_writer = scope.start_el("StorageClass").finish();
   30         -
        inner_writer.data(var_5.as_str());
          60  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          61  +
        inner_writer.data(
          62  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
          63  +
            var_5.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          64  +
        );
          65  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   31     66   
    }
          67  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   32     68   
    if let Some(var_6) = &input.owner {
          69  +
        /* XmlBindingTraitSerializerGenerator.kt:399 */
   33     70   
        let inner_writer = scope.start_el("Owner");
          71  +
        /* XmlBindingTraitSerializerGenerator.kt:440 */
   34     72   
        crate::protocol_serde::shape_owner::ser_owner(var_6, inner_writer)?
          73  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   35     74   
    }
          75  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   36     76   
    scope.finish();
          77  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   37     78   
    Ok(())
          79  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   38     80   
}

tmp-codegen-diff/codegen-server-test/s3/rust-server-codegen/src/protocol_serde/shape_owner.rs

@@ -1,1 +18,38 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_owner(
    3      4   
    input: &crate::model::Owner,
    4      5   
    writer: ::aws_smithy_xml::encode::ElWriter,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* RustType.kt:516 */
    6      8   
    #[allow(unused_mut)]
           9  +
    /* XmlBindingTraitSerializerGenerator.kt:299 */
    7     10   
    let mut scope = writer.finish();
          11  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
    8     12   
    if let Some(var_1) = &input.display_name {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
    9     14   
        let mut inner_writer = scope.start_el("DisplayName").finish();
   10         -
        inner_writer.data(var_1.as_str());
          15  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          16  +
        inner_writer.data(
          17  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
          18  +
            var_1.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          19  +
        );
          20  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   11     21   
    }
          22  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   12     23   
    if let Some(var_2) = &input.id {
          24  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   13     25   
        let mut inner_writer = scope.start_el("ID").finish();
   14         -
        inner_writer.data(var_2.as_str());
          26  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          27  +
        inner_writer.data(
          28  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
          29  +
            var_2.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          30  +
        );
          31  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   15     32   
    }
          33  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   16     34   
    scope.finish();
          35  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   17     36   
    Ok(())
          37  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   18     38   
}

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

@@ -1,1 +38,68 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:250 */
    2      3   
pub fn ser_validation_exception_error(
    3      4   
    error: &crate::error::ValidationException,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* XmlBindingTraitSerializerGenerator.kt:254 */
    5      7   
    let mut out = String::new();
           8  +
    /* XmlBindingTraitSerializerGenerator.kt:258 */
    6      9   
    {
          10  +
        /* XmlBindingTraitSerializerGenerator.kt:259 */
    7     11   
        let mut writer = ::aws_smithy_xml::encode::XmlWriter::new(&mut out);
    8     12   
        #[allow(unused_mut)]
    9     13   
        let mut root = writer
   10     14   
            .start_el("Error")
   11     15   
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
          16  +
        /* XmlBindingTraitSerializerGenerator.kt:440 */
   12     17   
        crate::protocol_serde::shape_validation_exception::ser_validation_exception(error, root)?
          18  +
        /* XmlBindingTraitSerializerGenerator.kt:258 */
   13     19   
    }
          20  +
    /* XmlBindingTraitSerializerGenerator.kt:273 */
   14     21   
    Ok(out)
          22  +
    /* XmlBindingTraitSerializerGenerator.kt:250 */
   15     23   
}
   16     24   
          25  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
   17     26   
pub fn ser_validation_exception(
   18     27   
    input: &crate::error::ValidationException,
   19     28   
    writer: ::aws_smithy_xml::encode::ElWriter,
   20     29   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          30  +
    /* RustType.kt:516 */
   21     31   
    #[allow(unused_mut)]
          32  +
    /* XmlBindingTraitSerializerGenerator.kt:299 */
   22     33   
    let mut scope = writer.finish();
          34  +
    /* XmlBindingTraitSerializerGenerator.kt:555 */
   23     35   
    if let Some(var_1) = &input.field_list {
          36  +
        /* XmlBindingTraitSerializerGenerator.kt:369 */
   24     37   
        let mut inner_writer = scope.start_el("fieldList").finish();
          38  +
        /* XmlBindingTraitSerializerGenerator.kt:489 */
   25     39   
        for list_item_2 in var_1 {
          40  +
            /* SerializerUtil.kt:42 */
   26     41   
            {
          42  +
                /* XmlBindingTraitSerializerGenerator.kt:399 */
   27     43   
                let inner_writer = inner_writer.start_el("member");
          44  +
                /* XmlBindingTraitSerializerGenerator.kt:440 */
   28     45   
                crate::protocol_serde::shape_validation_exception_field::ser_validation_exception_field(list_item_2, inner_writer)?
          46  +
                /* SerializerUtil.kt:42 */
   29     47   
            }
          48  +
            /* XmlBindingTraitSerializerGenerator.kt:489 */
   30     49   
        }
          50  +
        /* XmlBindingTraitSerializerGenerator.kt:555 */
   31     51   
    }
          52  +
    /* SerializerUtil.kt:42 */
   32     53   
    {
          54  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   33     55   
        let mut inner_writer = scope.start_el("message").finish();
   34         -
        inner_writer.data(input.message.as_str());
          56  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          57  +
        inner_writer.data(
          58  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
          59  +
            input.message.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          60  +
        );
          61  +
        /* SerializerUtil.kt:42 */
   35     62   
    }
          63  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   36     64   
    scope.finish();
          65  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   37     66   
    Ok(())
          67  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   38     68   
}

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

@@ -1,1 +18,38 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* XmlBindingTraitSerializerGenerator.kt:427 */
    2      3   
pub fn ser_validation_exception_field(
    3      4   
    input: &crate::model::ValidationExceptionField,
    4      5   
    writer: ::aws_smithy_xml::encode::ElWriter,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* RustType.kt:516 */
    6      8   
    #[allow(unused_mut)]
           9  +
    /* XmlBindingTraitSerializerGenerator.kt:299 */
    7     10   
    let mut scope = writer.finish();
          11  +
    /* SerializerUtil.kt:42 */
    8     12   
    {
          13  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
    9     14   
        let mut inner_writer = scope.start_el("path").finish();
   10         -
        inner_writer.data(input.path.as_str());
          15  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          16  +
        inner_writer.data(
          17  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
          18  +
            input.path.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          19  +
        );
          20  +
        /* SerializerUtil.kt:42 */
   11     21   
    }
          22  +
    /* SerializerUtil.kt:42 */
   12     23   
    {
          24  +
        /* XmlBindingTraitSerializerGenerator.kt:359 */
   13     25   
        let mut inner_writer = scope.start_el("message").finish();
   14         -
        inner_writer.data(input.message.as_str());
          26  +
        /* XmlBindingTraitSerializerGenerator.kt:360 */
          27  +
        inner_writer.data(
          28  +
            /* XmlBindingTraitSerializerGenerator.kt:321 */
          29  +
            input.message.as_str(), /* XmlBindingTraitSerializerGenerator.kt:360 */
          30  +
        );
          31  +
        /* SerializerUtil.kt:42 */
   15     32   
    }
          33  +
    /* XmlBindingTraitSerializerGenerator.kt:304 */
   16     34   
    scope.finish();
          35  +
    /* XmlBindingTraitSerializerGenerator.kt:437 */
   17     36   
    Ok(())
          37  +
    /* XmlBindingTraitSerializerGenerator.kt:427 */
   18     38   
}

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

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerServiceGenerator.kt:795 */
    2      3   
/// The service builder for [`AmazonS3`].
    3      4   
///
    4      5   
/// Constructed via [`AmazonS3::builder`].
    5      6   
pub struct AmazonS3Builder<Body, L, HttpPl, ModelPl> {
    6      7   
    delete_object_tagging: Option<::aws_smithy_http_server::routing::Route<Body>>,
    7      8   
    get_bucket_location: Option<::aws_smithy_http_server::routing::Route<Body>>,
    8      9   
    get_object: Option<::aws_smithy_http_server::routing::Route<Body>>,
    9     10   
    list_objects_v2: Option<::aws_smithy_http_server::routing::Route<Body>>,
   10     11   
    layer: L,
   11     12   
    http_plugin: HttpPl,
@@ -1084,1085 +1143,1145 @@
 1104   1105   
            "com.amazonaws.s3",
 1105   1106   
            "AmazonS3",
 1106   1107   
        );
 1107   1108   
 1108   1109   
    const VERSION: Option<&'static str> = Some("2006-03-01");
 1109   1110   
 1110   1111   
    type Protocol = ::aws_smithy_http_server::protocol::rest_xml::RestXml;
 1111   1112   
 1112   1113   
    type Operations = Operation;
 1113   1114   
}
        1115  +
/* ServiceConfigGenerator.kt:178 */
 1114   1116   
/// Configuration for the [`AmazonS3`]. This is the central place where to register and
 1115   1117   
/// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
 1116   1118   
///
 1117   1119   
/// ```rust,no_run
 1118   1120   
/// # use s3::AmazonS3Config;
 1119   1121   
/// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
 1120   1122   
/// # use ::tower::layer::util::Identity;
 1121   1123   
/// # let authentication_plugin = IdentityPlugin;
 1122   1124   
/// # let authorization_plugin = IdentityPlugin;
 1123   1125   
/// # let server_request_id_provider_layer = Identity::new();
@@ -1199,1201 +1258,1261 @@
 1219   1221   
 1220   1222   
    /// Build the configuration.
 1221   1223   
    pub fn build(self) -> super::AmazonS3Config<L, H, M> {
 1222   1224   
        super::AmazonS3Config {
 1223   1225   
            layers: self.layers,
 1224   1226   
            http_plugins: self.http_plugins,
 1225   1227   
            model_plugins: self.model_plugins,
 1226   1228   
        }
 1227   1229   
    }
 1228   1230   
}
        1231  +
/* ScopeMacroGenerator.kt:81 */
 1229   1232   
/// A macro to help with scoping [plugins](crate::server::plugin) to a subset of all operations.
 1230   1233   
///
 1231   1234   
/// In contrast to [`crate::server::scope`](crate::server::scope), this macro has knowledge
 1232   1235   
/// of the service and any operations _not_ specified will be placed in the opposing group.
 1233   1236   
///
 1234   1237   
/// # Example
 1235   1238   
///
 1236   1239   
/// ```rust
 1237   1240   
/// scope! {
 1238   1241   
///     /// Includes [`DeleteObjectTagging`], excluding all other operations.

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

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

tmp-codegen-diff/codegen-server-test/simple/rust-server-codegen/src/input.rs

@@ -1,1 +62,103 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(
    4      6   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5      7   
)]
    6         -
pub struct OperationInput {
           8  +
pub /* StructureGenerator.kt:201 */ struct OperationInput {
           9  +
    /* StructureGenerator.kt:231 */
    7     10   
    #[allow(missing_docs)] // documentation missing in model
    8     11   
    pub message: ::std::option::Option<::std::string::String>,
          12  +
    /* StructureGenerator.kt:201 */
    9     13   
}
          14  +
/* StructureGenerator.kt:135 */
   10     15   
impl OperationInput {
          16  +
    /* StructureGenerator.kt:231 */
   11     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   12     19   
    pub fn message(&self) -> ::std::option::Option<&str> {
          20  +
        /* StructureGenerator.kt:169 */
   13     21   
        self.message.as_deref()
          22  +
        /* StructureGenerator.kt:166 */
   14     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   15     25   
}
          26  +
/* ServerCodegenVisitor.kt:345 */
   16     27   
impl OperationInput {
   17         -
    /// Creates a new builder-style object to manufacture [`OperationInput`](crate::input::OperationInput).
          28  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`OperationInput`](crate::input::OperationInput).
          29  +
    /* ServerBuilderGenerator.kt:295 */
   18     30   
    pub fn builder() -> crate::input::operation_input::Builder {
          31  +
        /* ServerBuilderGenerator.kt:296 */
   19     32   
        crate::input::operation_input::Builder::default()
          33  +
        /* ServerBuilderGenerator.kt:295 */
   20     34   
    }
          35  +
    /* ServerCodegenVisitor.kt:345 */
   21     36   
}
          37  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
   22     38   
impl crate::constrained::Constrained for crate::input::OperationInput {
   23     39   
    type Unconstrained = crate::input::operation_input::Builder;
   24     40   
}
   25         -
/// See [`OperationInput`](crate::input::OperationInput).
          41  +
/// /* ServerBuilderGenerator.kt:171 */See [`OperationInput`](crate::input::OperationInput).
   26     42   
pub mod operation_input {
   27     43   
          44  +
    /* ServerBuilderGenerator.kt:461 */
   28     45   
    impl ::std::convert::From<Builder> for crate::input::OperationInput {
   29     46   
        fn from(builder: Builder) -> Self {
   30     47   
            builder.build()
   31     48   
        }
   32     49   
    }
   33         -
    /// A builder for [`OperationInput`](crate::input::OperationInput).
          50  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`OperationInput`](crate::input::OperationInput).
          51  +
    /* RustType.kt:516 */
   34     52   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
          53  +
    /* ServerBuilderGenerator.kt:211 */
   35     54   
    pub struct Builder {
          55  +
        /* ServerBuilderGenerator.kt:308 */
   36     56   
        pub(crate) message: ::std::option::Option<::std::string::String>,
          57  +
        /* ServerBuilderGenerator.kt:211 */
   37     58   
    }
          59  +
    /* ServerBuilderGenerator.kt:215 */
   38     60   
    impl Builder {
          61  +
        /* ServerBuilderGenerator.kt:331 */
   39     62   
        #[allow(missing_docs)] // documentation missing in model
          63  +
                               /* ServerBuilderGenerator.kt:343 */
   40     64   
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
   41         -
            self.message = input;
          65  +
            /* ServerBuilderGenerator.kt:344 */
          66  +
            self.message =
          67  +
                /* ServerBuilderGenerator.kt:376 */input
          68  +
            /* ServerBuilderGenerator.kt:344 */;
   42     69   
            self
          70  +
            /* ServerBuilderGenerator.kt:343 */
   43     71   
        }
          72  +
        /* ServerBuilderGenerator.kt:426 */
   44     73   
        #[allow(missing_docs)] // documentation missing in model
          74  +
                               /* ServerBuilderGenerator.kt:428 */
   45     75   
        pub(crate) fn set_message(
   46     76   
            mut self,
   47     77   
            input: Option<impl ::std::convert::Into<::std::string::String>>,
   48     78   
        ) -> Self {
          79  +
            /* ServerBuilderGenerator.kt:429 */
   49     80   
            self.message = input.map(|v| v.into());
   50     81   
            self
          82  +
            /* ServerBuilderGenerator.kt:428 */
   51     83   
        }
   52         -
        /// Consumes the builder and constructs a [`OperationInput`](crate::input::OperationInput).
          84  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`OperationInput`](crate::input::OperationInput).
          85  +
        /* ServerBuilderGenerator.kt:271 */
   53     86   
        pub fn build(self) -> crate::input::OperationInput {
   54     87   
            self.build_enforcing_all_constraints()
   55     88   
        }
          89  +
        /* ServerBuilderGenerator.kt:283 */
   56     90   
        fn build_enforcing_all_constraints(self) -> crate::input::OperationInput {
          91  +
            /* ServerBuilderGenerator.kt:542 */
   57     92   
            crate::input::OperationInput {
          93  +
                /* ServerBuilderGenerator.kt:546 */
   58     94   
                message: self.message,
          95  +
                /* ServerBuilderGenerator.kt:542 */
   59     96   
            }
          97  +
            /* ServerBuilderGenerator.kt:283 */
   60     98   
        }
          99  +
        /* ServerBuilderGenerator.kt:215 */
   61    100   
    }
         101  +
         102  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   62    103   
}

tmp-codegen-diff/codegen-server-test/simple/rust-server-codegen/src/lib.rs

@@ -1,1 +52,53 @@
   13     13   
#![allow(clippy::result_large_err)]
   14     14   
#![allow(clippy::unnecessary_map_on_constructor)]
   15     15   
#![allow(rustdoc::bare_urls)]
   16     16   
#![allow(rustdoc::redundant_explicit_links)]
   17     17   
#![allow(rustdoc::invalid_html_tags)]
   18     18   
#![forbid(unsafe_code)]
   19     19   
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
   20     20   
//! simple
   21     21   
   22     22   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
          23  +
/* ServerRootGenerator.kt:65 */
   23     24   
//! A fast and customizable Rust implementation of the SimpleService Smithy service.
   24     25   
//!
   25     26   
//! # Using SimpleService
   26     27   
//!
   27     28   
//! The primary entrypoint is [`SimpleService`]: it satisfies the [`Service<http::Request, Response = http::Response>`](::tower::Service)
   28     29   
//! trait and therefore can be handed to a [`hyper` server](https://github.com/hyperium/hyper) via [`SimpleService::into_make_service`]
   29     30   
//! or used in AWS Lambda
   30     31   
#![cfg_attr(
   31     32   
    feature = "aws-lambda",
   32     33   
    doc = " via [`LambdaHandler`](crate::server::routing::LambdaHandler)."
@@ -167,168 +240,248 @@
  187    188   
//! }
  188    189   
//!
  189    190   
//! ```
  190    191   
//!
  191    192   
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
  192    193   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  193    194   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  194    195   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  195    196   
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  196    197   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         198  +
/* ServerRootGenerator.kt:261 */
  197    199   
pub use crate::service::{
  198    200   
    MissingOperationsError, SimpleService, SimpleServiceBuilder, SimpleServiceConfig,
  199    201   
    SimpleServiceConfigBuilder,
  200    202   
};
  201    203   
  202         -
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
         204  +
/// /* ServerRustModule.kt:55 */Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  203    205   
pub mod server {
  204    206   
    // Re-export all types from the `aws-smithy-http-server` crate.
  205    207   
    pub use ::aws_smithy_http_server::*;
         208  +
         209  +
    /* CodegenDelegator.kt:200 */
  206    210   
}
  207    211   
         212  +
/* CrateVersionCustomization.kt:23 */
  208    213   
/// Crate version number.
  209    214   
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
  210    215   
  211         -
/// All error types that operations can return. Documentation on these types is copied from the model.
         216  +
/// /* ServerRustModule.kt:55 */All error types that operations can return. Documentation on these types is copied from the model.
  212    217   
pub mod error;
  213    218   
  214         -
/// Input structures for operations. Documentation on these types is copied from the model.
         219  +
/// /* ServerRustModule.kt:55 */Input structures for operations. Documentation on these types is copied from the model.
  215    220   
pub mod input;
  216    221   
  217         -
/// All operations that this crate can perform.
         222  +
/// /* ServerRustModule.kt:55 */All operations that this crate can perform.
  218    223   
pub mod operation;
  219    224   
         225  +
/* ServerRustModule.kt:79 */
  220    226   
/// A collection of types representing each operation defined in the service closure.
  221    227   
///
  222    228   
/// The [plugin system](::aws_smithy_http_server::plugin) makes use of these
  223    229   
/// [zero-sized types](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) (ZSTs) to
  224    230   
/// parameterize [`Plugin`](::aws_smithy_http_server::plugin::Plugin) implementations. Their traits, such as
  225    231   
/// [`OperationShape`](::aws_smithy_http_server::operation::OperationShape), can be used to provide
  226    232   
/// operation specific information to the [`Layer`](::tower::Layer) being applied.
  227    233   
pub mod operation_shape;
  228    234   
  229         -
/// Output structures for operations. Documentation on these types is copied from the model.
         235  +
/// /* ServerRustModule.kt:55 */Output structures for operations. Documentation on these types is copied from the model.
  230    236   
pub mod output;
  231    237   
         238  +
/* RustModule.kt:172 */
  232    239   
mod service;
  233    240   
  234         -
/// Data primitives referenced by other data types.
         241  +
/// /* ServerRustModule.kt:55 */Data primitives referenced by other data types.
  235    242   
pub mod types;
  236    243   
  237         -
/// Constrained types for constrained shapes.
         244  +
/// /* ServerRustModule.kt:55 */Constrained types for constrained shapes.
         245  +
/* RustModule.kt:172 */
  238    246   
mod constrained;
  239    247   
  240    248   
pub(crate) mod protocol_serde;