Server Test

Server Test

rev. d06a46cae0f385cdae37a9f8264db3469a090ab5

Files changed:

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_rpc_v2_cbor_sparse_maps_output.rs

@@ -0,1 +0,85 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_rpc_v2_cbor_sparse_maps_output_output_output(
           3  +
    value: &crate::output::RpcV2CborSparseMapsOutput,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::vec::Vec<u8>,
           6  +
    ::aws_smithy_types::error::operation::SerializationError,
           7  +
> {
           8  +
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
           9  +
    {
          10  +
        let encoder = &mut encoder;
          11  +
        crate::protocol_serde::shape_rpc_v2_cbor_sparse_maps_output::ser_rpc_v2_cbor_sparse_maps_output_output(encoder, value )?;
          12  +
    }
          13  +
    ::std::result::Result::Ok(encoder.into_writer())
          14  +
}
          15  +
          16  +
pub fn ser_rpc_v2_cbor_sparse_maps_output_output(
          17  +
    encoder: &mut ::aws_smithy_cbor::Encoder,
          18  +
    #[allow(unused)] input: &crate::output::RpcV2CborSparseMapsOutput,
          19  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          20  +
    encoder.begin_map();
          21  +
    if let Some(var_1) = &input.sparse_struct_map {
          22  +
        encoder.str("sparseStructMap");
          23  +
        encoder.map((*var_1).len());
          24  +
        for (key_2, value_3) in var_1 {
          25  +
            if let Some(var_4) = value_3 {
          26  +
                encoder.str(key_2.as_str());
          27  +
                crate::protocol_serde::shape_greeting_struct::ser_greeting_struct(encoder, var_4)?;
          28  +
            } else {
          29  +
                encoder.str(key_2.as_str()).null();
          30  +
            }
          31  +
        }
          32  +
    }
          33  +
    if let Some(var_5) = &input.sparse_number_map {
          34  +
        encoder.str("sparseNumberMap");
          35  +
        encoder.map((*var_5).len());
          36  +
        for (key_6, value_7) in var_5 {
          37  +
            if let Some(var_8) = value_7 {
          38  +
                encoder.str(key_6.as_str()).integer(*var_8);
          39  +
            } else {
          40  +
                encoder.str(key_6.as_str()).null();
          41  +
            }
          42  +
        }
          43  +
    }
          44  +
    if let Some(var_9) = &input.sparse_boolean_map {
          45  +
        encoder.str("sparseBooleanMap");
          46  +
        encoder.map((*var_9).len());
          47  +
        for (key_10, value_11) in var_9 {
          48  +
            if let Some(var_12) = value_11 {
          49  +
                encoder.str(key_10.as_str()).boolean(*var_12);
          50  +
            } else {
          51  +
                encoder.str(key_10.as_str()).null();
          52  +
            }
          53  +
        }
          54  +
    }
          55  +
    if let Some(var_13) = &input.sparse_string_map {
          56  +
        encoder.str("sparseStringMap");
          57  +
        encoder.map((*var_13).len());
          58  +
        for (key_14, value_15) in var_13 {
          59  +
            if let Some(var_16) = value_15 {
          60  +
                encoder.str(key_14.as_str()).str(var_16.as_str());
          61  +
            } else {
          62  +
                encoder.str(key_14.as_str()).null();
          63  +
            }
          64  +
        }
          65  +
    }
          66  +
    if let Some(var_17) = &input.sparse_set_map {
          67  +
        encoder.str("sparseSetMap");
          68  +
        encoder.map((*var_17).len());
          69  +
        for (key_18, value_19) in var_17 {
          70  +
            if let Some(var_20) = value_19 {
          71  +
                encoder.str(key_18.as_str());
          72  +
                encoder.array((var_20.0).len());
          73  +
                for item_21 in &var_20.0 {
          74  +
                    {
          75  +
                        encoder.str(item_21.as_str());
          76  +
                    }
          77  +
                }
          78  +
            } else {
          79  +
                encoder.str(key_18.as_str()).null();
          80  +
            }
          81  +
        }
          82  +
    }
          83  +
    encoder.end();
          84  +
    Ok(())
          85  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_simple_scalar_properties.rs

@@ -0,1 +0,176 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_simple_scalar_properties_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::SimpleScalarPropertiesInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::simple_scalar_properties_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        let bytes = ::hyper::body::to_bytes(body).await?;
          23  +
        if !bytes.is_empty() {
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          25  +
                &headers,
          26  +
                Some("application/cbor"),
          27  +
            )?;
          28  +
            input =
          29  +
                crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties(
          30  +
                    bytes.as_ref(),
          31  +
                    input,
          32  +
                )?;
          33  +
        }
          34  +
        input.build()
          35  +
    })
          36  +
}
          37  +
          38  +
