Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_boolean_input.rs

@@ -1,1 +10,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_malformed_boolean_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::malformed_boolean::MalformedBooleanInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.boolean_in_body {
           9  +
        /* JsonSerializerGenerator.kt:424 */
    7     10   
        object.key("booleanInBody").boolean(*var_1);
          11  +
        /* JsonSerializerGenerator.kt:382 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:372 */
    9     14   
    Ok(())
          15  +
    /* JsonSerializerGenerator.kt:358 */
   10     16   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_byte.rs

@@ -1,1 +55,85 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_malformed_byte_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::malformed_byte::MalformedByteOutput, crate::operation::malformed_byte::MalformedByteError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::malformed_byte::MalformedByteError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::malformed_byte::MalformedByteError::generic(generic))
          19  +
    /* ProtocolParserGenerator.kt:99 */
   13     20   
}
   14     21   
          22  +
/* RustType.kt:516 */
   15     23   
#[allow(clippy::unnecessary_wraps)]
          24  +
/* ProtocolParserGenerator.kt:71 */
   16     25   
pub fn de_malformed_byte_http_response(
   17     26   
    _response_status: u16,
   18     27   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19     28   
    _response_body: &[u8],
   20     29   
) -> std::result::Result<crate::operation::malformed_byte::MalformedByteOutput, crate::operation::malformed_byte::MalformedByteError> {
          30  +
    /* ProtocolParserGenerator.kt:77 */
   21     31   
    Ok({
          32  +
        /* RustType.kt:516 */
   22     33   
        #[allow(unused_mut)]
          34  +
        /* ProtocolParserGenerator.kt:240 */
   23     35   
        let mut output = crate::operation::malformed_byte::builders::MalformedByteOutputBuilder::default();
          36  +
        /* ClientBuilderInstantiator.kt:56 */
   24     37   
        output.build()
          38  +
        /* ProtocolParserGenerator.kt:77 */
   25     39   
    })
          40  +
    /* ProtocolParserGenerator.kt:71 */
   26     41   
}
   27     42   
          43  +
/* HttpBindingGenerator.kt:542 */
   28     44   
pub fn ser_malformed_byte_headers(
   29     45   
    input: &crate::operation::malformed_byte::MalformedByteInput,
   30     46   
    mut builder: ::http::request::Builder,
   31     47   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
          48  +
    /* HttpBindingGenerator.kt:592 */
   32     49   
    if let ::std::option::Option::Some(inner_1) = &input.byte_in_header {
          50  +
        /* HttpBindingGenerator.kt:690 */
   33     51   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
          52  +
        /* HttpBindingGenerator.kt:704 */
   34     53   
        let formatted_2 = encoder.encode();
          54  +
        /* HttpBindingGenerator.kt:706 */
   35     55   
        let header_value = formatted_2;
   36     56   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   37     57   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   38     58   
                "byte_in_header",
   39     59   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   40     60   
            )
   41     61   
        })?;
   42     62   
        builder = builder.header("byteInHeader", header_value);
          63  +
        /* HttpBindingGenerator.kt:592 */
   43     64   
    }
          65  +
    /* HttpBindingGenerator.kt:555 */
   44     66   
    Ok(builder)
          67  +
    /* HttpBindingGenerator.kt:542 */
   45     68   
}
   46     69   
          70  +
/* JsonSerializerGenerator.kt:287 */
   47     71   
