Client Test

Client Test

rev. ec7b2441254af868911fccffe8d8dca83aff0045 (ignoring whitespace)

Files changed:

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

@@ -1,0 +17,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_document_type_as_map_value_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::document_type_as_map_value::DocumentTypeAsMapValueInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.doc_valued_map {
    7         -
        #[allow(unused_mut)]
    8         -
        let mut object_2 = object.key("docValuedMap").start_object();
    9         -
        for (key_3, value_4) in var_1 {
   10         -
            {
   11         -
                object_2.key(key_3.as_str()).document(value_4);
   12         -
            }
   13         -
        }
   14         -
        object_2.finish();
   15         -
    }
   16         -
    Ok(())
   17         -
}

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

@@ -1,0 +35,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_document_type_as_payload_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::document_type_as_payload::DocumentTypeAsPayloadOutput,
    9         -
    crate::operation::document_type_as_payload::DocumentTypeAsPayloadError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::document_type_as_payload::DocumentTypeAsPayloadError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::document_type_as_payload::DocumentTypeAsPayloadError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_document_type_as_payload_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::document_type_as_payload::DocumentTypeAsPayloadOutput,
   25         -
    crate::operation::document_type_as_payload::DocumentTypeAsPayloadError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::document_type_as_payload::builders::DocumentTypeAsPayloadOutputBuilder::default();
   30         -
        output = output.set_document_value(crate::protocol_serde::shape_document_type_as_payload_output::de_document_value_payload(
   31         -
            _response_body,
   32         -
        )?);
   33         -
        output.build()
   34         -
    })
   35         -
}

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

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_document_value_http_payload(
    3         -
    payload: &::std::option::Option<::aws_smithy_types::Document>,
    4         -
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
    5         -
    let payload = match payload.as_ref() {
    6         -
        Some(t) => t,
    7         -
        None => return Ok(Vec::new()),
    8         -
    };
    9         -
    Ok(crate::protocol_serde::serialize_document(payload))
   10         -
}

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

@@ -1,0 +12,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_document_value_payload(
    3         -
    body: &[u8],
    4         -
) -> std::result::Result<::std::option::Option<::aws_smithy_types::Document>, crate::operation::document_type_as_payload::DocumentTypeAsPayloadError>
    5         -
{
    6         -
    (!body.is_empty())
    7         -
        .then(|| {
    8         -
            crate::protocol_serde::shape_document::de_document_payload(body)
    9         -
                .map_err(crate::operation::document_type_as_payload::DocumentTypeAsPayloadError::unhandled)
   10         -
        })
   11         -
        .transpose()
   12         -
}

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

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_document_type_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::document_type::DocumentTypeInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.document_value {
    7         -
        object.key("documentValue").document(var_1);
    8         -
    }
    9         -
    if let Some(var_2) = &input.string_value {
   10         -
        object.key("stringValue").string(var_2.as_str());
   11         -
    }
   12         -
    Ok(())
   13         -
}

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

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_document_valued_map<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<
    6         -
    Option<::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Document>>,
    7         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
    8         -
>
    9         -
where
   10         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   11         -
{
   12         -
    match tokens.next().transpose()? {
   13         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   14         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   15         -
            let mut map = ::std::collections::HashMap::new();
   16         -
            loop {
   17         -
                match tokens.next().transpose()? {
   18         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   19         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   20         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   21         -
                        let value = Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?);
   22         -
                        match value {
   23         -
                            Some(value) => {
   24         -
                                map.insert(key, value);
   25         -
                            }
   26         -
                            None => {
   27         -
                                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   28         -
                                    "dense map cannot contain null values",
   29         -
                                ))
   30         -
                            }
   31         -
                        }
   32         -
                    }
   33         -
                    other => {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35         -
                            "expected object key or end object, found: {other:?}"
   36         -
                        )))
   37         -
                    }
   38         -
                }
   39         -
            }
   40         -
            Ok(Some(map))
   41         -
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "expected start object or null",
   44         -
        )),
   45         -
    }
   46         -
}

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