#[allow(clippy::unnecessary_wraps)]
          39  +
pub fn ser_simple_scalar_properties_http_response(
          40  +
    #[allow(unused_variables)] output: crate::output::SimpleScalarPropertiesOutput,
          41  +
) -> std::result::Result<
          42  +
    ::aws_smithy_legacy_http_server::response::Response,
          43  +
    ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::ResponseRejection,
          44  +
> {
          45  +
    Ok({
          46  +
        #[allow(unused_mut)]
          47  +
        let mut builder = ::http::Response::builder();
          48  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          49  +
            builder,
          50  +
            ::http::header::CONTENT_TYPE,
          51  +
            "application/cbor",
          52  +
        );
          53  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          54  +
            builder,
          55  +
            ::http::header::HeaderName::from_static("smithy-protocol"),
          56  +
            "rpc-v2-cbor",
          57  +
        );
          58  +
        let http_status: u16 = 200;
          59  +
        builder = builder.status(http_status);
          60  +
        let payload =
          61  +
            crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_output_output_output(&output)?
          62  +
        ;
          63  +
        let content_length = payload.len();
          64  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          65  +
            builder,
          66  +
            ::http::header::CONTENT_LENGTH,
          67  +
            content_length,
          68  +
        );
          69  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          70  +
        builder.body(body)?
          71  +
    })
          72  +
}
          73  +
          74  +
pub(crate) fn de_simple_scalar_properties(
          75  +
    value: &[u8],
          76  +
    mut builder: crate::input::simple_scalar_properties_input::Builder,
          77  +
) -> ::std::result::Result<
          78  +
    crate::input::simple_scalar_properties_input::Builder,
          79  +
    ::aws_smithy_cbor::decode::DeserializeError,
          80  +
> {
          81  +
    #[allow(clippy::match_single_binding)]
          82  +
    fn pair(
          83  +
        mut builder: crate::input::simple_scalar_properties_input::Builder,
          84  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          85  +
    ) -> ::std::result::Result<
          86  +
        crate::input::simple_scalar_properties_input::Builder,
          87  +
        ::aws_smithy_cbor::decode::DeserializeError,
          88  +
    > {
          89  +
        builder = match decoder.str()?.as_ref() {
          90  +
            "trueBooleanValue" => {
          91  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          92  +
                    Ok(builder.set_true_boolean_value(Some(decoder.boolean()?)))
          93  +
                })?
          94  +
            }
          95  +
            "falseBooleanValue" => {
          96  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          97  +
                    Ok(builder.set_false_boolean_value(Some(decoder.boolean()?)))
          98  +
                })?
          99  +
            }
         100  +
            "byteValue" => {
         101  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         102  +
                    Ok(builder.set_byte_value(Some(decoder.byte()?)))
         103  +
                })?
         104  +
            }
         105  +
            "doubleValue" => {
         106  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         107  +
                    Ok(builder.set_double_value(Some(decoder.double()?)))
         108  +
                })?
         109  +
            }
         110  +
            "floatValue" => {
         111  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         112  +
                    Ok(builder.set_float_value(Some(decoder.float()?)))
         113  +
                })?
         114  +
            }
         115  +
            "integerValue" => {
         116  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         117  +
                    Ok(builder.set_integer_value(Some(decoder.integer()?)))
         118  +
                })?
         119  +
            }
         120  +
            "longValue" => {
         121  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         122  +
                    Ok(builder.set_long_value(Some(decoder.long()?)))
         123  +
                })?
         124  +
            }
         125  +
            "shortValue" => {
         126  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         127  +
                    Ok(builder.set_short_value(Some(decoder.short()?)))
         128  +
                })?
         129  +
            }
         130  +
            "stringValue" => {
         131  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         132  +
                    Ok(builder.set_string_value(Some(decoder.string()?)))
         133  +
                })?
         134  +
            }
         135  +
            "blobValue" => {
         136  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         137  +
                    Ok(builder.set_blob_value(Some(decoder.blob()?)))
         138  +
                })?
         139  +
            }
         140  +
            _ => {
         141  +
                decoder.skip()?;
         142  +
                builder
         143  +
            }
         144  +
        };
         145  +
        Ok(builder)
         146  +
    }
         147  +
         148  +
    let decoder = &mut ::aws_smithy_cbor::Decoder::new(value);
         149  +
         150  +
    match decoder.map()? {
         151  +
        None => loop {
         152  +
            match decoder.datatype()? {
         153  +
                ::aws_smithy_cbor::data::Type::Break => {
         154  +
                    decoder.skip()?;
         155  +
                    break;
         156  +
                }
         157  +
                _ => {
         158  +
                    builder = pair(builder, decoder)?;
         159  +
                }
         160  +
            };
         161  +
        },
         162  +
        Some(n) => {
         163  +
            for _ in 0..n {
         164  +
                builder = pair(builder, decoder)?;
         165  +
            }
         166  +
        }
         167  +
    };
         168  +
         169  +
    if decoder.position() != value.len() {
         170  +
        return Err(
         171  +
            ::aws_smithy_cbor::decode::DeserializeError::expected_end_of_stream(decoder.position()),
         172  +
        );
         173  +
    }
         174  +
         175  +
    Ok(builder)
         176  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_simple_scalar_properties_output.rs

