Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_list_c.rs

@@ -1,1 +35,58 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_list_c<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          16  +
            /* JsonParserGenerator.kt:407 */
   14     17   
            let mut items = Vec::new();
          18  +
            /* JsonParserGenerator.kt:408 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:409 */
   16     21   
                match tokens.peek() {
          22  +
                    /* JsonParserGenerator.kt:410 */
   17     23   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          24  +
                        /* JsonParserGenerator.kt:411 */
   18     25   
                        tokens.next().transpose().unwrap();
   19     26   
                        break;
          27  +
                        /* JsonParserGenerator.kt:410 */
   20     28   
                    }
          29  +
                    /* JsonParserGenerator.kt:413 */
   21     30   
                    _ => {
   22         -
                        let value = crate::protocol_serde::shape_map_a::de_map_a(tokens)?;
          31  +
                        /* JsonParserGenerator.kt:419 */
          32  +
                        let value =
          33  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_a::de_map_a(tokens)?
          34  +
                        /* JsonParserGenerator.kt:419 */;
          35  +
                        /* JsonParserGenerator.kt:422 */
   23     36   
                        if let Some(value) = value {
   24     37   
                            items.push(value);
   25     38   
                        }
          39  +
                        /* JsonParserGenerator.kt:413 */
          40  +
                    } /* JsonParserGenerator.kt:409 */
   26     41   
                }
          42  +
                /* JsonParserGenerator.kt:408 */
   27     43   
            }
   28         -
            }
          44  +
            /* JsonParserGenerator.kt:446 */
   29     45   
            Ok(Some(items))
          46  +
            /* JsonParserGenerator.kt:713 */
   30     47   
        }
   31         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          48  +
        /* JsonParserGenerator.kt:722 */
          49  +
        _ => {
          50  +
            /* JsonParserGenerator.kt:723 */
          51  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32     52   
                "expected start array or null",
   33         -
        )),
          53  +
            ))
          54  +
            /* JsonParserGenerator.kt:722 */
          55  +
        } /* JsonParserGenerator.kt:712 */
   34     56   
    }
          57  +
    /* JsonParserGenerator.kt:398 */
   35     58   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_map_a.rs

@@ -1,1 +39,64 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_map_a<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<::std::string::String, crate::types::EmptyStructure>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   10     11   
{
          12  +
    /* JsonParserGenerator.kt:712 */
   11     13   
    match tokens.next().transpose()? {
   12         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          14  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   13     15   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          16  +
            /* JsonParserGenerator.kt:469 */
   14     17   
            let mut map = ::std::collections::HashMap::new();
          18  +
            /* JsonParserGenerator.kt:684 */
   15     19   
            loop {
          20  +
                /* JsonParserGenerator.kt:685 */
   16     21   
                match tokens.next().transpose()? {
   17         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   18     23   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   19         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   20         -
                        let value = crate::protocol_serde::shape_empty_structure::de_empty_structure(tokens)?;
          24  +
                        /* JsonParserGenerator.kt:471 */
          25  +
                        let key =
          26  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          27  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                            /* JsonParserGenerator.kt:339 */)
          29  +
                        /* JsonParserGenerator.kt:471 */?;
          30  +
                        /* JsonParserGenerator.kt:474 */
          31  +
                        let value =
          32  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_empty_structure::de_empty_structure(tokens)?
          33  +
                        /* JsonParserGenerator.kt:474 */;
          34  +
                        /* JsonParserGenerator.kt:491 */
   21     35   
                        if let Some(value) = value {
   22     36   
                            map.insert(key, value);
   23     37   
                        }
          38  +
                        /* JsonParserGenerator.kt:686 */
   24     39   
                    }
          40  +
                    /* JsonParserGenerator.kt:695 */
   25     41   
                    other => {
   26     42   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   27     43   
                            "expected object key or end object, found: {:?}",
   28     44   
                            other
   29     45   
                        )))
          46  +
                    } /* JsonParserGenerator.kt:685 */
   30     47   
                }
          48  +
                /* JsonParserGenerator.kt:684 */
   31     49   
            }
   32         -
            }
          50  +
            /* JsonParserGenerator.kt:504 */
   33     51   
            Ok(Some(map))
          52  +
            /* JsonParserGenerator.kt:713 */
   34     53   
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          54  +
        /* JsonParserGenerator.kt:722 */
          55  +
        _ => {
          56  +
            /* JsonParserGenerator.kt:723 */
          57  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36     58   
                "expected start object or null",
   37         -
        )),
          59  +
            ))
          60  +
            /* JsonParserGenerator.kt:722 */
          61  +
        } /* JsonParserGenerator.kt:712 */
   38     62   
    }
          63  +
    /* JsonParserGenerator.kt:460 */
   39     64   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_required_header_collection_operation.rs

@@ -1,1 +117,158 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_required_header_collection_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
    9     11   
    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:122 */
   15     21   
    let error_code = match generic.code() {
   16     22   
        Some(code) => code,
   17     23   
        None => return Err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled(generic)),
   18     24   
    };
   19     25   
   20     26   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          27  +
    /* ProtocolParserGenerator.kt:133 */
   21     28   
    Err(match error_code {
          29  +
        /* ProtocolParserGenerator.kt:139 */
   22     30   
        "ValidationException" => crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::ValidationError({
          31  +
            /* RustType.kt:516 */
   23     32   
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                crate::serde_util::validation_exception_correct_errors(output)
   31         -
                    .build()
   32         -
                    .map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?
   33         -
            };
          33  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          34  +
                /* ProtocolParserGenerator.kt:146 */ {
          35  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          36  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
          37  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?;
          38  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          39  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::validation_exception_correct_errors(output).build().map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?
          40  +
                /* ProtocolParserGenerator.kt:146 */}
          41  +
            /* ProtocolParserGenerator.kt:145 */;
          42  +
            /* ProtocolParserGenerator.kt:179 */
   34     43   
            tmp
          44  +
            /* ProtocolParserGenerator.kt:139 */
   35     45   
        }),
   36         -
        _ => crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::generic(generic),
          46  +
        /* ProtocolParserGenerator.kt:182 */
          47  +
        _ => crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::generic(generic), /* ProtocolParserGenerator.kt:133 */
   37     48   
    })
          49  +
    /* ProtocolParserGenerator.kt:99 */
   38     50   
}
   39     51   
          52  +