@@ -1,1 +56,0 @@
   11     11   
    let _response_headers = response.headers();
   12     12   
    Ok({
   13     13   
        #[allow(unused_mut)]
   14     14   
        let mut output = crate::operation::duplex_stream::builders::DuplexStreamOutputBuilder::default();
   15     15   
        output = output.set_stream(Some(crate::protocol_serde::shape_duplex_stream_output::de_stream_payload(
   16     16   
            _response_body,
   17     17   
        )?));
   18     18   
        output.build().map_err(crate::operation::duplex_stream::DuplexStreamError::unhandled)?
   19     19   
    })
   20     20   
}
   21         -
   22         -
#[allow(clippy::unnecessary_wraps)]
   23         -
pub fn de_duplex_stream_http_error(
   24         -
    _response_status: u16,
   25         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   26         -
    _response_body: &[u8],
   27         -
) -> std::result::Result<crate::operation::duplex_stream::DuplexStreamOutput, crate::operation::duplex_stream::DuplexStreamError> {
   28         -
    #[allow(unused_mut)]
   29         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   30         -
        .map_err(crate::operation::duplex_stream::DuplexStreamError::unhandled)?;
   31         -
    let generic = generic_builder.build();
   32         -
    let error_code = match generic.code() {
   33         -
        Some(code) => code,
   34         -
        None => return Err(crate::operation::duplex_stream::DuplexStreamError::unhandled(generic)),
   35         -
    };
   36         -
   37         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   38         -
    Err(match error_code {
   39         -
        "ErrorEvent" => crate::operation::duplex_stream::DuplexStreamError::ErrorEvent({
   40         -
            #[allow(unused_mut)]
   41         -
            let mut tmp = {
   42         -
                #[allow(unused_mut)]
   43         -
                let mut output = crate::types::error::builders::ErrorEventBuilder::default();
   44         -
                output = crate::protocol_serde::shape_error_event::de_error_event_json_err(_response_body, output)
   45         -
                    .map_err(crate::operation::duplex_stream::DuplexStreamError::unhandled)?;
   46         -
                let output = output.meta(generic);
   47         -
                output.build()
   48         -
            };
   49         -
            if tmp.message.is_none() {
   50         -
                tmp.message = _error_message;
   51         -
            }
   52         -
            tmp
   53         -
        }),
   54         -
        _ => crate::operation::duplex_stream::DuplexStreamError::generic(generic),
   55         -
    })
   56         -
}

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

@@ -1,0 +56,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_duplex_stream_with_distinct_streams_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsOutput,
    9         -
    crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    let error_code = match generic.code() {
   16         -
        Some(code) => code,
   17         -
        None => return Err(crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError::unhandled(generic)),
   18         -
    };
   19         -
   20         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   21         -
    Err(match error_code {
   22         -
        "ErrorEvent" => crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError::ErrorEvent({
   23         -
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::ErrorEventBuilder::default();
   27         -
                output = crate::protocol_serde::shape_error_event::de_error_event_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                output.build()
   31         -
            };
   32         -
            if tmp.message.is_none() {
   33         -
                tmp.message = _error_message;
   34         -
            }
   35         -
            tmp
   36         -
        }),
   37         -
        _ => crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError::generic(generic),
   38         -
    })
   39         -
}
   40         -
   41         -
#[allow(clippy::unnecessary_wraps)]
   42         -
pub fn de_duplex_stream_with_distinct_streams_http_response(
   43         -
    _response_status: u16,
   44         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   45         -
    _response_body: &[u8],
   46         -
) -> std::result::Result<
   47         -
    crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsOutput,
   48         -
    crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError,
   49         -
> {
   50         -
    Ok({
   51         -
        #[allow(unused_mut)]
   52         -
        let mut output = crate::operation::duplex_stream_with_distinct_streams::builders::DuplexStreamWithDistinctStreamsOutputBuilder::default();
   53         -
        output = output.set_stream(crate::protocol_serde::shape_duplex_stream_with_distinct_streams_output::de_stream_payload(_response_body)?);
   54         -
        output.build()
   55         -
    })
   56         -
}

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