@@ -0,1 +0,53 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_simple_scalar_properties_output_output_output(
           3  +
    value: &crate::output::SimpleScalarPropertiesOutput,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::vec::Vec<u8>,
           6  +
    ::aws_smithy_types::error::operation::SerializationError,
           7  +
> {
           8  +
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
           9  +
    {
          10  +
        let encoder = &mut encoder;
          11  +
        crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_output_output(encoder, value )?;
          12  +
    }
          13  +
    ::std::result::Result::Ok(encoder.into_writer())
          14  +
}
          15  +
          16  +
pub fn ser_simple_scalar_properties_output_output(
          17  +
    encoder: &mut ::aws_smithy_cbor::Encoder,
          18  +
    #[allow(unused)] input: &crate::output::SimpleScalarPropertiesOutput,
          19  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          20  +
    encoder.begin_map();
          21  +
    if let Some(var_1) = &input.true_boolean_value {
          22  +
        encoder.str("trueBooleanValue").boolean(*var_1);
          23  +
    }
          24  +
    if let Some(var_2) = &input.false_boolean_value {
          25  +
        encoder.str("falseBooleanValue").boolean(*var_2);
          26  +
    }
          27  +
    if let Some(var_3) = &input.byte_value {
          28  +
        encoder.str("byteValue").byte(*var_3);
          29  +
    }
          30  +
    if let Some(var_4) = &input.double_value {
          31  +
        encoder.str("doubleValue").double(*var_4);
          32  +
    }
          33  +
    if let Some(var_5) = &input.float_value {
          34  +
        encoder.str("floatValue").float(*var_5);
          35  +
    }
          36  +
    if let Some(var_6) = &input.integer_value {
          37  +
        encoder.str("integerValue").integer(*var_6);
          38  +
    }
          39  +
    if let Some(var_7) = &input.long_value {
          40  +
        encoder.str("longValue").long(*var_7);
          41  +
    }
          42  +
    if let Some(var_8) = &input.short_value {
          43  +
        encoder.str("shortValue").short(*var_8);
          44  +
    }
          45  +
    if let Some(var_9) = &input.string_value {
          46  +
        encoder.str("stringValue").str(var_9.as_str());
          47  +
    }
          48  +
    if let Some(var_10) = &input.blob_value {
          49  +
        encoder.str("blobValue").blob(var_10);
          50  +
    }
          51  +
    encoder.end();
          52  +
    Ok(())
          53  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_sparse_boolean_map.rs

@@ -0,1 +0,49 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_sparse_boolean_map(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn pair(
           9  +
        mut map: ::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        ::std::collections::HashMap<::std::string::String, ::std::option::Option<bool>>,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let key = decoder.string()?;
          16  +
        let value = match decoder.datatype()? {
          17  +
            ::aws_smithy_cbor::data::Type::Null => {
          18  +
                decoder.null()?;
          19  +
                ::std::option::Option::None
          20  +
            }
          21  +
            _ => Some(decoder.boolean()?),
          22  +
        };
          23  +
        map.insert(key, value);
          24  +
        Ok(map)
          25  +
    }
          26  +
          27  +
    let mut map = ::std::collections::HashMap::new();
          28  +
          29  +
    match decoder.map()? {
          30  +
        None => loop {
          31  +
            match decoder.datatype()? {
          32  +
                ::aws_smithy_cbor::data::Type::Break => {
          33  +
                    decoder.skip()?;
          34  +
                    break;
          35  +
                }
          36  +
                _ => {
          37  +
                    map = pair(map, decoder)?;
          38  +
                }
          39  +
            };
          40  +
        },
          41  +
        Some(n) => {
          42  +
            for _ in 0..n {
          43  +
                map = pair(map, decoder)?;
          44  +
            }
          45  +
        }
          46  +
    };
          47  +
          48  +
    Ok(map)
          49  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_sparse_nulls_operation.rs

@@ -0,1 +0,143 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_sparse_nulls_operation_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::SparseNullsOperationInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::sparse_nulls_operation_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        let bytes = ::hyper::body::to_bytes(body).await?;
          23  +
        if !bytes.is_empty() {
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          25  +
                &headers,
          26  +
                Some("application/cbor"),
          27  +
            )?;
          28  +
            input = crate::protocol_serde::shape_sparse_nulls_operation::de_sparse_nulls_operation(
          29  +
                bytes.as_ref(),
          30  +
                input,
          31  +
            )?;
          32  +
        }
          33  +
        input.build()
          34  +
    })
          35  +
}
          36  +
          37  +