/* RustType.kt:516 */
   40     53   
#[allow(clippy::unnecessary_wraps)]
          54  +
/* ProtocolParserGenerator.kt:71 */
   41     55   
pub fn de_required_header_collection_operation_http_response(
   42     56   
    _response_status: u16,
   43     57   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   44     58   
    _response_body: &[u8],
   45     59   
) -> std::result::Result<
   46     60   
    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput,
   47     61   
    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError,
   48     62   
> {
          63  +
    /* ProtocolParserGenerator.kt:77 */
   49     64   
    Ok({
          65  +
        /* RustType.kt:516 */
   50     66   
        #[allow(unused_mut)]
          67  +
        /* ProtocolParserGenerator.kt:240 */
   51     68   
        let mut output = crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder::default();
          69  +
        /* ProtocolParserGenerator.kt:267 */
   52     70   
        output = output.set_required_header_list(
          71  +
            /* ProtocolParserGenerator.kt:302 */
   53     72   
            crate::protocol_serde::shape_required_header_collection_operation_output::de_required_header_list_header(_response_headers).map_err(
   54     73   
                |_| {
   55     74   
                    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled(
   56     75   
                        "Failed to parse requiredHeaderList from header `X-Required-List",
   57     76   
                    )
   58     77   
                },
   59         -
            )?,
          78  +
            )?, /* ProtocolParserGenerator.kt:267 */
   60     79   
        );
          80  +
        /* ProtocolParserGenerator.kt:267 */
   61     81   
        output = output.set_required_header_set(
          82  +
            /* ProtocolParserGenerator.kt:302 */
   62     83   
            crate::protocol_serde::shape_required_header_collection_operation_output::de_required_header_set_header(_response_headers).map_err(
   63     84   
                |_| {
   64     85   
                    crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled(
   65     86   
                        "Failed to parse requiredHeaderSet from header `X-Required-Set",
   66     87   
                    )
   67     88   
                },
   68         -
            )?,
          89  +
            )?, /* ProtocolParserGenerator.kt:267 */
   69     90   
        );
          91  +
        /* ClientBuilderInstantiator.kt:46 */
   70     92   
        crate::serde_util::required_header_collection_operation_output_output_correct_errors(output)
   71     93   
            .build()
   72     94   
            .map_err(crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationError::unhandled)?
          95  +
        /* ProtocolParserGenerator.kt:77 */
   73     96   
    })
          97  +
    /* ProtocolParserGenerator.kt:71 */
   74     98   
}
   75     99   
         100  +
/* HttpBindingGenerator.kt:542 */
   76    101   
pub fn ser_required_header_collection_operation_headers(
   77    102   
    input: &crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationInput,
   78    103   
    mut builder: ::http::request::Builder,
   79    104   
) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         105  +
    /* HttpBindingGenerator.kt:592 */
   80    106   
    if let ::std::option::Option::Some(inner_1) = &input.required_header_list {
   81         -
        // Empty vec in header is serialized as an empty string
         107  +
        /* HttpBindingGenerator.kt:638 */// Empty vec in header is serialized as an empty string
   82    108   
        if inner_1.is_empty() {
   83    109   
            builder = builder.header("X-Required-List", "");
   84    110   
        } else {
         111  +
            /* HttpBindingGenerator.kt:646 */
   85    112   
            for inner_2 in inner_1 {
         113  +
                /* HttpBindingGenerator.kt:704 */
   86    114   
                let formatted_3 = ::aws_smithy_http::header::quote_header_value(inner_2.as_str());
         115  +
                /* HttpBindingGenerator.kt:706 */
   87    116   
                let header_value = formatted_3;
   88    117   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
   89    118   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
   90    119   
                        "required_header_list",
   91    120   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
   92    121   
                    )
   93    122   
                })?;
   94    123   
                builder = builder.header("X-Required-List", header_value);
         124  +
                /* HttpBindingGenerator.kt:646 */
   95    125   
            }
         126  +
            /* HttpBindingGenerator.kt:638 */
   96    127   
        }
         128  +
        /* HttpBindingGenerator.kt:592 */
   97    129   
    }
         130  +
    /* HttpBindingGenerator.kt:592 */
   98    131   
    if let ::std::option::Option::Some(inner_4) = &input.required_header_set {
   99         -
        // Empty vec in header is serialized as an empty string
         132  +
        /* HttpBindingGenerator.kt:638 */// Empty vec in header is serialized as an empty string
  100    133   
        if inner_4.is_empty() {
  101    134   
            builder = builder.header("X-Required-Set", "");
  102    135   
        } else {
         136  +
            /* HttpBindingGenerator.kt:646 */
  103    137   
            for inner_5 in inner_4 {
         138  +
                /* HttpBindingGenerator.kt:704 */
  104    139   
                let formatted_6 = ::aws_smithy_http::header::quote_header_value(inner_5.as_str());
         140  +
                /* HttpBindingGenerator.kt:706 */
  105    141   
                let header_value = formatted_6;
  106    142   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  107    143   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  108    144   
                        "required_header_set",
  109    145   
                        format!("`{}` cannot be used as a header value: {}", &header_value, err),
  110    146   
                    )
  111    147   
                })?;
  112    148   
                builder = builder.header("X-Required-Set", header_value);
         149  +
                /* HttpBindingGenerator.kt:646 */
  113    150   
            }
         151  +
            /* HttpBindingGenerator.kt:638 */
  114    152   
        }
         153  +
        /* HttpBindingGenerator.kt:592 */
  115    154   
    }
         155  +
    /* HttpBindingGenerator.kt:555 */
  116    156   
    Ok(builder)
         157  +
    /* HttpBindingGenerator.kt:542 */
  117    158   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_required_header_collection_operation_output.rs

@@ -1,1 +16,26 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:153 */
    2      3   
pub(crate) fn de_required_header_list_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<::std::option::Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_http::header::ParseError> {
           6  +
    /* HttpBindingGenerator.kt:160 */
    5      7   
    let headers = header_map.get_all("X-Required-List");
           8  +
    /* HttpBindingGenerator.kt:409 */
    6      9   
    let var_1: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
          10  +
    /* HttpBindingGenerator.kt:430 */
    7     11   
    Ok(if !var_1.is_empty() { Some(var_1) } else { None })
          12  +
    /* HttpBindingGenerator.kt:153 */
    8     13   
}
    9     14   
          15  +