@@ -1,0 +14,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_stream_payload(
    3         -
    body: &[u8],
    4         -
) -> std::result::Result<
    5         -
    ::std::option::Option<crate::types::SingletonEventStream>,
    6         -
    crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError,
    7         -
> {
    8         -
    (!body.is_empty())
    9         -
        .then(|| {
   10         -
            crate::protocol_serde::shape_singleton_event_stream::de_singleton_event_stream_payload(body)
   11         -
                .map_err(crate::operation::duplex_stream_with_distinct_streams::DuplexStreamWithDistinctStreamsError::unhandled)
   12         -
        })
   13         -
        .transpose()
   14         -
}

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

@@ -5,5 +108,0 @@
   25     25   
            )?,
   26     26   
        );
   27     27   
        output = output.set_stream(Some(
   28     28   
            crate::protocol_serde::shape_duplex_stream_with_initial_messages_output::de_stream_payload(_response_body)?,
   29     29   
        ));
   30     30   
        crate::serde_util::duplex_stream_with_initial_messages_output_output_correct_errors(output)
   31     31   
            .build()
   32     32   
            .map_err(crate::operation::duplex_stream_with_initial_messages::DuplexStreamWithInitialMessagesError::unhandled)?
   33     33   
    })
   34     34   
}
   35         -
   36         -
#[allow(clippy::unnecessary_wraps)]
   37         -
pub fn de_duplex_stream_with_initial_messages_http_error(
   38         -
    _response_status: u16,
   39         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   40         -
    _response_body: &[u8],
   41         -
) -> std::result::Result<
   42         -
    crate::operation::duplex_stream_with_initial_messages::DuplexStreamWithInitialMessagesOutput,
   43         -
    crate::operation::duplex_stream_with_initial_messages::DuplexStreamWithInitialMessagesError,
   44         -
> {
   45         -
    #[allow(unused_mut)]
   46         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   47         -
        .map_err(crate::operation::duplex_stream_with_initial_messages::DuplexStreamWithInitialMessagesError::unhandled)?;
   48         -
    let generic = generic_builder.build();
   49         -
    let error_code = match generic.code() {
   50         -
        Some(code) => code,
   51         -
        None => return Err(crate::operation::duplex_stream_with_initial_messages::DuplexStreamWithInitialMessagesError::unhandled(generic)),
   52         -
    };
   53         -
   54         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   55         -
    Err(match error_code {
   56         -
        "ServiceUnavailableError" => {
   57         -
            crate::operation::duplex_stream_with_initial_messages::DuplexStreamWithInitialMessagesError::ServiceUnavailableError({
   58         -
                #[allow(unused_mut)]
   59         -
                let mut tmp = {
   60         -
                    #[allow(unused_mut)]
   61         -
                    let mut output = crate::types::error::builders::ServiceUnavailableErrorBuilder::default();
   62         -
                    output = crate::protocol_serde::shape_service_unavailable_error::de_service_unavailable_error_json_err(_response_body, output)
   63         -
                        .map_err(crate::operation::duplex_stream_with_initial_messages::DuplexStreamWithInitialMessagesError::unhandled)?;
   64         -
                    let output = output.meta(generic);
   65         -
                    output.build()
   66         -
                };
   67         -
                if tmp.message.is_none() {
   68         -
                    tmp.message = _error_message;
   69         -
                }
   70         -
                tmp
   71         -
            })
   72         -
        }
   73         -
        "ErrorEvent" => crate::operation::duplex_stream_with_initial_messages::DuplexStreamWithInitialMessagesError::ErrorEvent({
   74         -
            #[allow(unused_mut)]
   75         -
            let mut tmp = {
   76         -
                #[allow(unused_mut)]
   77         -
                let mut output = crate::types::error::builders::ErrorEventBuilder::default();
   78         -
                output = crate::protocol_serde::shape_error_event::de_error_event_json_err(_response_body, output)
   79         -
                    .map_err(crate::operation::duplex_stream_with_initial_messages::DuplexStreamWithInitialMessagesError::unhandled)?;
   80         -
                let output = output.meta(generic);
   81         -
                output.build()
   82         -
            };
   83         -
            if tmp.message.is_none() {
   84         -
                tmp.message = _error_message;
   85         -
            }
   86         -
            tmp
   87         -
        }),
   88         -
        _ => crate::operation::duplex_stream_with_initial_messages::DuplexStreamWithInitialMessagesError::generic(generic),
   89         -
    })
   90         -
}
   91         -
   92         -
