Client Test

Client Test

rev. 32b1b3c3761061baed26023be3219639e42d7d12

Files changed:

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

@@ -1,0 +69,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_dialog<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::Dialog>, ::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::DialogBuilder::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         -
                        "language" => {
   19         -
                            builder = builder.set_language(
   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         -
                        "greeting" => {
   26         -
                            builder = builder.set_greeting(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   28         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        "farewell" => {
   33         -
                            builder = builder.set_farewell(crate::protocol_serde::shape_farewell::de_farewell(tokens, _value)?);
   34         -
                        }
   35         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   36         -
                    },
   37         -
                    other => {
   38         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   39         -
                            "expected object key or end object, found: {other:?}"
   40         -
                        )))
   41         -
                    }
   42         -
                }
   43         -
            }
   44         -
            Ok(Some(builder.build()))
   45         -
        }
   46         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   47         -
            "expected start object or null",
   48         -
        )),
   49         -
    }
   50         -
}
   51         -
   52         -
pub fn ser_dialog(
   53         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   54         -
    input: &crate::types::Dialog,
   55         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
   56         -
    if let Some(var_1) = &input.language {
   57         -
        object.key("language").string(var_1.as_str());
   58         -
    }
   59         -
    {
   60         -
        object.key("greeting").string(input.greeting.as_str());
   61         -
    }
   62         -
    if let Some(var_2) = &input.farewell {
   63         -
        #[allow(unused_mut)]
   64         -
        let mut object_3 = object.key("farewell").start_object();
   65         -
        crate::protocol_serde::shape_farewell::ser_farewell(&mut object_3, var_2)?;
   66         -
        object_3.finish();
   67         -
    }
   68         -
    Ok(())
   69         -
}

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

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_dialog_list<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::Dialog>>, ::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::StartArray { .. }) => {
   12         -
            let mut items = Vec::new();
   13         -
            loop {
   14         -
                match tokens.peek() {
   15         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16         -
                        tokens.next().transpose().unwrap();
   17         -
                        break;
   18         -
                    }
   19         -
                    _ => {
   20         -
                        let value = crate::protocol_serde::shape_dialog::de_dialog(tokens, _value)?;
   21         -
                        if let Some(value) = value {
   22         -
                            items.push(value);
   23         -
                        } else {
   24         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   25         -
                                "dense list cannot contain null values",
   26         -
                            ));
   27         -
                        }
   28         -
                    }
   29         -
                }
   30         -
            }
   31         -
            Ok(Some(items))
   32         -
        }
   33         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   34         -
            "expected start array or null",
   35         -
        )),
   36         -
    }
   37         -
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/protocol_serde/shape_dialog_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_dialog_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, crate::types::Dialog>>,
    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 = crate::protocol_serde::shape_dialog::de_dialog(tokens, _value)?;
   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_document.rs

@@ -1,0 +15,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_document_payload(
    3         -
    _value: &[u8],
    4         -
) -> ::std::result::Result<::aws_smithy_types::Document, ::aws_smithy_json::deserialize::error::DeserializeError> {
    5         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(_value).peekable();
    6         -
    let tokens = &mut tokens_owned;
    7         -
    let result = Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?)
    8         -
        .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("expected payload member value"));
    9         -
    if tokens.next().is_some() {
   10         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   11         -
            "found more JSON tokens after completing parsing",
   12         -
        ));
   13         -
    }
   14         -
    result
   15         -
}

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

@@ -1,0 +79,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_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::document_type::DocumentTypeOutput, crate::operation::document_type::DocumentTypeError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::document_type::DocumentTypeError::unhandled)?;
   11         -
    let generic = generic_builder.build();
   12         -
    Err(crate::operation::document_type::DocumentTypeError::generic(generic))
   13         -
}
   14         -
   15         -
#[allow(clippy::unnecessary_wraps)]
   16         -
pub fn de_document_type_http_response(
   17         -
    _response_status: u16,
   18         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   19         -
    _response_body: &[u8],
   20         -
) -> std::result::Result<crate::operation::document_type::DocumentTypeOutput, crate::operation::document_type::DocumentTypeError> {
   21         -
    Ok({
   22         -
        #[allow(unused_mut)]
   23         -
        let mut output = crate::operation::document_type::builders::DocumentTypeOutputBuilder::default();
   24         -
        output = crate::protocol_serde::shape_document_type::de_document_type(_response_body, output)
   25         -
            .map_err(crate::operation::document_type::DocumentTypeError::unhandled)?;
   26         -
        output.build()
   27         -
    })
   28         -
}
   29         -
   30         -