/* HttpBindingGenerator.kt:153 */
   10     16   
pub(crate) fn de_required_header_set_header(
   11     17   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   12     18   
) -> ::std::result::Result<::std::option::Option<::std::vec::Vec<::std::string::String>>, ::aws_smithy_http::header::ParseError> {
          19  +
    /* HttpBindingGenerator.kt:160 */
   13     20   
    let headers = header_map.get_all("X-Required-Set");
          21  +
    /* HttpBindingGenerator.kt:409 */
   14     22   
    let var_2: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
          23  +
    /* HttpBindingGenerator.kt:430 */
   15     24   
    Ok(if !var_2.is_empty() { Some(var_2) } else { None })
          25  +
    /* HttpBindingGenerator.kt:153 */
   16     26   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_required_inner_shape_operation.rs

@@ -1,1 +101,151 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_required_inner_shape_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
    9     11   
    crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:122 */
   15     21   
    let error_code = match generic.code() {
   16     22   
        Some(code) => code,
   17     23   
        None => return Err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled(generic)),
   18     24   
    };
   19     25   
   20     26   
    let _error_message = generic.message().map(|msg| msg.to_owned());
          27  +
    /* ProtocolParserGenerator.kt:133 */
   21     28   
    Err(match error_code {
          29  +
        /* ProtocolParserGenerator.kt:139 */
   22     30   
        "ValidationException" => crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::ValidationError({
          31  +
            /* RustType.kt:516 */
   23     32   
            #[allow(unused_mut)]
   24         -
            let mut tmp = {
   25         -
                #[allow(unused_mut)]
   26         -
                let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
   27         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   28         -
                    .map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?;
   29         -
                let output = output.meta(generic);
   30         -
                crate::serde_util::validation_exception_correct_errors(output)
   31         -
                    .build()
   32         -
                    .map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?
   33         -
            };
          33  +
            /* ProtocolParserGenerator.kt:145 */let mut tmp =
          34  +
                /* ProtocolParserGenerator.kt:146 */ {
          35  +
                    /* RustType.kt:516 */#[allow(unused_mut)]
          36  +
                    /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
          37  +
                    /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?;
          38  +
                    /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
          39  +
                    /* ClientBuilderInstantiator.kt:46 */crate::serde_util::validation_exception_correct_errors(output).build().map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?
          40  +
                /* ProtocolParserGenerator.kt:146 */}
          41  +
            /* ProtocolParserGenerator.kt:145 */;
          42  +
            /* ProtocolParserGenerator.kt:179 */
   34     43   
            tmp
          44  +
            /* ProtocolParserGenerator.kt:139 */
   35     45   
        }),
   36         -
        _ => crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::generic(generic),
          46  +
        /* ProtocolParserGenerator.kt:182 */
          47  +
        _ => crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::generic(generic), /* ProtocolParserGenerator.kt:133 */
   37     48   
    })
          49  +
    /* ProtocolParserGenerator.kt:99 */
   38     50   
}
   39     51   
          52  +
/* RustType.kt:516 */
   40     53   
#[allow(clippy::unnecessary_wraps)]
          54  +
/* ProtocolParserGenerator.kt:71 */
   41     55   
pub fn de_required_inner_shape_operation_http_response(
   42     56   
    _response_status: u16,
   43     57   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   44     58   
    _response_body: &[u8],
   45     59   
) -> std::result::Result<
   46     60   
    crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationOutput,
   47     61   
    crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError,
   48     62   
> {
          63  +
    /* ProtocolParserGenerator.kt:77 */
   49     64   
    Ok({
          65  +
        /* RustType.kt:516 */
   50     66   
        #[allow(unused_mut)]
          67  +
        /* ProtocolParserGenerator.kt:240 */
   51     68   
        let mut output = crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder::default();
          69  +
        /* ProtocolParserGenerator.kt:247 */
   52     70   
        output = crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation(_response_body, output)
   53     71   
            .map_err(crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationError::unhandled)?;
          72  +
        /* ClientBuilderInstantiator.kt:56 */
   54     73   
        output.build()
          74  +
        /* ProtocolParserGenerator.kt:77 */
   55     75   
    })
          76  +
    /* ProtocolParserGenerator.kt:71 */
   56     77   
}
   57     78   
          79  +
/* JsonSerializerGenerator.kt:287 */
   58     80   
pub fn ser_required_inner_shape_operation_input(
   59     81   
    input: &crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
   60     82   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          83  +
    /* JsonSerializerGenerator.kt:291 */
   61     84   
    let mut out = String::new();
          85  +
    /* JsonSerializerGenerator.kt:292 */
   62     86   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          87  +
    /* JsonSerializerGenerator.kt:375 */
   63     88   
    crate::protocol_serde::shape_required_inner_shape_operation_input::ser_required_inner_shape_operation_input_input(&mut object, input)?;
          89  +
    /* JsonSerializerGenerator.kt:295 */
   64     90   
    object.finish();
          91  +
    /* JsonSerializerGenerator.kt:296 */
   65     92   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          93  +
    /* JsonSerializerGenerator.kt:287 */
   66     94   
}
   67     95   
          96  +
/* JsonParserGenerator.kt:148 */
   68     97   
pub(crate) fn de_required_inner_shape_operation(
   69     98   
    value: &[u8],
   70     99   
    mut builder: crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder,
   71    100   
) -> ::std::result::Result<
   72    101   
    crate::operation::required_inner_shape_operation::builders::RequiredInnerShapeOperationOutputBuilder,
   73    102   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   74    103   