pub fn ser_duplex_stream_with_initial_messages_headers(
   93         -
    input: &crate::operation::duplex_stream_with_initial_messages::DuplexStreamWithInitialMessagesInput,
   94         -
    mut builder: ::http_1x::request::Builder,
   95         -
) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
   96         -
    if let ::std::option::Option::Some(inner_1) = &input.initial_request_member {
   97         -
        let formatted_2 = inner_1.as_str();
   98         -
        let header_value = formatted_2;
   99         -
        let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  100         -
            ::aws_smithy_types::error::operation::BuildError::invalid_field(
  101         -
                "initial_request_member",
  102         -
                format!("`{}` cannot be used as a header value: {}", &header_value, err),
  103         -
            )
  104         -
        })?;
  105         -
        builder = builder.header("initial-request-member", header_value);
  106         -
    }
  107         -
    Ok(builder)
  108         -
}

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

@@ -1,0 +34,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_empty_input_and_empty_output_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput,
    9         -
    crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError::generic(
   16         -
        generic,
   17         -
    ))
   18         -
}
   19         -
   20         -
#[allow(clippy::unnecessary_wraps)]
   21         -
pub fn de_empty_input_and_empty_output_http_response(
   22         -
    _response_status: u16,
   23         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   24         -
    _response_body: &[u8],
   25         -
) -> std::result::Result<
   26         -
    crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput,
   27         -
    crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputError,
   28         -
> {
   29         -
    Ok({
   30         -
        #[allow(unused_mut)]
   31         -
        let mut output = crate::operation::empty_input_and_empty_output::builders::EmptyInputAndEmptyOutputOutputBuilder::default();
   32         -
        output.build()
   33         -
    })
   34         -
}

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

@@ -1,0 +28,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_endpoint_operation_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::endpoint_operation::EndpointOperationOutput, crate::operation::endpoint_operation::EndpointOperationError>
    8         -
{
    9         -
    #[allow(unused_mut)]
   10         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11         -
        .map_err(crate::operation::endpoint_operation::EndpointOperationError::unhandled)?;
   12         -
    let generic = generic_builder.build();
   13         -
    Err(crate::operation::endpoint_operation::EndpointOperationError::generic(generic))
   14         -
}
   15         -
   16         -
#[allow(clippy::unnecessary_wraps)]
   17         -
pub fn de_endpoint_operation_http_response(
   18         -
    _response_status: u16,
   19         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   20         -
    _response_body: &[u8],
   21         -
) -> std::result::Result<crate::operation::endpoint_operation::EndpointOperationOutput, crate::operation::endpoint_operation::EndpointOperationError>
   22         -
{
   23         -
    Ok({
   24         -
        #[allow(unused_mut)]
   25         -
        let mut output = crate::operation::endpoint_operation::builders::EndpointOperationOutputBuilder::default();
   26         -
        output.build()
   27         -
    })
   28         -
}

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

@@ -1,0 +42,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_endpoint_with_host_label_operation_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
    9         -
    crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError::generic(generic))
   16         -
}
   17         -
   18         -
#[allow(clippy::unnecessary_wraps)]
   19         -
pub fn de_endpoint_with_host_label_operation_http_response(
   20         -
    _response_status: u16,
   21         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22         -
    _response_body: &[u8],
   23         -
) -> std::result::Result<
   24         -
    crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationOutput,
   25         -
    crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationError,
   26         -