pub fn ser_malformed_byte_input(
   48     72   
    input: &crate::operation::malformed_byte::MalformedByteInput,
   49     73   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          74  +
    /* JsonSerializerGenerator.kt:291 */
   50     75   
    let mut out = String::new();
          76  +
    /* JsonSerializerGenerator.kt:292 */
   51     77   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          78  +
    /* JsonSerializerGenerator.kt:375 */
   52     79   
    crate::protocol_serde::shape_malformed_byte_input::ser_malformed_byte_input_input(&mut object, input)?;
          80  +
    /* JsonSerializerGenerator.kt:295 */
   53     81   
    object.finish();
          82  +
    /* JsonSerializerGenerator.kt:296 */
   54     83   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          84  +
    /* JsonSerializerGenerator.kt:287 */
   55     85   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_byte_input.rs

@@ -1,1 +13,19 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_malformed_byte_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::malformed_byte::MalformedByteInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.byte_in_body {
           9  +
        /* JsonSerializerGenerator.kt:432 */
    7     10   
        object.key("byteInBody").number(
    8     11   
            #[allow(clippy::useless_conversion)]
    9     12   
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10     13   
        );
          14  +
        /* JsonSerializerGenerator.kt:382 */
   11     15   
    }
          16  +
    /* JsonSerializerGenerator.kt:372 */
   12     17   
    Ok(())
          18  +
    /* JsonSerializerGenerator.kt:358 */
   13     19   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_content_type_with_body.rs

@@ -1,1 +42,64 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_malformed_content_type_with_body_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::malformed_content_type_with_body::MalformedContentTypeWithBodyOutput,
    9     11   
    crate::operation::malformed_content_type_with_body::MalformedContentTypeWithBodyError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::malformed_content_type_with_body::MalformedContentTypeWithBodyError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::malformed_content_type_with_body::MalformedContentTypeWithBodyError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_malformed_content_type_with_body_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::malformed_content_type_with_body::MalformedContentTypeWithBodyOutput,
   25     34   
    crate::operation::malformed_content_type_with_body::MalformedContentTypeWithBodyError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::malformed_content_type_with_body::builders::MalformedContentTypeWithBodyOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}
   33     48   
          49  +
/* JsonSerializerGenerator.kt:287 */
   34     50   
pub fn ser_malformed_content_type_with_body_input(
   35     51   
    input: &crate::operation::malformed_content_type_with_body::MalformedContentTypeWithBodyInput,
   36     52   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          53  +
    /* JsonSerializerGenerator.kt:291 */
   37     54   
    let mut out = String::new();
          55  +
    /* JsonSerializerGenerator.kt:292 */
   38     56   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          57  +
    /* JsonSerializerGenerator.kt:375 */
   39     58   
    crate::protocol_serde::shape_malformed_content_type_with_body_input::ser_malformed_content_type_with_body_input_input(&mut object, input)?;
          59  +
    /* JsonSerializerGenerator.kt:295 */
   40     60   
    object.finish();
          61  +
    /* JsonSerializerGenerator.kt:296 */
   41     62   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          63  +
    /* JsonSerializerGenerator.kt:287 */
   42     64   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_content_type_with_body_input.rs

@@ -1,1 +10,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_malformed_content_type_with_body_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::malformed_content_type_with_body::MalformedContentTypeWithBodyInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.hi {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("hi").string(var_1.as_str());
          11  +
        /* JsonSerializerGenerator.kt:382 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:372 */
    9     14   
    Ok(())
          15  +
    /* JsonSerializerGenerator.kt:358 */
   10     16   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_content_type_with_generic_string.rs

@@ -1,1 +33,48 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_malformed_content_type_with_generic_string_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::malformed_content_type_with_generic_string::MalformedContentTypeWithGenericStringOutput,
    9     11   
    crate::operation::malformed_content_type_with_generic_string::MalformedContentTypeWithGenericStringError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::malformed_content_type_with_generic_string::MalformedContentTypeWithGenericStringError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::malformed_content_type_with_generic_string::MalformedContentTypeWithGenericStringError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_malformed_content_type_with_generic_string_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::malformed_content_type_with_generic_string::MalformedContentTypeWithGenericStringOutput,
   25     34   
    crate::operation::malformed_content_type_with_generic_string::MalformedContentTypeWithGenericStringError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output =
   30     42   
            crate::operation::malformed_content_type_with_generic_string::builders::MalformedContentTypeWithGenericStringOutputBuilder::default();
          43  +
        /* ClientBuilderInstantiator.kt:56 */
   31     44   
        output.build()
          45  +
        /* ProtocolParserGenerator.kt:77 */
   32     46   
    })
          47  +
    /* ProtocolParserGenerator.kt:71 */
   33     48   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_content_type_with_generic_string_input.rs

@@ -1,1 +10,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:311 */
    2      3   