> {
         104  +
    /* JsonParserGenerator.kt:153 */
   75    105   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   76    106   
    let tokens = &mut tokens_owned;
   77    107   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         108  +
    /* JsonParserGenerator.kt:684 */
   78    109   
    loop {
         110  +
        /* JsonParserGenerator.kt:685 */
   79    111   
        match tokens.next().transpose()? {
   80         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   81         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
         112  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
         113  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         114  +
                /* JsonParserGenerator.kt:260 */
         115  +
                match key.to_unescaped()?.as_ref() {
         116  +
                    /* JsonParserGenerator.kt:262 */
   82    117   
                    "inner" => {
   83         -
                    builder = builder.set_inner(crate::protocol_serde::shape_inner_shape::de_inner_shape(tokens)?);
         118  +
                        /* JsonParserGenerator.kt:265 */
         119  +
                        builder = builder.set_inner(
         120  +
                            /* JsonParserGenerator.kt:544 */
         121  +
                            crate::protocol_serde::shape_inner_shape::de_inner_shape(tokens)?, /* JsonParserGenerator.kt:265 */
         122  +
                        );
         123  +
                        /* JsonParserGenerator.kt:262 */
   84    124   
                    }
   85         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   86         -
            },
         125  +
                    /* JsonParserGenerator.kt:290 */
         126  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
         127  +
                }
         128  +
                /* JsonParserGenerator.kt:686 */
         129  +
            }
         130  +
            /* JsonParserGenerator.kt:695 */
   87    131   
            other => {
   88    132   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   89    133   
                    "expected object key or end object, found: {:?}",
   90    134   
                    other
   91    135   
                )))
         136  +
            } /* JsonParserGenerator.kt:685 */
   92    137   
        }
         138  +
        /* JsonParserGenerator.kt:684 */
   93    139   
    }
   94         -
    }
         140  +
    /* JsonParserGenerator.kt:250 */
   95    141   
    if tokens.next().is_some() {
         142  +
        /* JsonParserGenerator.kt:251 */
   96    143   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   97    144   
            "found more JSON tokens after completing parsing",
   98    145   
        ));
         146  +
        /* JsonParserGenerator.kt:250 */
   99    147   
    }
         148  +
    /* JsonParserGenerator.kt:163 */
  100    149   
    Ok(builder)
         150  +
    /* JsonParserGenerator.kt:148 */
  101    151   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_required_inner_shape_operation_input.rs

@@ -1,1 +13,22 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_required_inner_shape_operation_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::required_inner_shape_operation::RequiredInnerShapeOperationInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.inner {
           9  +
        /* JsonSerializerGenerator.kt:495 */
    7     10   
        #[allow(unused_mut)]
          11  +
        /* JsonSerializerGenerator.kt:496 */
    8     12   
        let mut object_2 = object.key("inner").start_object();
          13  +
        /* JsonSerializerGenerator.kt:375 */
    9     14   
        crate::protocol_serde::shape_inner_shape::ser_inner_shape(&mut object_2, var_1)?;
          15  +
        /* JsonSerializerGenerator.kt:515 */
   10     16   
        object_2.finish();
          17  +
        /* JsonSerializerGenerator.kt:382 */
   11     18   
    }
          19  +
    /* JsonSerializerGenerator.kt:372 */
   12     20   
    Ok(())
          21  +
    /* JsonSerializerGenerator.kt:358 */
   13     22   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_response_code_default_operation.rs

@@ -1,1 +32,47 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_response_code_default_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput,
    9     11   
    crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_response_code_default_operation_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::response_code_default_operation::ResponseCodeDefaultOperationOutput,
   25     34   
    crate::operation::response_code_default_operation::ResponseCodeDefaultOperationError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::response_code_default_operation::builders::ResponseCodeDefaultOperationOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_response_code_http_fallback_operation.rs

@@ -1,1 +32,47 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_response_code_http_fallback_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
    9     11   
    crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_response_code_http_fallback_operation_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationOutput,
   25     34   
    crate::operation::response_code_http_fallback_operation::ResponseCodeHttpFallbackOperationError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::response_code_http_fallback_operation::builders::ResponseCodeHttpFallbackOperationOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_response_code_required_operation.rs

@@ -1,1 +35,53 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_response_code_required_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput,
    9     11   
    crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError::generic(generic))
          22  +
    /* ProtocolParserGenerator.kt:99 */
   16     23   
}
   17     24   
          25  +
/* RustType.kt:516 */
   18     26   
#[allow(clippy::unnecessary_wraps)]
          27  +
/* ProtocolParserGenerator.kt:71 */
   19     28   
pub fn de_response_code_required_operation_http_response(
   20     29   
    _response_status: u16,
   21     30   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   22     31   
    _response_body: &[u8],
   23     32   
) -> std::result::Result<
   24     33   
    crate::operation::response_code_required_operation::ResponseCodeRequiredOperationOutput,
   25     34   
    crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError,
   26     35   