> {
   27         -
    Ok({
   28         -
        #[allow(unused_mut)]
   29         -
        let mut output = crate::operation::endpoint_with_host_label_operation::builders::EndpointWithHostLabelOperationOutputBuilder::default();
   30         -
        output.build()
   31         -
    })
   32         -
}
   33         -
   34         -
pub fn ser_endpoint_with_host_label_operation_input(
   35         -
    input: &crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
   36         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   37         -
    let mut out = String::new();
   38         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   39         -
    crate::protocol_serde::shape_endpoint_with_host_label_operation_input::ser_endpoint_with_host_label_operation_input_input(&mut object, input)?;
   40         -
    object.finish();
   41         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   42         -
}

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

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_endpoint_with_host_label_operation_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::endpoint_with_host_label_operation::EndpointWithHostLabelOperationInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.label {
    7         -
        object.key("label").string(var_1.as_str());
    8         -
    }
    9         -
    Ok(())
   10         -
}

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

@@ -1,1 +55,0 @@
    2      2   
pub fn ser_error_event_error(
    3      3   
    value: &crate::types::error::ErrorEvent,
    4      4   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
    5      5   
    let mut out = ::std::string::String::new();
    6      6   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
    7      7   
    crate::protocol_serde::shape_error_event::ser_error_event(&mut object, value)?;
    8      8   
    object.finish();
    9      9   
    Ok(out)
   10     10   
}
   11     11   
          12  +
pub fn ser_error_event(
          13  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          14  +
    input: &crate::types::error::ErrorEvent,
          15  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          16  +
    if let Some(var_1) = &input.message {
          17  +
        object.key("message").string(var_1.as_str());
          18  +
    }
          19  +
    Ok(())
          20  +
}
          21  +
   12     22   
pub(crate) fn de_error_event_json_err(
   13     23   
    _value: &[u8],
   14     24   
    mut builder: crate::types::error::builders::ErrorEventBuilder,
   15     25   
) -> ::std::result::Result<crate::types::error::builders::ErrorEventBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   16     26   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   17     27   
    let tokens = &mut tokens_owned;
   18     28   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   19     29   
    loop {
   20     30   
        match tokens.next().transpose()? {
   21     31   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   22     32   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   23     33   
                "message" => {
   24     34   
                    builder = builder.set_message(
   25     35   
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   26     36   
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   27     37   
                            .transpose()?,
   28     38   
                    );
   29     39   
                }
   30     40   
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   31     41   
            },
   32     42   
            other => {
   33     43   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   34     44   
                    "expected object key or end object, found: {other:?}"
   35     45   
                )))
   36     46   
            }
   37     47   
        }
   38     48   
    }
   39     49   
    if tokens.next().is_some() {
   40     50   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41     51   
            "found more JSON tokens after completing parsing",
   42     52   
        ));
   43     53   
    }
   44     54   
    Ok(builder)
   45     55   
}
   46         -
   47         -
pub fn ser_error_event(
   48         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   49         -
    input: &crate::types::error::ErrorEvent,
   50         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   51         -
    if let Some(var_1) = &input.message {
   52         -
        object.key("message").string(var_1.as_str());
   53         -
    }
   54         -
    Ok(())
   55         -
}

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

@@ -1,0 +50,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_farewell<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::Farewell>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::FarewellBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "phrase" => {
   19         -
                            builder = builder.set_phrase(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   26         -
                    },
   27         -
                    other => {
   28         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   29         -
                            "expected object key or end object, found: {other:?}"
   30         -
                        )))
   31         -
                    }
   32         -
                }
   33         -
            }
   34         -
            Ok(Some(builder.build()))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start object or null",
   38         -
        )),
   39         -
    }
   40         -
}
   41         -
   42         -
pub fn ser_farewell(
   43         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   44         -
    input: &crate::types::Farewell,
   45         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   46         -
    {
   47         -
        object.key("phrase").string(input.phrase.as_str());
   48         -
    }
   49         -
    Ok(())
   50         -
}