#[allow(clippy::unnecessary_wraps)]
          38  +
pub fn ser_sparse_nulls_operation_http_response(
          39  +
    #[allow(unused_variables)] output: crate::output::SparseNullsOperationOutput,
          40  +
) -> std::result::Result<
          41  +
    ::aws_smithy_legacy_http_server::response::Response,
          42  +
    ::aws_smithy_legacy_http_server::protocol::rpc_v2_cbor::rejection::ResponseRejection,
          43  +
> {
          44  +
    Ok({
          45  +
        #[allow(unused_mut)]
          46  +
        let mut builder = ::http::Response::builder();
          47  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          48  +
            builder,
          49  +
            ::http::header::CONTENT_TYPE,
          50  +
            "application/cbor",
          51  +
        );
          52  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          53  +
            builder,
          54  +
            ::http::header::HeaderName::from_static("smithy-protocol"),
          55  +
            "rpc-v2-cbor",
          56  +
        );
          57  +
        let http_status: u16 = 200;
          58  +
        builder = builder.status(http_status);
          59  +
        let payload =
          60  +
            crate::protocol_serde::shape_sparse_nulls_operation_output::ser_sparse_nulls_operation_output_output_output(&output)?
          61  +
        ;
          62  +
        let content_length = payload.len();
          63  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          64  +
            builder,
          65  +
            ::http::header::CONTENT_LENGTH,
          66  +
            content_length,
          67  +
        );
          68  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          69  +
        builder.body(body)?
          70  +
    })
          71  +
}
          72  +
          73  +
pub(crate) fn de_sparse_nulls_operation(
          74  +
    value: &[u8],
          75  +
    mut builder: crate::input::sparse_nulls_operation_input::Builder,
          76  +
) -> ::std::result::Result<
          77  +
    crate::input::sparse_nulls_operation_input::Builder,
          78  +
    ::aws_smithy_cbor::decode::DeserializeError,
          79  +
> {
          80  +
    #[allow(clippy::match_single_binding)]
          81  +
    fn pair(
          82  +
        mut builder: crate::input::sparse_nulls_operation_input::Builder,
          83  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          84  +
    ) -> ::std::result::Result<
          85  +
        crate::input::sparse_nulls_operation_input::Builder,
          86  +
        ::aws_smithy_cbor::decode::DeserializeError,
          87  +
    > {
          88  +
        builder = match decoder.str()?.as_ref() {
          89  +
            "sparseStringList" => {
          90  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          91  +
                    Ok(builder.set_sparse_string_list(Some(
          92  +
                        crate::protocol_serde::shape_sparse_string_list::de_sparse_string_list(
          93  +
                            decoder,
          94  +
                        )?,
          95  +
                    )))
          96  +
                })?
          97  +
            }
          98  +
            "sparseStringMap" => {
          99  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
         100  +
                    Ok(builder.set_sparse_string_map(Some(
         101  +
                        crate::protocol_serde::shape_sparse_string_map::de_sparse_string_map(
         102  +
                            decoder,
         103  +
                        )?,
         104  +
                    )))
         105  +
                })?
         106  +
            }
         107  +
            _ => {
         108  +
                decoder.skip()?;
         109  +
                builder
         110  +
            }
         111  +
        };
         112  +
        Ok(builder)
         113  +
    }
         114  +
         115  +
    let decoder = &mut ::aws_smithy_cbor::Decoder::new(value);
         116  +
         117  +
    match decoder.map()? {
         118  +
        None => loop {
         119  +
            match decoder.datatype()? {
         120  +
                ::aws_smithy_cbor::data::Type::Break => {
         121  +
                    decoder.skip()?;
         122  +
                    break;
         123  +
                }
         124  +
                _ => {
         125  +
                    builder = pair(builder, decoder)?;
         126  +
                }
         127  +
            };
         128  +
        },
         129  +
        Some(n) => {
         130  +
            for _ in 0..n {
         131  +
                builder = pair(builder, decoder)?;
         132  +
            }
         133  +
        }
         134  +
    };
         135  +
         136  +
    if decoder.position() != value.len() {
         137  +
        return Err(
         138  +
            ::aws_smithy_cbor::decode::DeserializeError::expected_end_of_stream(decoder.position()),
         139  +
        );
         140  +
    }
         141  +
         142  +
    Ok(builder)
         143  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_sparse_nulls_operation_output.rs