> {
          36  +
    /* ProtocolParserGenerator.kt:77 */
   27     37   
    Ok({
          38  +
        /* RustType.kt:516 */
   28     39   
        #[allow(unused_mut)]
          40  +
        /* ProtocolParserGenerator.kt:240 */
   29     41   
        let mut output = crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder::default();
   30         -
        output = output.set_response_code(Some(_response_status as _));
          42  +
        /* ProtocolParserGenerator.kt:267 */
          43  +
        output = output.set_response_code(
          44  +
            /* ProtocolParserGenerator.kt:332 */ Some(_response_status as _), /* ProtocolParserGenerator.kt:267 */
          45  +
        );
          46  +
        /* ClientBuilderInstantiator.kt:46 */
   31     47   
        crate::serde_util::response_code_required_operation_output_output_correct_errors(output)
   32     48   
            .build()
   33     49   
            .map_err(crate::operation::response_code_required_operation::ResponseCodeRequiredOperationError::unhandled)?
          50  +
        /* ProtocolParserGenerator.kt:77 */
   34     51   
    })
          52  +
    /* ProtocolParserGenerator.kt:71 */
   35     53   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_type_complexity_operation.rs

@@ -1,1 +81,126 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_type_complexity_operation_http_error(
    4      6   
    _response_status: u16,
    5      7   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6      8   
    _response_body: &[u8],
    7      9   
) -> std::result::Result<
    8     10   
    crate::operation::type_complexity_operation::TypeComplexityOperationOutput,
    9     11   
    crate::operation::type_complexity_operation::TypeComplexityOperationError,
   10     12   
> {
          13  +
    /* RustType.kt:516 */
   11     14   
    #[allow(unused_mut)]
          15  +
    /* ProtocolParserGenerator.kt:106 */
   12     16   
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13     17   
        .map_err(crate::operation::type_complexity_operation::TypeComplexityOperationError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::type_complexity_operation::TypeComplexityOperationError::generic(
   16     22   
        generic,
   17     23   
    ))
          24  +
    /* ProtocolParserGenerator.kt:99 */
   18     25   
}
   19     26   
          27  +
/* RustType.kt:516 */
   20     28   
#[allow(clippy::unnecessary_wraps)]
          29  +
/* ProtocolParserGenerator.kt:71 */
   21     30   
pub fn de_type_complexity_operation_http_response(
   22     31   
    _response_status: u16,
   23     32   
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   24     33   
    _response_body: &[u8],
   25     34   
) -> std::result::Result<
   26     35   
    crate::operation::type_complexity_operation::TypeComplexityOperationOutput,
   27     36   
    crate::operation::type_complexity_operation::TypeComplexityOperationError,
   28     37   
> {
          38  +
    /* ProtocolParserGenerator.kt:77 */
   29     39   
    Ok({
          40  +
        /* RustType.kt:516 */
   30     41   
        #[allow(unused_mut)]
          42  +
        /* ProtocolParserGenerator.kt:240 */
   31     43   
        let mut output = crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder::default();
          44  +
        /* ProtocolParserGenerator.kt:247 */
   32     45   
        output = crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_operation(_response_body, output)
   33     46   
            .map_err(crate::operation::type_complexity_operation::TypeComplexityOperationError::unhandled)?;
          47  +
        /* ClientBuilderInstantiator.kt:56 */
   34     48   
        output.build()
          49  +
        /* ProtocolParserGenerator.kt:77 */
   35     50   
    })
          51  +
    /* ProtocolParserGenerator.kt:71 */
   36     52   
}
   37     53   
          54  +
/* JsonSerializerGenerator.kt:287 */
   38     55   
pub fn ser_type_complexity_operation_input(
   39     56   
    input: &crate::operation::type_complexity_operation::TypeComplexityOperationInput,
   40     57   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          58  +
    /* JsonSerializerGenerator.kt:291 */
   41     59   
    let mut out = String::new();
          60  +
    /* JsonSerializerGenerator.kt:292 */
   42     61   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          62  +
    /* JsonSerializerGenerator.kt:375 */
   43     63   
    crate::protocol_serde::shape_type_complexity_operation_input::ser_type_complexity_operation_input_input(&mut object, input)?;
          64  +
    /* JsonSerializerGenerator.kt:295 */
   44     65   
    object.finish();
          66  +
    /* JsonSerializerGenerator.kt:296 */
   45     67   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          68  +
    /* JsonSerializerGenerator.kt:287 */
   46     69   
}
   47     70   
          71  +
/* JsonParserGenerator.kt:148 */
   48     72   
pub(crate) fn de_type_complexity_operation(
   49     73   
    value: &[u8],
   50     74   
    mut builder: crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder,
   51     75   
) -> ::std::result::Result<
   52     76   
    crate::operation::type_complexity_operation::builders::TypeComplexityOperationOutputBuilder,
   53     77   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   54     78   
> {
          79  +
    /* JsonParserGenerator.kt:153 */
   55     80   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
   56     81   
    let tokens = &mut tokens_owned;
   57     82   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          83  +
    /* JsonParserGenerator.kt:684 */
   58     84   
    loop {
          85  +
        /* JsonParserGenerator.kt:685 */
   59     86   
        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() {
          87  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          88  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          89  +
                /* JsonParserGenerator.kt:260 */
          90  +
                match key.to_unescaped()?.as_ref() {
          91  +
                    /* JsonParserGenerator.kt:262 */
   62     92   
                    "list" => {
   63         -
                    builder = builder.set_list(crate::protocol_serde::shape_list_a::de_list_a(tokens)?);
          93  +
                        /* JsonParserGenerator.kt:265 */
          94  +
                        builder = builder.set_list(
          95  +
                            /* JsonParserGenerator.kt:451 */
          96  +
                            crate::protocol_serde::shape_list_a::de_list_a(tokens)?, /* JsonParserGenerator.kt:265 */
          97  +
                        );
          98  +
                        /* JsonParserGenerator.kt:262 */
   64     99   
                    }
   65         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   66         -
            },
         100  +
                    /* JsonParserGenerator.kt:290 */
         101  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
         102  +
                }
         103  +
                /* JsonParserGenerator.kt:686 */
         104  +
            }
         105  +
            /* JsonParserGenerator.kt:695 */
   67    106   
            other => {
   68    107   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   69    108   
                    "expected object key or end object, found: {:?}",
   70    109   
                    other
   71    110   
                )))
         111  +
            } /* JsonParserGenerator.kt:685 */
   72    112   
        }
         113  +
        /* JsonParserGenerator.kt:684 */
   73    114   
    }
   74         -
    }
         115  +
    /* JsonParserGenerator.kt:250 */
   75    116   
    if tokens.next().is_some() {
         117  +
        /* JsonParserGenerator.kt:251 */
   76    118   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   77    119   
            "found more JSON tokens after completing parsing",
   78    120   
        ));
         121  +
        /* JsonParserGenerator.kt:250 */
   79    122   
    }
         123  +
    /* JsonParserGenerator.kt:163 */
   80    124   
    Ok(builder)
         125  +
    /* JsonParserGenerator.kt:148 */
   81    126   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_type_complexity_operation_input.rs