pub fn ser_document_type_input(
   31         -
    input: &crate::operation::document_type::DocumentTypeInput,
   32         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   33         -
    let mut out = String::new();
   34         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   35         -
    crate::protocol_serde::shape_document_type_input::ser_document_type_input_input(&mut object, input)?;
   36         -
    object.finish();
   37         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   38         -
}
   39         -
   40         -
pub(crate) fn de_document_type(
   41         -
    _value: &[u8],
   42         -
    mut builder: crate::operation::document_type::builders::DocumentTypeOutputBuilder,
   43         -
) -> ::std::result::Result<
   44         -
    crate::operation::document_type::builders::DocumentTypeOutputBuilder,
   45         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   46         -
> {
   47         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   48         -
    let tokens = &mut tokens_owned;
   49         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   50         -
    loop {
   51         -
        match tokens.next().transpose()? {
   52         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   53         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   54         -
                "documentValue" => {
   55         -
                    builder = builder.set_document_value(Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?));
   56         -
                }
   57         -
                "stringValue" => {
   58         -
                    builder = builder.set_string_value(
   59         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   60         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   61         -
                            .transpose()?,
   62         -
                    );
   63         -
                }
   64         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   65         -
            },
   66         -
            other => {
   67         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   68         -
                    "expected object key or end object, found: {other:?}"
   69         -
                )))
   70         -
            }
   71         -
        }
   72         -
    }
   73         -
    if tokens.next().is_some() {
   74         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   75         -
            "found more JSON tokens after completing parsing",
   76         -
        ));
   77         -
    }
   78         -
    Ok(builder)
   79         -
}

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

@@ -1,0 +80,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_map_value_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_map_value::DocumentTypeAsMapValueOutput,
    9         -
    crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
   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_map_value::DocumentTypeAsMapValueError::unhandled)?;
   14         -
    let generic = generic_builder.build();
   15         -
    Err(crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError::generic(
   16         -
        generic,
   17         -
    ))
   18         -
}
   19         -
   20         -
#[allow(clippy::unnecessary_wraps)]
   21         -
pub fn de_document_type_as_map_value_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::document_type_as_map_value::DocumentTypeAsMapValueOutput,
   27         -
    crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError,
   28         -
> {
   29         -
    Ok({
   30         -
        #[allow(unused_mut)]
   31         -
        let mut output = crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueOutputBuilder::default();
   32         -
        output = crate::protocol_serde::shape_document_type_as_map_value::de_document_type_as_map_value(_response_body, output)
   33         -
            .map_err(crate::operation::document_type_as_map_value::DocumentTypeAsMapValueError::unhandled)?;
   34         -
        output.build()
   35         -
    })
   36         -
}
   37         -
   38         -
pub fn ser_document_type_as_map_value_input(
   39         -
    input: &crate::operation::document_type_as_map_value::DocumentTypeAsMapValueInput,
   40         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   41         -
    let mut out = String::new();
   42         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   43         -
    crate::protocol_serde::shape_document_type_as_map_value_input::ser_document_type_as_map_value_input_input(&mut object, input)?;
   44         -
    object.finish();
   45         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   46         -
}
   47         -
   48         -
pub(crate) fn de_document_type_as_map_value(
   49         -
    _value: &[u8],
   50         -
    mut builder: crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueOutputBuilder,
   51         -
) -> ::std::result::Result<
   52         -
    crate::operation::document_type_as_map_value::builders::DocumentTypeAsMapValueOutputBuilder,
   53         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   54         -
> {
   55         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   56         -
    let tokens = &mut tokens_owned;
   57         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   58         -
    loop {
   59         -
        match tokens.next().transpose()? {
   60         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   61         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   62         -
                "docValuedMap" => {
   63         -
                    builder = builder.set_doc_valued_map(crate::protocol_serde::shape_document_valued_map::de_document_valued_map(tokens, _value)?);
   64         -
                }
   65         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   66         -
            },
   67         -
            other => {
   68         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   69         -
                    "expected object key or end object, found: {other:?}"
   70         -
                )))
   71         -
            }
   72         -
        }
   73         -
    }
   74         -
    if tokens.next().is_some() {
   75         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   76         -
            "found more JSON tokens after completing parsing",
   77         -
        ));
   78         -
    }
   79         -
    Ok(builder)
   80         -
}

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         -
}