@@ -0,1 +0,45 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_sparse_nulls_operation_output_output_output(
           3  +
    value: &crate::output::SparseNullsOperationOutput,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::vec::Vec<u8>,
           6  +
    ::aws_smithy_types::error::operation::SerializationError,
           7  +
> {
           8  +
    let mut encoder = ::aws_smithy_cbor::Encoder::new(::std::vec::Vec::new());
           9  +
    {
          10  +
        let encoder = &mut encoder;
          11  +
        crate::protocol_serde::shape_sparse_nulls_operation_output::ser_sparse_nulls_operation_output_output(encoder, value )?;
          12  +
    }
          13  +
    ::std::result::Result::Ok(encoder.into_writer())
          14  +
}
          15  +
          16  +
pub fn ser_sparse_nulls_operation_output_output(
          17  +
    encoder: &mut ::aws_smithy_cbor::Encoder,
          18  +
    #[allow(unused)] input: &crate::output::SparseNullsOperationOutput,
          19  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          20  +
    encoder.begin_map();
          21  +
    if let Some(var_1) = &input.sparse_string_list {
          22  +
        encoder.str("sparseStringList");
          23  +
        encoder.array((*var_1).len());
          24  +
        for item_2 in var_1 {
          25  +
            if let Some(var_3) = item_2 {
          26  +
                encoder.str(var_3.as_str());
          27  +
            } else {
          28  +
                encoder.null();
          29  +
            }
          30  +
        }
          31  +
    }
          32  +
    if let Some(var_4) = &input.sparse_string_map {
          33  +
        encoder.str("sparseStringMap");
          34  +
        encoder.map((*var_4).len());
          35  +
        for (key_5, value_6) in var_4 {
          36  +
            if let Some(var_7) = value_6 {
          37  +
                encoder.str(key_5.as_str()).str(var_7.as_str());
          38  +
            } else {
          39  +
                encoder.str(key_5.as_str()).null();
          40  +
            }
          41  +
        }
          42  +
    }
          43  +
    encoder.end();
          44  +
    Ok(())
          45  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_sparse_number_map.rs

@@ -0,1 +0,49 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_sparse_number_map(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn pair(
           9  +
        mut map: ::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        ::std::collections::HashMap<::std::string::String, ::std::option::Option<i32>>,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let key = decoder.string()?;
          16  +
        let value = match decoder.datatype()? {
          17  +
            ::aws_smithy_cbor::data::Type::Null => {
          18  +
                decoder.null()?;
          19  +
                ::std::option::Option::None
          20  +
            }
          21  +
            _ => Some(decoder.integer()?),
          22  +
        };
          23  +
        map.insert(key, value);
          24  +
        Ok(map)
          25  +
    }
          26  +
          27  +
    let mut map = ::std::collections::HashMap::new();
          28  +
          29  +
    match decoder.map()? {
          30  +
        None => loop {
          31  +
            match decoder.datatype()? {
          32  +
                ::aws_smithy_cbor::data::Type::Break => {
          33  +
                    decoder.skip()?;
          34  +
                    break;
          35  +
                }
          36  +
                _ => {
          37  +
                    map = pair(map, decoder)?;
          38  +
                }
          39  +
            };
          40  +
        },
          41  +
        Some(n) => {
          42  +
            for _ in 0..n {
          43  +
                map = pair(map, decoder)?;
          44  +
            }
          45  +
        }
          46  +
    };
          47  +
          48  +
    Ok(map)
          49  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_sparse_set_map.rs

@@ -0,1 +0,53 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_sparse_set_map(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    crate::unconstrained::sparse_set_map_unconstrained::SparseSetMapUnconstrained,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn pair(
           9  +
        mut map: crate::unconstrained::sparse_set_map_unconstrained::SparseSetMapUnconstrained,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        crate::unconstrained::sparse_set_map_unconstrained::SparseSetMapUnconstrained,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let key = decoder.string()?;
          16  +
        let value = match decoder.datatype()? {
          17  +
            ::aws_smithy_cbor::data::Type::Null => {
          18  +
                decoder.null()?;
          19  +
                ::std::option::Option::None
          20  +
            }
          21  +
            _ => Some(crate::protocol_serde::shape_string_set::de_string_set(
          22  +
                decoder,
          23  +
            )?),
          24  +
        };
          25  +
        map.0.insert(key, value);
          26  +
        Ok(map)
          27  +
    }
          28  +
          29  +
    let mut map = crate::unconstrained::sparse_set_map_unconstrained::SparseSetMapUnconstrained(
          30  +
        ::std::collections::HashMap::new(),
          31  +
    );
          32  +
          33  +
    match decoder.map()? {
          34  +
        None => loop {
          35  +
            match decoder.datatype()? {
          36  +
                ::aws_smithy_cbor::data::Type::Break => {
          37  +
                    decoder.skip()?;
          38  +
                    break;
          39  +
                }
          40  +
                _ => {
          41  +
                    map = pair(map, decoder)?;
          42  +
                }
          43  +
            };
          44  +
        },
          45  +
        Some(n) => {
          46  +
            for _ in 0..n {
          47  +
                map = pair(map, decoder)?;
          48  +
            }
          49  +
        }
          50  +
    };
          51  +
          52  +
    Ok(map)
          53  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_sparse_string_list.rs

@@ -0,1 +0,48 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_sparse_string_list(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::vec::Vec<::std::option::Option<::std::string::String>>,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn member(
           9  +
        mut list: ::std::vec::Vec<::std::option::Option<::std::string::String>>,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        ::std::vec::Vec<::std::option::Option<::std::string::String>>,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let value = match decoder.datatype()? {
          16  +
            ::aws_smithy_cbor::data::Type::Null => {
          17  +
                decoder.null()?;
          18  +
                ::std::option::Option::None
          19  +
            }
          20  +
            _ => Some(decoder.string()?),
          21  +
        };
          22  +
        list.push(value);
          23  +
        Ok(list)
          24  +
    }
          25  +
          26  +
    let mut list = ::std::vec::Vec::new();
          27  +
          28  +
    match decoder.list()? {
          29  +
        None => loop {
          30  +
            match decoder.datatype()? {
          31  +
                ::aws_smithy_cbor::data::Type::Break => {
          32  +
                    decoder.skip()?;
          33  +
                    break;
          34  +
                }
          35  +
                _ => {
          36  +
                    list = member(list, decoder)?;
          37  +
                }
          38  +
            };
          39  +
        },
          40  +
        Some(n) => {
          41  +
            for _ in 0..n {
          42  +
                list = member(list, decoder)?;
          43  +
            }
          44  +
        }
          45  +
    };
          46  +
          47  +
    Ok(list)
          48  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_sparse_string_map.rs

@@ -0,1 +0,58 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_sparse_string_map(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::collections::HashMap<
           6  +
        ::std::string::String,
           7  +
        ::std::option::Option<::std::string::String>,
           8  +
    >,
           9  +
    ::aws_smithy_cbor::decode::DeserializeError,
          10  +
> {
          11  +
    fn pair(
          12  +
        mut map: ::std::collections::HashMap<
          13  +
            ::std::string::String,
          14  +
            ::std::option::Option<::std::string::String>,
          15  +
        >,
          16  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          17  +
    ) -> ::std::result::Result<
          18  +
        ::std::collections::HashMap<
          19  +
            ::std::string::String,
          20  +
            ::std::option::Option<::std::string::String>,
          21  +
        >,
          22  +
        ::aws_smithy_cbor::decode::DeserializeError,
          23  +
    > {
          24  +
        let key = decoder.string()?;
          25  +
        let value = match decoder.datatype()? {
          26  +
            ::aws_smithy_cbor::data::Type::Null => {
          27  +
                decoder.null()?;
          28  +
                ::std::option::Option::None
          29  +
            }
          30  +
            _ => Some(decoder.string()?),
          31  +
        };
          32  +
        map.insert(key, value);
          33  +
        Ok(map)
          34  +
    }
          35  +
          36  +
    let mut map = ::std::collections::HashMap::new();
          37  +
          38  +
    match decoder.map()? {
          39  +
        None => loop {
          40  +
            match decoder.datatype()? {
          41  +
                ::aws_smithy_cbor::data::Type::Break => {
          42  +
                    decoder.skip()?;
          43  +
                    break;
          44  +
                }
          45  +
                _ => {
          46  +
                    map = pair(map, decoder)?;
          47  +
                }
          48  +
            };
          49  +
        },
          50  +
        Some(n) => {
          51  +
            for _ in 0..n {
          52  +
                map = pair(map, decoder)?;
          53  +
            }
          54  +
        }
          55  +
    };
          56  +
          57  +
    Ok(map)
          58  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_sparse_struct_map.rs

@@ -0,1 +0,58 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_sparse_struct_map(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::collections::HashMap<
           6  +
        ::std::string::String,
           7  +
        ::std::option::Option<crate::model::GreetingStruct>,
           8  +
    >,
           9  +
    ::aws_smithy_cbor::decode::DeserializeError,
          10  +
> {
          11  +
    fn pair(
          12  +
        mut map: ::std::collections::HashMap<
          13  +
            ::std::string::String,
          14  +
            ::std::option::Option<crate::model::GreetingStruct>,
          15  +
        >,
          16  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          17  +
    ) -> ::std::result::Result<
          18  +
        ::std::collections::HashMap<
          19  +
            ::std::string::String,
          20  +
            ::std::option::Option<crate::model::GreetingStruct>,
          21  +
        >,
          22  +
        ::aws_smithy_cbor::decode::DeserializeError,
          23  +
    > {
          24  +
        let key = decoder.string()?;
          25  +
        let value = match decoder.datatype()? {
          26  +
            ::aws_smithy_cbor::data::Type::Null => {
          27  +
                decoder.null()?;
          28  +
                ::std::option::Option::None
          29  +
            }
          30  +
            _ => Some(crate::protocol_serde::shape_greeting_struct::de_greeting_struct(decoder)?),
          31  +
        };
          32  +
        map.insert(key, value);
          33  +
        Ok(map)
          34  +
    }
          35  +
          36  +
    let mut map = ::std::collections::HashMap::new();
          37  +
          38  +
    match decoder.map()? {
          39  +
        None => loop {
          40  +
            match decoder.datatype()? {
          41  +
                ::aws_smithy_cbor::data::Type::Break => {
          42  +
                    decoder.skip()?;
          43  +
                    break;
          44  +
                }
          45  +
                _ => {
          46  +
                    map = pair(map, decoder)?;
          47  +
                }
          48  +
            };
          49  +
        },
          50  +
        Some(n) => {
          51  +
            for _ in 0..n {
          52  +
                map = pair(map, decoder)?;
          53  +
            }
          54  +
        }
          55  +
    };
          56  +
          57  +
    Ok(map)
          58  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_string_list.rs

@@ -0,1 +0,52 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_string_list(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::vec::Vec<::std::string::String>,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn member(
           9  +
        mut list: ::std::vec::Vec<::std::string::String>,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        ::std::vec::Vec<::std::string::String>,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let value = match decoder.datatype()? {
          16  +
            ::aws_smithy_cbor::data::Type::Null => {
          17  +
                return ::std::result::Result::Err(
          18  +
                    ::aws_smithy_cbor::decode::DeserializeError::custom(
          19  +
                        "dense list cannot contain null values",
          20  +
                        decoder.position(),
          21  +
                    ),
          22  +
                )
          23  +
            }
          24  +
            _ => decoder.string()?,
          25  +
        };
          26  +
        list.push(value);
          27  +
        Ok(list)
          28  +
    }
          29  +
          30  +
    let mut list = ::std::vec::Vec::new();
          31  +
          32  +
    match decoder.list()? {
          33  +
        None => loop {
          34  +
            match decoder.datatype()? {
          35  +
                ::aws_smithy_cbor::data::Type::Break => {
          36  +
                    decoder.skip()?;
          37  +
                    break;
          38  +
                }
          39  +
                _ => {
          40  +
                    list = member(list, decoder)?;
          41  +
                }
          42  +
            };
          43  +
        },
          44  +
        Some(n) => {
          45  +
            for _ in 0..n {
          46  +
                list = member(list, decoder)?;
          47  +
            }
          48  +
        }
          49  +
    };
          50  +
          51  +
    Ok(list)
          52  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_string_set.rs

@@ -0,1 +0,54 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_string_set(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    crate::unconstrained::string_set_unconstrained::StringSetUnconstrained,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn member(
           9  +
        mut list: crate::unconstrained::string_set_unconstrained::StringSetUnconstrained,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        crate::unconstrained::string_set_unconstrained::StringSetUnconstrained,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let value = match decoder.datatype()? {
          16  +
            ::aws_smithy_cbor::data::Type::Null => {
          17  +
                return ::std::result::Result::Err(
          18  +
                    ::aws_smithy_cbor::decode::DeserializeError::custom(
          19  +
                        "dense list cannot contain null values",
          20  +
                        decoder.position(),
          21  +
                    ),
          22  +
                )
          23  +
            }
          24  +
            _ => decoder.string()?,
          25  +
        };
          26  +
        list.0.push(value);
          27  +
        Ok(list)
          28  +
    }
          29  +
          30  +
    let mut list = crate::unconstrained::string_set_unconstrained::StringSetUnconstrained(
          31  +
        ::std::vec::Vec::new(),
          32  +
    );
          33  +
          34  +
    match decoder.list()? {
          35  +
        None => loop {
          36  +
            match decoder.datatype()? {
          37  +
                ::aws_smithy_cbor::data::Type::Break => {
          38  +
                    decoder.skip()?;
          39  +
                    break;
          40  +
                }
          41  +
                _ => {
          42  +
                    list = member(list, decoder)?;
          43  +
                }
          44  +
            };
          45  +
        },
          46  +
        Some(n) => {
          47  +
            for _ in 0..n {
          48  +
                list = member(list, decoder)?;
          49  +
            }
          50  +
        }
          51  +
    };
          52  +
          53  +
    Ok(list)
          54  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_structure_list.rs

@@ -0,1 +0,54 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_structure_list(
           3  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::vec::Vec<crate::model::StructureListMember>,
           6  +
    ::aws_smithy_cbor::decode::DeserializeError,
           7  +
> {
           8  +
    fn member(
           9  +
        mut list: ::std::vec::Vec<crate::model::StructureListMember>,
          10  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          11  +
    ) -> ::std::result::Result<
          12  +
        ::std::vec::Vec<crate::model::StructureListMember>,
          13  +
        ::aws_smithy_cbor::decode::DeserializeError,
          14  +
    > {
          15  +
        let value = match decoder.datatype()? {
          16  +
            ::aws_smithy_cbor::data::Type::Null => {
          17  +
                return ::std::result::Result::Err(
          18  +
                    ::aws_smithy_cbor::decode::DeserializeError::custom(
          19  +
                        "dense list cannot contain null values",
          20  +
                        decoder.position(),
          21  +
                    ),
          22  +
                )
          23  +
            }
          24  +
            _ => crate::protocol_serde::shape_structure_list_member::de_structure_list_member(
          25  +
                decoder,
          26  +
            )?,
          27  +
        };
          28  +
        list.push(value);
          29  +
        Ok(list)
          30  +
    }
          31  +
          32  +
    let mut list = ::std::vec::Vec::new();
          33  +
          34  +
    match decoder.list()? {
          35  +
        None => loop {
          36  +
            match decoder.datatype()? {
          37  +
                ::aws_smithy_cbor::data::Type::Break => {
          38  +
                    decoder.skip()?;
          39  +
                    break;
          40  +
                }
          41  +
                _ => {
          42  +
                    list = member(list, decoder)?;
          43  +
                }
          44  +
            };
          45  +
        },
          46  +
        Some(n) => {
          47  +
            for _ in 0..n {
          48  +
                list = member(list, decoder)?;
          49  +
            }
          50  +
        }
          51  +
    };
          52  +
          53  +
    Ok(list)
          54  +
}

tmp-codegen-diff/codegen-server-test/rpcv2Cbor-http0x/rust-server-codegen/src/protocol_serde/shape_structure_list_member.rs

@@ -0,1 +0,74 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_structure_list_member(
           3  +
    encoder: &mut ::aws_smithy_cbor::Encoder,
           4  +
    #[allow(unused)] input: &crate::model::StructureListMember,
           5  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    encoder.begin_map();
           7  +
    if let Some(var_1) = &input.a {
           8  +
        encoder.str("a").str(var_1.as_str());
           9  +
    }
          10  +
    if let Some(var_2) = &input.b {
          11  +
        encoder.str("b").str(var_2.as_str());
          12  +
    }
          13  +
    encoder.end();
          14  +
    Ok(())
          15  +
}
          16  +
          17  +
pub(crate) fn de_structure_list_member(
          18  +
    decoder: &mut ::aws_smithy_cbor::Decoder,
          19  +
) -> ::std::result::Result<
          20  +
    crate::model::StructureListMember,
          21  +
    ::aws_smithy_cbor::decode::DeserializeError,
          22  +
> {
          23  +
    #[allow(clippy::match_single_binding)]
          24  +
    fn pair(
          25  +
        mut builder: crate::model::structure_list_member::Builder,
          26  +
        decoder: &mut ::aws_smithy_cbor::Decoder,
          27  +
    ) -> ::std::result::Result<
          28  +
        crate::model::structure_list_member::Builder,
          29  +
        ::aws_smithy_cbor::decode::DeserializeError,
          30  +
    > {
          31  +
        builder = match decoder.str()?.as_ref() {
          32  +
            "a" => {
          33  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          34  +
                    Ok(builder.set_a(Some(decoder.string()?)))
          35  +
                })?
          36  +
            }
          37  +
            "b" => {
          38  +
                ::aws_smithy_cbor::decode::set_optional(builder, decoder, |builder, decoder| {
          39  +
                    Ok(builder.set_b(Some(decoder.string()?)))
          40  +
                })?
          41  +
            }
          42  +
            _ => {
          43  +
                decoder.skip()?;
          44  +
                builder
          45  +
            }
          46  +
        };
          47  +
        Ok(builder)
          48  +
    }
          49  +
          50  +
    let mut builder = crate::model::structure_list_member::Builder::default();
          51  +
          52  +
    match decoder.map()? {
          53  +
        None => loop {
          54  +
            match decoder.datatype()? {
          55  +
                ::aws_smithy_cbor::data::Type::Break => {
          56  +
                    decoder.skip()?;
          57  +
                    break;
          58  +
                }
          59  +
                _ => {
          60  +
                    builder = pair(builder, decoder)?;
          61  +
                }
          62  +
            };
          63  +
        },
          64  +
        Some(n) => {
          65  +
            for _ in 0..n {
          66  +
                builder = pair(builder, decoder)?;
          67  +
            }
          68  +
        }
          69  +
    };
          70  +
    #[allow(clippy::needless_question_mark)]
          71  +
    {
          72  +
        return Ok(builder.build());
          73  +
    }
          74  +
}