@@ -1,1 +38,72 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_type_complexity_operation_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::type_complexity_operation::TypeComplexityOperationInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.list {
           9  +
        /* JsonSerializerGenerator.kt:484 */
    7     10   
        let mut array_2 = object.key("list").start_array();
          11  +
        /* JsonSerializerGenerator.kt:524 */
    8     12   
        for item_3 in var_1 {
          13  +
            /* SerializerUtil.kt:42 */
    9     14   
            {
          15  +
                /* JsonSerializerGenerator.kt:484 */
   10     16   
                let mut array_4 = array_2.value().start_array();
          17  +
                /* JsonSerializerGenerator.kt:524 */
   11     18   
                for item_5 in item_3 {
          19  +
                    /* SerializerUtil.kt:42 */
   12     20   
                    {
          21  +
                        /* JsonSerializerGenerator.kt:484 */
   13     22   
                        let mut array_6 = array_4.value().start_array();
          23  +
                        /* JsonSerializerGenerator.kt:524 */
   14     24   
                        for item_7 in item_5 {
          25  +
                            /* SerializerUtil.kt:42 */
   15     26   
                            {
          27  +
                                /* JsonSerializerGenerator.kt:495 */
   16     28   
                                #[allow(unused_mut)]
          29  +
                                /* JsonSerializerGenerator.kt:496 */
   17     30   
                                let mut object_8 = array_6.value().start_object();
          31  +
                                /* JsonSerializerGenerator.kt:537 */
   18     32   
                                for (key_9, value_10) in item_7 {
          33  +
                                    /* SerializerUtil.kt:42 */
   19     34   
                                    {
          35  +
                                        /* JsonSerializerGenerator.kt:495 */
   20     36   
                                        #[allow(unused_mut)]
          37  +
                                        /* JsonSerializerGenerator.kt:496 */
   21     38   
                                        let mut object_11 = object_8.key(key_9.as_str()).start_object();
          39  +
                                        /* JsonSerializerGenerator.kt:375 */
   22     40   
                                        crate::protocol_serde::shape_empty_structure::ser_empty_structure(&mut object_11, value_10)?;
          41  +
                                        /* JsonSerializerGenerator.kt:515 */
   23     42   
                                        object_11.finish();
          43  +
                                        /* SerializerUtil.kt:42 */
   24     44   
                                    }
          45  +
                                    /* JsonSerializerGenerator.kt:537 */
   25     46   
                                }
          47  +
                                /* JsonSerializerGenerator.kt:515 */
   26     48   
                                object_8.finish();
          49  +
                                /* SerializerUtil.kt:42 */
   27     50   
                            }
          51  +
                            /* JsonSerializerGenerator.kt:524 */
   28     52   
                        }
          53  +
                        /* JsonSerializerGenerator.kt:486 */
   29     54   
                        array_6.finish();
          55  +
                        /* SerializerUtil.kt:42 */
   30     56   
                    }
          57  +
                    /* JsonSerializerGenerator.kt:524 */
   31     58   
                }
          59  +
                /* JsonSerializerGenerator.kt:486 */
   32     60   
                array_4.finish();
          61  +
                /* SerializerUtil.kt:42 */
   33     62   
            }
          63  +
            /* JsonSerializerGenerator.kt:524 */
   34     64   
        }
          65  +
        /* JsonSerializerGenerator.kt:486 */
   35     66   
        array_2.finish();
          67  +
        /* JsonSerializerGenerator.kt:382 */
   36     68   
    }
          69  +
    /* JsonSerializerGenerator.kt:372 */
   37     70   
    Ok(())
          71  +
    /* JsonSerializerGenerator.kt:358 */
   38     72   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_validation_exception.rs

@@ -1,1 +40,67 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:148 */
    2      3   
pub(crate) fn de_validation_exception_json_err(
    3      4   
    value: &[u8],
    4      5   
    mut builder: crate::types::error::builders::ValidationErrorBuilder,
    5      6   
) -> ::std::result::Result<crate::types::error::builders::ValidationErrorBuilder, ::aws_smithy_json::deserialize::error::DeserializeError> {
           7  +
    /* JsonParserGenerator.kt:153 */
    6      8   
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
    7      9   
    let tokens = &mut tokens_owned;
    8     10   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          11  +
    /* JsonParserGenerator.kt:684 */
    9     12   
    loop {
          13  +
        /* JsonParserGenerator.kt:685 */
   10     14   
        match tokens.next().transpose()? {
   11         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   12         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          15  +
            /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          16  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          17  +
                /* JsonParserGenerator.kt:260 */
          18  +
                match key.to_unescaped()?.as_ref() {
          19  +
                    /* JsonParserGenerator.kt:262 */
   13     20   
                    "message" => {
          21  +
                        /* JsonParserGenerator.kt:265 */
   14     22   
                        builder = builder.set_message(
          23  +
                            /* JsonParserGenerator.kt:354 */
   15     24   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
          25  +
                                .map(|s|
          26  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          27  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          28  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          29  +
                                .transpose()?, /* JsonParserGenerator.kt:265 */
   18     30   
                        );
          31  +
                        /* JsonParserGenerator.kt:262 */
   19     32   
                    }
          33  +
                    /* JsonParserGenerator.kt:262 */
   20     34   
                    "fieldList" => {
   21         -
                    builder = builder
   22         -
                        .set_field_list(crate::protocol_serde::shape_validation_exception_field_list::de_validation_exception_field_list(tokens)?);
          35  +
                        /* JsonParserGenerator.kt:265 */
          36  +
                        builder = builder.set_field_list(
          37  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_validation_exception_field_list::de_validation_exception_field_list(tokens)?
          38  +
                        /* JsonParserGenerator.kt:265 */);
          39  +
                        /* JsonParserGenerator.kt:262 */
   23     40   
                    }
   24         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   25         -
            },
          41  +
                    /* JsonParserGenerator.kt:290 */
          42  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          43  +
                }
          44  +
                /* JsonParserGenerator.kt:686 */
          45  +
            }
          46  +
            /* JsonParserGenerator.kt:695 */
   26     47   
            other => {
   27     48   
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   28     49   
                    "expected object key or end object, found: {:?}",
   29     50   
                    other
   30     51   
                )))
          52  +
            } /* JsonParserGenerator.kt:685 */
   31     53   
        }
          54  +
        /* JsonParserGenerator.kt:684 */
   32     55   
    }
   33         -
    }
          56  +
    /* JsonParserGenerator.kt:250 */
   34     57   
    if tokens.next().is_some() {
          58  +
        /* JsonParserGenerator.kt:251 */
   35     59   
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36     60   
            "found more JSON tokens after completing parsing",
   37     61   
        ));
          62  +
        /* JsonParserGenerator.kt:250 */
   38     63   
    }
          64  +
    /* JsonParserGenerator.kt:163 */
   39     65   
    Ok(builder)
          66  +
    /* JsonParserGenerator.kt:148 */
   40     67   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_validation_exception_field.rs