pub fn ser_payload_http_payload(
    3      4   
    payload: ::std::option::Option<::std::string::String>,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
           6  +
    /* HttpBoundProtocolPayloadGenerator.kt:320 */
    5      7   
    let payload = match payload {
    6      8   
        Some(t) => t,
    7         -
        None => return Ok(Vec::new()),
           9  +
        None => {
          10  +
            return Ok(
          11  +
                /* HttpBoundProtocolPayloadGenerator.kt:332 */ Vec::new(), /* HttpBoundProtocolPayloadGenerator.kt:320 */
          12  +
            )
          13  +
        }
    8     14   
    };
    9         -
    Ok(payload.into_bytes())
          15  +
    /* HttpBoundProtocolPayloadGenerator.kt:345 */
          16  +
    Ok(
          17  +
        /* HttpBoundProtocolPayloadGenerator.kt:366 */ payload.into_bytes(), /* HttpBoundProtocolPayloadGenerator.kt:345 */
          18  +
    )
          19  +
    /* HttpBoundProtocolPayloadGenerator.kt:311 */
   10     20   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_content_type_with_payload.rs

@@ -1,1 +32,47 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_malformed_content_type_with_payload_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::malformed_content_type_with_payload::MalformedContentTypeWithPayloadOutput,
    9     11   
    crate::operation::malformed_content_type_with_payload::MalformedContentTypeWithPayloadError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::malformed_content_type_with_payload::MalformedContentTypeWithPayloadError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::malformed_content_type_with_payload::MalformedContentTypeWithPayloadError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_malformed_content_type_with_payload_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::malformed_content_type_with_payload::MalformedContentTypeWithPayloadOutput,
   25     34   
    crate::operation::malformed_content_type_with_payload::MalformedContentTypeWithPayloadError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::malformed_content_type_with_payload::builders::MalformedContentTypeWithPayloadOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_content_type_with_payload_input.rs

@@ -1,1 +10,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:311 */
    2      3   
pub fn ser_payload_http_payload(
    3      4   
    payload: ::std::option::Option<::aws_smithy_types::Blob>,
    4      5   
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
           6  +
    /* HttpBoundProtocolPayloadGenerator.kt:320 */
    5      7   
    let payload = match payload {
    6      8   
        Some(t) => t,
    7         -
        None => return Ok(Vec::new()),
           9  +
        None => {
          10  +
            return Ok(
          11  +
                /* HttpBoundProtocolPayloadGenerator.kt:332 */ Vec::new(), /* HttpBoundProtocolPayloadGenerator.kt:320 */
          12  +
            )
          13  +
        }
    8     14   
    };
    9         -
    Ok(payload.into_inner())
          15  +
    /* HttpBoundProtocolPayloadGenerator.kt:345 */
          16  +
    Ok(
          17  +
        /* HttpBoundProtocolPayloadGenerator.kt:377 */ payload.into_inner(), /* HttpBoundProtocolPayloadGenerator.kt:345 */
          18  +
    )
          19  +
    /* HttpBoundProtocolPayloadGenerator.kt:311 */
   10     20   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_content_type_without_body.rs

@@ -1,1 +32,47 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_malformed_content_type_without_body_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::malformed_content_type_without_body::MalformedContentTypeWithoutBodyOutput,
    9     11   
    crate::operation::malformed_content_type_without_body::MalformedContentTypeWithoutBodyError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::malformed_content_type_without_body::MalformedContentTypeWithoutBodyError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::malformed_content_type_without_body::MalformedContentTypeWithoutBodyError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_malformed_content_type_without_body_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::malformed_content_type_without_body::MalformedContentTypeWithoutBodyOutput,
   25     34   
    crate::operation::malformed_content_type_without_body::MalformedContentTypeWithoutBodyError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::malformed_content_type_without_body::builders::MalformedContentTypeWithoutBodyOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_double.rs

@@ -1,1 +55,85 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_malformed_double_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::malformed_double::MalformedDoubleOutput, crate::operation::malformed_double::MalformedDoubleError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::malformed_double::MalformedDoubleError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::malformed_double::MalformedDoubleError::generic(generic))
          19  +
    /* ProtocolParserGenerator.kt:99 */
   13     20   
}
   14     21   
          22  +
/* RustType.kt:516 */
   15     23   
#[allow(clippy::unnecessary_wraps)]
          24  +
/* ProtocolParserGenerator.kt:71 */
   16     25   