@@ -1,1 +51,86 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_validation_exception_field<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<crate::types::ValidationExceptionField>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          13  +
            /* RustType.kt:516 */
   11     14   
            #[allow(unused_mut)]
          15  +
            /* JsonParserGenerator.kt:526 */
   12     16   
            let mut builder = crate::types::builders::ValidationExceptionFieldBuilder::default();
          17  +
            /* JsonParserGenerator.kt:684 */
   13     18   
            loop {
          19  +
                /* JsonParserGenerator.kt:685 */
   14     20   
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
          21  +
                    /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          22  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          23  +
                        /* JsonParserGenerator.kt:260 */
          24  +
                        match key.to_unescaped()?.as_ref() {
          25  +
                            /* JsonParserGenerator.kt:262 */
   17     26   
                            "path" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
   18     28   
                                builder = builder.set_path(
          29  +
                                    /* JsonParserGenerator.kt:354 */
   19     30   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                                    .transpose()?,
          31  +
                                        .map(|s|
          32  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          33  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          34  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          35  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   22     36   
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
   23     38   
                            }
          39  +
                            /* JsonParserGenerator.kt:262 */
   24     40   
                            "message" => {
          41  +
                                /* JsonParserGenerator.kt:265 */
   25     42   
                                builder = builder.set_message(
          43  +
                                    /* JsonParserGenerator.kt:354 */
   26     44   
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   27         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   28         -
                                    .transpose()?,
          45  +
                                        .map(|s|
          46  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          47  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          48  +
                                        /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
          49  +
                                        .transpose()?, /* JsonParserGenerator.kt:265 */
   29     50   
                                );
          51  +
                                /* JsonParserGenerator.kt:262 */
   30     52   
                            }
   31         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   32         -
                    },
          53  +
                            /* JsonParserGenerator.kt:290 */
          54  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          55  +
                        }
          56  +
                        /* JsonParserGenerator.kt:686 */
          57  +
                    }
          58  +
                    /* JsonParserGenerator.kt:695 */
   33     59   
                    other => {
   34     60   
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35     61   
                            "expected object key or end object, found: {:?}",
   36     62   
                            other
   37     63   
                        )))
          64  +
                    } /* JsonParserGenerator.kt:685 */
   38     65   
                }
          66  +
                /* JsonParserGenerator.kt:684 */
   39     67   
            }
   40         -
            }
          68  +
            /* JsonParserGenerator.kt:540 */
   41     69   
            Ok(Some(
   42     70   
                crate::serde_util::validation_exception_field_correct_errors(builder)
   43     71   
                    .build()
   44     72   
                    .map_err(|err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?,
   45     73   
            ))
          74  +
            /* JsonParserGenerator.kt:713 */
   46     75   
        }
   47         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          76  +
        /* JsonParserGenerator.kt:722 */
          77  +
        _ => {
          78  +
            /* JsonParserGenerator.kt:723 */
          79  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48     80   
                "expected start object or null",
   49         -
        )),
          81  +
            ))
          82  +
            /* JsonParserGenerator.kt:722 */
          83  +
        } /* JsonParserGenerator.kt:712 */
   50     84   
    }
          85  +
    /* JsonParserGenerator.kt:516 */
   51     86   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/protocol_serde/shape_validation_exception_field_list.rs

@@ -1,1 +32,55 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_validation_exception_field_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::ValidationExceptionField>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5      6   
where
    6      7   
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7      8   
{
           9  +
    /* JsonParserGenerator.kt:712 */
    8     10   
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          11  +
        /* JsonParserGenerator.kt:713 */ Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10     12   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          13  +
            /* JsonParserGenerator.kt:407 */
   11     14   
            let mut items = Vec::new();
          15  +
            /* JsonParserGenerator.kt:408 */
   12     16   
            loop {
          17  +
                /* JsonParserGenerator.kt:409 */
   13     18   
                match tokens.peek() {
          19  +
                    /* JsonParserGenerator.kt:410 */
   14     20   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          21  +
                        /* JsonParserGenerator.kt:411 */
   15     22   
                        tokens.next().transpose().unwrap();
   16     23   
                        break;
          24  +
                        /* JsonParserGenerator.kt:410 */
   17     25   
                    }
          26  +
                    /* JsonParserGenerator.kt:413 */
   18     27   
                    _ => {
   19         -
                        let value = crate::protocol_serde::shape_validation_exception_field::de_validation_exception_field(tokens)?;
          28  +
                        /* JsonParserGenerator.kt:419 */
          29  +
                        let value =
          30  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_validation_exception_field::de_validation_exception_field(tokens)?
          31  +
                        /* JsonParserGenerator.kt:419 */;
          32  +
                        /* JsonParserGenerator.kt:422 */
   20     33   
                        if let Some(value) = value {
   21     34   
                            items.push(value);
   22     35   
                        }
          36  +
                        /* JsonParserGenerator.kt:413 */
          37  +
                    } /* JsonParserGenerator.kt:409 */
   23     38   
                }
          39  +
                /* JsonParserGenerator.kt:408 */
   24     40   
            }
   25         -
            }
          41  +
            /* JsonParserGenerator.kt:446 */
   26     42   
            Ok(Some(items))
          43  +
            /* JsonParserGenerator.kt:713 */
   27     44   
        }
   28         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          45  +
        /* JsonParserGenerator.kt:722 */
          46  +
        _ => {
          47  +
            /* JsonParserGenerator.kt:723 */
          48  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29     49   
                "expected start array or null",
   30         -
        )),
          50  +
            ))
          51  +
            /* JsonParserGenerator.kt:722 */
          52  +
        } /* JsonParserGenerator.kt:712 */
   31     53   
    }
          54  +
    /* JsonParserGenerator.kt:398 */
   32     55   
}

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/serde_util.rs

@@ -1,1 +103,109 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ErrorCorrection.kt:126 */
    2      3   
pub(crate) fn validation_exception_correct_errors(
    3      4   
    mut builder: crate::types::error::builders::ValidationErrorBuilder,
    4      5   
) -> crate::types::error::builders::ValidationErrorBuilder {
    5      6   
    if builder.message.is_none() {
    6      7   
        builder.message = Some(Default::default())
    7      8   
    }
    8      9   
    builder
    9     10   
}
   10     11   
          12  +
/* ErrorCorrection.kt:126 */
   11     13   
pub(crate) fn required_header_collection_operation_output_output_correct_errors(
   12     14   
    mut builder: crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder,
   13     15   
) -> crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder {
   14     16   
    if builder.required_header_list.is_none() {
   15     17   
        builder.required_header_list = Some(Default::default())
   16     18   
    }
   17     19   
    if builder.required_header_set.is_none() {
   18     20   
        builder.required_header_set = Some(Default::default())
   19     21   
    }
   20     22   
    builder
   21     23   
}
   22     24   
          25  +
/* ErrorCorrection.kt:126 */
   23     26   
pub(crate) fn response_code_required_operation_output_output_correct_errors(
   24     27   
    mut builder: crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder,
   25     28   
) -> crate::operation::response_code_required_operation::builders::ResponseCodeRequiredOperationOutputBuilder {
   26     29   
    if builder.response_code.is_none() {
   27     30   
        builder.response_code = Some(Default::default())
   28     31   
    }
   29     32   
    builder
   30     33   
}
   31     34   
          35  +
/* ErrorCorrection.kt:126 */
   32     36   
pub(crate) fn inner_shape_correct_errors(mut builder: crate::types::builders::InnerShapeBuilder) -> crate::types::builders::InnerShapeBuilder {
   33     37   
    if builder.required_inner_most_shape.is_none() {
   34     38   
        builder.required_inner_most_shape = {
   35     39   
            let builder = crate::types::builders::InnermostShapeBuilder::default();
   36     40   
            crate::serde_util::innermost_shape_correct_errors(builder).build().ok()
   37     41   
        }
   38     42   
    }
   39     43   
    builder
   40     44   
}
   41     45   
          46  +
/* ErrorCorrection.kt:126 */
   42     47   
pub(crate) fn innermost_shape_correct_errors(
   43     48   
    mut builder: crate::types::builders::InnermostShapeBuilder,
   44     49   
) -> crate::types::builders::InnermostShapeBuilder {
   45     50   
    if builder.a_string.is_none() {
   46     51   
        builder.a_string = Some(Default::default())
   47     52   
    }
   48     53   
    if builder.a_boolean.is_none() {
   49     54   
        builder.a_boolean = Some(Default::default())
   50     55   
    }
   51     56   
    if builder.a_byte.is_none() {
   52     57   
        builder.a_byte = Some(Default::default())
   53     58   
    }
   54     59   
    if builder.a_short.is_none() {
   55     60   
        builder.a_short = Some(Default::default())
   56     61   
    }
   57     62   
    if builder.an_int.is_none() {
   58     63   
        builder.an_int = Some(Default::default())
   59     64   
    }
   60     65   
    if builder.a_long.is_none() {
   61     66   
        builder.a_long = Some(Default::default())
   62     67   
    }
   63     68   
    if builder.a_float.is_none() {
   64     69   
        builder.a_float = Some(Default::default())
   65     70   
    }
   66     71   
    if builder.a_double.is_none() {
   67     72   
        builder.a_double = Some(Default::default())
   68     73   
    }
   69     74   
    if builder.a_timestamp.is_none() {
   70     75   
        builder.a_timestamp = Some(::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64))
   71     76   
    }
   72     77   
    if builder.a_document.is_none() {
   73     78   
        builder.a_document = Some(::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64))
   74     79   
    }
   75     80   
    if builder.a_string_list.is_none() {
   76     81   
        builder.a_string_list = Some(Default::default())
   77     82   
    }
   78     83   
    if builder.a_string_map.is_none() {
   79     84   
        builder.a_string_map = Some(Default::default())
   80     85   
    }
   81     86   
    if builder.a_string_set.is_none() {
   82     87   
        builder.a_string_set = Some(Default::default())
   83     88   
    }
   84     89   
    if builder.a_blob.is_none() {
   85     90   
        builder.a_blob = Some(::aws_smithy_types::Blob::new(""))
   86     91   
    }
   87     92   
    if builder.a_union.is_none() {
   88     93   
        builder.a_union = Some(crate::types::AUnion::Unknown)
   89     94   
    }
   90     95   
    builder
   91     96   
}
   92     97   
          98  +
/* ErrorCorrection.kt:126 */
   93     99   
pub(crate) fn validation_exception_field_correct_errors(
   94    100   
    mut builder: crate::types::builders::ValidationExceptionFieldBuilder,
   95    101   
) -> crate::types::builders::ValidationExceptionFieldBuilder {
   96    102   
    if builder.path.is_none() {
   97    103   
        builder.path = Some(Default::default())
   98    104   
    }
   99    105   
    if builder.message.is_none() {
  100    106   
        builder.message = Some(Default::default())
  101    107   
    }
  102    108   
    builder

tmp-codegen-diff/codegen-client-test/misc/rust-client-codegen/src/types.rs

@@ -1,1 +26,36 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* CodegenDelegator.kt:255 */
    2      3   
pub use crate::types::_validation_exception_field::ValidationExceptionField;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_inner_shape::InnerShape;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_innermost_shape::InnermostShape;
    7     10   
          11  +
/* CodegenDelegator.kt:255 */
    8     12   
pub use crate::types::_a_union::AUnion;
    9     13   
          14  +
/* CodegenDelegator.kt:255 */
   10     15   
pub use crate::types::_empty_structure::EmptyStructure;
   11     16   
          17  +
/* RustModule.kt:172 */
   12     18   
mod _a_union;
   13     19   
          20  +
/* RustModule.kt:172 */
   14     21   
mod _empty_structure;
   15     22   
          23  +
/* RustModule.kt:172 */
   16     24   
mod _inner_shape;
   17     25   
          26  +
/* RustModule.kt:172 */
   18     27   
mod _innermost_shape;
   19     28   
          29  +
/* RustModule.kt:172 */
   20     30   
mod _validation_exception_field;
   21     31   
   22         -
/// Builders
          32  +
/// /* CodegenDelegator.kt:51 */Builders
   23     33   
pub mod builders;
   24     34   
   25         -
/// Error types that MiscService can respond with.
          35  +
/// /* ClientRustModule.kt:121 */Error types that MiscService can respond with.
   26     36   
pub mod error;