pub fn de_malformed_double_http_response(
   17     26   
    _response_status: u16,
   18     27   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19     28   
    _response_body: &[u8],
   20     29   
) -> std::result::Result<crate::operation::malformed_double::MalformedDoubleOutput, crate::operation::malformed_double::MalformedDoubleError> {
          30  +
    /* ProtocolParserGenerator.kt:77 */
   21     31   
    Ok({
          32  +
        /* RustType.kt:516 */
   22     33   
        #[allow(unused_mut)]
          34  +
        /* ProtocolParserGenerator.kt:240 */
   23     35   
        let mut output = crate::operation::malformed_double::builders::MalformedDoubleOutputBuilder::default();
          36  +
        /* ClientBuilderInstantiator.kt:56 */
   24     37   
        output.build()
          38  +
        /* ProtocolParserGenerator.kt:77 */
   25     39   
    })
          40  +
    /* ProtocolParserGenerator.kt:71 */
   26     41   
}
   27     42   
          43  +
/* HttpBindingGenerator.kt:542 */
   28     44   
pub fn ser_malformed_double_headers(
   29     45   
    input: &crate::operation::malformed_double::MalformedDoubleInput,
   30     46   
    mut builder: ::http::request::Builder,
   31     47   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
          48  +
    /* HttpBindingGenerator.kt:592 */
   32     49   
    if let ::std::option::Option::Some(inner_1) = &input.double_in_header {
          50  +
        /* HttpBindingGenerator.kt:690 */
   33     51   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
          52  +
        /* HttpBindingGenerator.kt:704 */
   34     53   
        let formatted_2 = encoder.encode();
          54  +
        /* HttpBindingGenerator.kt:706 */
   35     55   
        let header_value = formatted_2;
   36     56   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   37     57   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   38     58   
                "double_in_header",
   39     59   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   40     60   
            )
   41     61   
        })?;
   42     62   
        builder = builder.header("doubleInHeader", header_value);
          63  +
        /* HttpBindingGenerator.kt:592 */
   43     64   
    }
          65  +
    /* HttpBindingGenerator.kt:555 */
   44     66   
    Ok(builder)
          67  +
    /* HttpBindingGenerator.kt:542 */
   45     68   
}
   46     69   
          70  +
/* JsonSerializerGenerator.kt:287 */
   47     71   
pub fn ser_malformed_double_input(
   48     72   
    input: &crate::operation::malformed_double::MalformedDoubleInput,
   49     73   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          74  +
    /* JsonSerializerGenerator.kt:291 */
   50     75   
    let mut out = String::new();
          76  +
    /* JsonSerializerGenerator.kt:292 */
   51     77   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          78  +
    /* JsonSerializerGenerator.kt:375 */
   52     79   
    crate::protocol_serde::shape_malformed_double_input::ser_malformed_double_input_input(&mut object, input)?;
          80  +
    /* JsonSerializerGenerator.kt:295 */
   53     81   
    object.finish();
          82  +
    /* JsonSerializerGenerator.kt:296 */
   54     83   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          84  +
    /* JsonSerializerGenerator.kt:287 */
   55     85   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_double_input.rs

@@ -1,1 +13,19 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_malformed_double_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::malformed_double::MalformedDoubleInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.double_in_body {
           9  +
        /* JsonSerializerGenerator.kt:432 */
    7     10   
        object.key("doubleInBody").number(
    8     11   
            #[allow(clippy::useless_conversion)]
    9     12   
            ::aws_smithy_types::Number::Float((*var_1).into()),
   10     13   
        );
          14  +
        /* JsonSerializerGenerator.kt:382 */
   11     15   
    }
          16  +
    /* JsonSerializerGenerator.kt:372 */
   12     17   
    Ok(())
          18  +
    /* JsonSerializerGenerator.kt:358 */
   13     19   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_float.rs

@@ -1,1 +55,85 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_malformed_float_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::malformed_float::MalformedFloatOutput, crate::operation::malformed_float::MalformedFloatError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::malformed_float::MalformedFloatError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::malformed_float::MalformedFloatError::generic(generic))
          19  +
    /* ProtocolParserGenerator.kt:99 */
   13     20   
}
   14     21   
          22  +
/* RustType.kt:516 */
   15     23   
#[allow(clippy::unnecessary_wraps)]
          24  +
/* ProtocolParserGenerator.kt:71 */
   16     25   
pub fn de_malformed_float_http_response(
   17     26   
    _response_status: u16,
   18     27   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19     28   
    _response_body: &[u8],
   20     29   
) -> std::result::Result<crate::operation::malformed_float::MalformedFloatOutput, crate::operation::malformed_float::MalformedFloatError> {
          30  +
    /* ProtocolParserGenerator.kt:77 */
   21     31   
    Ok({
          32  +
        /* RustType.kt:516 */
   22     33   
        #[allow(unused_mut)]
          34  +
        /* ProtocolParserGenerator.kt:240 */
   23     35   
        let mut output = crate::operation::malformed_float::builders::MalformedFloatOutputBuilder::default();
          36  +
        /* ClientBuilderInstantiator.kt:56 */
   24     37   
        output.build()
          38  +
        /* ProtocolParserGenerator.kt:77 */
   25     39   
    })
          40  +
    /* ProtocolParserGenerator.kt:71 */
   26     41   
}
   27     42   
          43  +
/* HttpBindingGenerator.kt:542 */
   28     44   
pub fn ser_malformed_float_headers(
   29     45   
    input: &crate::operation::malformed_float::MalformedFloatInput,
   30     46   
    mut builder: ::http::request::Builder,
   31     47   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
          48  +
    /* HttpBindingGenerator.kt:592 */
   32     49   
    if let ::std::option::Option::Some(inner_1) = &input.float_in_header {
          50  +
        /* HttpBindingGenerator.kt:690 */
   33     51   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
          52  +
        /* HttpBindingGenerator.kt:704 */
   34     53   
        let formatted_2 = encoder.encode();
          54  +
        /* HttpBindingGenerator.kt:706 */
   35     55   
        let header_value = formatted_2;
   36     56   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   37     57   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   38     58   
                "float_in_header",
   39     59   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   40     60   
            )
   41     61   
        })?;
   42     62   
        builder = builder.header("floatInHeader", header_value);
          63  +
        /* HttpBindingGenerator.kt:592 */
   43     64   
    }
          65  +
    /* HttpBindingGenerator.kt:555 */
   44     66   
    Ok(builder)
          67  +
    /* HttpBindingGenerator.kt:542 */
   45     68   
}
   46     69   
          70  +
/* JsonSerializerGenerator.kt:287 */
   47     71   
pub fn ser_malformed_float_input(
   48     72   
    input: &crate::operation::malformed_float::MalformedFloatInput,
   49     73   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          74  +
    /* JsonSerializerGenerator.kt:291 */
   50     75   
    let mut out = String::new();
          76  +
    /* JsonSerializerGenerator.kt:292 */
   51     77   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          78  +
    /* JsonSerializerGenerator.kt:375 */
   52     79   
    crate::protocol_serde::shape_malformed_float_input::ser_malformed_float_input_input(&mut object, input)?;
          80  +
    /* JsonSerializerGenerator.kt:295 */
   53     81   
    object.finish();
          82  +
    /* JsonSerializerGenerator.kt:296 */
   54     83   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          84  +
    /* JsonSerializerGenerator.kt:287 */
   55     85   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_float_input.rs

@@ -1,1 +13,19 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_malformed_float_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::malformed_float::MalformedFloatInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.float_in_body {
           9  +
        /* JsonSerializerGenerator.kt:432 */
    7     10   
        object.key("floatInBody").number(
    8     11   
            #[allow(clippy::useless_conversion)]
    9     12   
            ::aws_smithy_types::Number::Float((*var_1).into()),
   10     13   
        );
          14  +
        /* JsonSerializerGenerator.kt:382 */
   11     15   
    }
          16  +
    /* JsonSerializerGenerator.kt:372 */
   12     17   
    Ok(())
          18  +
    /* JsonSerializerGenerator.kt:358 */
   13     19   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_integer.rs

@@ -1,1 +55,85 @@
    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  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_malformed_integer_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<crate::operation::malformed_integer::MalformedIntegerOutput, crate::operation::malformed_integer::MalformedIntegerError> {
          10  +
    /* RustType.kt:516 */
    8     11   
    #[allow(unused_mut)]
          12  +
    /* ProtocolParserGenerator.kt:106 */
    9     13   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10     14   
        .map_err(crate::operation::malformed_integer::MalformedIntegerError::unhandled)?;
          15  +
    /* ProtocolParserGenerator.kt:120 */
   11     16   
    let generic = generic_builder.build();
          17  +
    /* ProtocolParserGenerator.kt:185 */
   12     18   
    Err(crate::operation::malformed_integer::MalformedIntegerError::generic(generic))
          19  +
    /* ProtocolParserGenerator.kt:99 */
   13     20   
}
   14     21   
          22  +
/* RustType.kt:516 */
   15     23   
#[allow(clippy::unnecessary_wraps)]
          24  +
/* ProtocolParserGenerator.kt:71 */
   16     25   
pub fn de_malformed_integer_http_response(
   17     26   
    _response_status: u16,
   18     27   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19     28   
    _response_body: &[u8],
   20     29   
) -> std::result::Result<crate::operation::malformed_integer::MalformedIntegerOutput, crate::operation::malformed_integer::MalformedIntegerError> {
          30  +
    /* ProtocolParserGenerator.kt:77 */
   21     31   
    Ok({
          32  +
        /* RustType.kt:516 */
   22     33   
        #[allow(unused_mut)]
          34  +
        /* ProtocolParserGenerator.kt:240 */
   23     35   
        let mut output = crate::operation::malformed_integer::builders::MalformedIntegerOutputBuilder::default();
          36  +
        /* ClientBuilderInstantiator.kt:56 */
   24     37   
        output.build()
          38  +
        /* ProtocolParserGenerator.kt:77 */
   25     39   
    })
          40  +
    /* ProtocolParserGenerator.kt:71 */
   26     41   
}
   27     42   
          43  +
/* HttpBindingGenerator.kt:542 */
   28     44   
pub fn ser_malformed_integer_headers(
   29     45   
    input: &crate::operation::malformed_integer::MalformedIntegerInput,
   30     46   
    mut builder: ::http::request::Builder,
   31     47   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
          48  +
    /* HttpBindingGenerator.kt:592 */
   32     49   
    if let ::std::option::Option::Some(inner_1) = &input.integer_in_header {
          50  +
        /* HttpBindingGenerator.kt:690 */
   33     51   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
          52  +
        /* HttpBindingGenerator.kt:704 */
   34     53   
        let formatted_2 = encoder.encode();
          54  +
        /* HttpBindingGenerator.kt:706 */
   35     55   
        let header_value = formatted_2;
   36     56   
        let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   37     57   
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
   38     58   
                "integer_in_header",
   39     59   
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
   40     60   
            )
   41     61   
        })?;
   42     62   
        builder = builder.header("integerInHeader", header_value);
          63  +
        /* HttpBindingGenerator.kt:592 */
   43     64   
    }
          65  +
    /* HttpBindingGenerator.kt:555 */
   44     66   
    Ok(builder)
          67  +
    /* HttpBindingGenerator.kt:542 */
   45     68   
}
   46     69   
          70  +
/* JsonSerializerGenerator.kt:287 */
   47     71   
pub fn ser_malformed_integer_input(
   48     72   
    input: &crate::operation::malformed_integer::MalformedIntegerInput,
   49     73   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          74  +
    /* JsonSerializerGenerator.kt:291 */
   50     75   
    let mut out = String::new();
          76  +
    /* JsonSerializerGenerator.kt:292 */
   51     77   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          78  +
    /* JsonSerializerGenerator.kt:375 */
   52     79   
    crate::protocol_serde::shape_malformed_integer_input::ser_malformed_integer_input_input(&mut object, input)?;
          80  +
    /* JsonSerializerGenerator.kt:295 */
   53     81   
    object.finish();
          82  +
    /* JsonSerializerGenerator.kt:296 */
   54     83   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          84  +
    /* JsonSerializerGenerator.kt:287 */
   55     85   
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_malformed_integer_input.rs

@@ -1,1 +13,19 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_malformed_integer_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::malformed_integer::MalformedIntegerInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.integer_in_body {
           9  +
        /* JsonSerializerGenerator.kt:432 */
    7     10   
        object.key("integerInBody").number(
    8     11   
            #[allow(clippy::useless_conversion)]
    9     12   
            ::aws_smithy_types::Number::NegInt((*var_1).into()),
   10     13   
        );
          14  +
        /* JsonSerializerGenerator.kt:382 */
   11     15   
    }
          16  +
    /* JsonSerializerGenerator.kt:372 */
   12     17   
    Ok(())
          18  +
    /* JsonSerializerGenerator.kt:358 */
   13     19   
}