Client Test

Client Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/protocol_serde/shape_structure_name_punning.rs

@@ -1,1 +42,64 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ProtocolParserGenerator.kt:99 */
    3      5   
pub fn de_structure_name_punning_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::structure_name_punning::StructureNamePunningOutput,
    9     11   
    crate::operation::structure_name_punning::StructureNamePunningError,
   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::structure_name_punning::StructureNamePunningError::unhandled)?;
          18  +
    /* ProtocolParserGenerator.kt:120 */
   14     19   
    let generic = generic_builder.build();
          20  +
    /* ProtocolParserGenerator.kt:185 */
   15     21   
    Err(crate::operation::structure_name_punning::StructureNamePunningError::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_structure_name_punning_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::structure_name_punning::StructureNamePunningOutput,
   25     34   
    crate::operation::structure_name_punning::StructureNamePunningError,
   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::structure_name_punning::builders::StructureNamePunningOutputBuilder::default();
          42  +
        /* ClientBuilderInstantiator.kt:56 */
   30     43   
        output.build()
          44  +
        /* ProtocolParserGenerator.kt:77 */
   31     45   
    })
          46  +
    /* ProtocolParserGenerator.kt:71 */
   32     47   
}
   33     48   
          49  +
/* JsonSerializerGenerator.kt:287 */
   34     50   
pub fn ser_structure_name_punning_input(
   35     51   
    input: &crate::operation::structure_name_punning::StructureNamePunningInput,
   36     52   
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
          53  +
    /* JsonSerializerGenerator.kt:291 */
   37     54   
    let mut out = String::new();
          55  +
    /* JsonSerializerGenerator.kt:292 */
   38     56   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
          57  +
    /* JsonSerializerGenerator.kt:375 */
   39     58   
    crate::protocol_serde::shape_structure_name_punning_input::ser_structure_name_punning_input_input(&mut object, input)?;
          59  +
    /* JsonSerializerGenerator.kt:295 */
   40     60   
    object.finish();
          61  +
    /* JsonSerializerGenerator.kt:296 */
   41     62   
    Ok(::aws_smithy_types::body::SdkBody::from(out))
          63  +
    /* JsonSerializerGenerator.kt:287 */
   42     64   
}

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/protocol_serde/shape_structure_name_punning_input.rs

@@ -1,1 +16,28 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_structure_name_punning_input_input(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::operation::structure_name_punning::StructureNamePunningInput,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:382 */
    6      8   
    if let Some(var_1) = &input.regular_string {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("regular_string").string(var_1.as_str());
          11  +
        /* JsonSerializerGenerator.kt:382 */
    8     12   
    }
          13  +
    /* JsonSerializerGenerator.kt:382 */
    9     14   
    if let Some(var_2) = &input.punned_vec {
          15  +
        /* JsonSerializerGenerator.kt:495 */
   10     16   
        #[allow(unused_mut)]
          17  +
        /* JsonSerializerGenerator.kt:496 */
   11     18   
        let mut object_3 = object.key("punned_vec").start_object();
          19  +
        /* JsonSerializerGenerator.kt:375 */
   12     20   
        crate::protocol_serde::shape_vec::ser_vec(&mut object_3, var_2)?;
          21  +
        /* JsonSerializerGenerator.kt:515 */
   13     22   
        object_3.finish();
          23  +
        /* JsonSerializerGenerator.kt:382 */
   14     24   
    }
          25  +
    /* JsonSerializerGenerator.kt:372 */
   15     26   
    Ok(())
          27  +
    /* JsonSerializerGenerator.kt:358 */
   16     28   
}

tmp-codegen-diff/codegen-client-test/naming_test_ops/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::ValidationExceptionBuilder,
    5      6   
) -> ::std::result::Result<crate::types::error::builders::ValidationExceptionBuilder, ::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() {
   13         -
                "message" => {
   14         -
                    builder = builder.set_message(
   15         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   16         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   17         -
                            .transpose()?,
   18         -
                    );
          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 */
          20  +
                    "message" => {
          21  +
                        /* JsonParserGenerator.kt:265 */
          22  +
                        builder = builder.set_message(
          23  +
                            /* JsonParserGenerator.kt:354 */
          24  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          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 */
          30  +
                        );
          31  +
                        /* JsonParserGenerator.kt:262 */
          32  +
                    }
          33  +
                    /* JsonParserGenerator.kt:262 */
          34  +
                    "fieldList" => {
          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 */
          40  +
                    }
          41  +
                    /* JsonParserGenerator.kt:290 */
          42  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   19     43   
                }
   20         -
                "fieldList" => {
   21         -
                    builder = builder
   22         -
                        .set_field_list(crate::protocol_serde::shape_validation_exception_field_list::de_validation_exception_field_list(tokens)?);
   23         -
                }
   24         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   25         -
            },
          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   
                )))
   31         -
            }
          52  +
            } /* JsonParserGenerator.kt:685 */
   32     53   
        }
          54  +
        /* JsonParserGenerator.kt:684 */
   33     55   
    }
          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/naming_test_ops/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() {
   17         -
                        "path" => {
   18         -
                            builder = builder.set_path(
   19         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                                    .transpose()?,
   22         -
                            );
          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 */
          26  +
                            "path" => {
          27  +
                                /* JsonParserGenerator.kt:265 */
          28  +
                                builder = builder.set_path(
          29  +
                                    /* JsonParserGenerator.kt:354 */
          30  +
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          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 */
          36  +
                                );
          37  +
                                /* JsonParserGenerator.kt:262 */
          38  +
                            }
          39  +
                            /* JsonParserGenerator.kt:262 */
          40  +
                            "message" => {
          41  +
                                /* JsonParserGenerator.kt:265 */
          42  +
                                builder = builder.set_message(
          43  +
                                    /* JsonParserGenerator.kt:354 */
          44  +
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
          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 */
          50  +
                                );
          51  +
                                /* JsonParserGenerator.kt:262 */
          52  +
                            }
          53  +
                            /* JsonParserGenerator.kt:290 */
          54  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   23     55   
                        }
   24         -
                        "message" => {
   25         -
                            builder = builder.set_message(
   26         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   27         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   28         -
                                    .transpose()?,
   29         -
                            );
   30         -
                        }
   31         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   32         -
                    },
          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   
                        )))
   38         -
                    }
          64  +
                    } /* JsonParserGenerator.kt:685 */
   39     65   
                }
          66  +
                /* JsonParserGenerator.kt:684 */
   40     67   
            }
          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(
   48         -
            "expected start object or null",
   49         -
        )),
          76  +
        /* JsonParserGenerator.kt:722 */
          77  +
        _ => {
          78  +
            /* JsonParserGenerator.kt:723 */
          79  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          80  +
                "expected start object or null",
          81  +
            ))
          82  +
            /* JsonParserGenerator.kt:722 */
          83  +
        } /* JsonParserGenerator.kt:712 */
   50     84   
    }
          85  +
    /* JsonParserGenerator.kt:516 */
   51     86   
}

tmp-codegen-diff/codegen-client-test/naming_test_ops/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   
                        }
   23         -
                    }
          36  +
                        /* JsonParserGenerator.kt:413 */
          37  +
                    } /* JsonParserGenerator.kt:409 */
   24     38   
                }
          39  +
                /* JsonParserGenerator.kt:408 */
   25     40   
            }
          41  +
            /* JsonParserGenerator.kt:446 */
   26     42   
            Ok(Some(items))
          43  +
            /* JsonParserGenerator.kt:713 */
   27     44   
        }
   28         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   29         -
            "expected start array or null",
   30         -
        )),
          45  +
        /* JsonParserGenerator.kt:722 */
          46  +
        _ => {
          47  +
            /* JsonParserGenerator.kt:723 */
          48  +
            Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
          49  +
                "expected start array or null",
          50  +
            ))
          51  +
            /* JsonParserGenerator.kt:722 */
          52  +
        } /* JsonParserGenerator.kt:712 */
   31     53   
    }
          54  +
    /* JsonParserGenerator.kt:398 */
   32     55   
}

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/protocol_serde/shape_vec.rs

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

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

@@ -1,1 +21,23 @@
    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::ValidationExceptionBuilder,
    4      5   
) -> crate::types::error::builders::ValidationExceptionBuilder {
    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 validation_exception_field_correct_errors(
   12     14   
    mut builder: crate::types::builders::ValidationExceptionFieldBuilder,
   13     15   
) -> crate::types::builders::ValidationExceptionFieldBuilder {
   14     16   
    if builder.path.is_none() {
   15     17   
        builder.path = Some(Default::default())
   16     18   
    }
   17     19   
    if builder.message.is_none() {
   18     20   
        builder.message = Some(Default::default())
   19     21   
    }
   20     22   
    builder

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

@@ -1,1 +18,24 @@
    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::_unknown_variant_colliding_enum::UnknownVariantCollidingEnum;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::_vec::Vec;
    7     10   
          11  +
/* RustModule.kt:172 */
    8     12   
mod _unknown_variant_colliding_enum;
    9     13   
          14  +
/* RustModule.kt:172 */
   10     15   
mod _validation_exception_field;
   11     16   
          17  +
/* RustModule.kt:172 */
   12     18   
mod _vec;
   13     19   
   14         -
/// Builders
          20  +
/// /* CodegenDelegator.kt:51 */Builders
   15     21   
pub mod builders;
   16     22   
   17         -
/// Error types that the service can respond with.
          23  +
/// /* ClientRustModule.kt:121 */Error types that the service can respond with.
   18     24   
pub mod error;

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

@@ -1,1 +134,164 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// When writing a match expression against `UnknownVariantCollidingEnum`, it is important to ensure
           2  +
/* ClientEnumGenerator.kt:234 */
           3  +
/// /* ClientEnumGenerator.kt:234 */When writing a match expression against `UnknownVariantCollidingEnum`, it is important to ensure
    4      4   
/// your code is forward-compatible. That is, if a match arm handles a case for a
    5      5   
/// feature that is supported by the service but has not been represented as an enum
    6      6   
/// variant in a current version of SDK, your code should continue to work when you
    7      7   
/// upgrade SDK to a future version in which the enum does include a variant for that
    8      8   
/// feature.
    9         -
///
   10         -
/// Here is an example of how you can make a match expression forward-compatible:
   11         -
///
   12         -
/// ```text
           9  +
/// /* ClientEnumGenerator.kt:244 */
          10  +
/// /* ClientEnumGenerator.kt:245 */Here is an example of how you can make a match expression forward-compatible:
          11  +
/// /* ClientEnumGenerator.kt:246 */
          12  +
/// /* ClientEnumGenerator.kt:247 */```text
          13  +
/* ClientEnumGenerator.kt:248 */
   13     14   
/// # let unknownvariantcollidingenum = unimplemented!();
          15  +
/* ClientEnumGenerator.kt:249 */
   14     16   
/// match unknownvariantcollidingenum {
          17  +
/* ClientEnumGenerator.kt:251 */
   15     18   
///     UnknownVariantCollidingEnum::Known => { /* ... */ },
          19  +
/* ClientEnumGenerator.kt:251 */
   16     20   
///     UnknownVariantCollidingEnum::SelfValue => { /* ... */ },
          21  +
/* ClientEnumGenerator.kt:251 */
   17     22   
///     UnknownVariantCollidingEnum::SelfValue_ => { /* ... */ },
          23  +
/* ClientEnumGenerator.kt:251 */
   18     24   
///     UnknownVariantCollidingEnum::UnknownValue => { /* ... */ },
          25  +
/* ClientEnumGenerator.kt:251 */
   19     26   
///     UnknownVariantCollidingEnum::UnknownValue_ => { /* ... */ },
          27  +
/* ClientEnumGenerator.kt:253 */
   20     28   
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          29  +
/* ClientEnumGenerator.kt:254 */
   21     30   
///     _ => { /* ... */ },
          31  +
/* ClientEnumGenerator.kt:255 */
   22     32   
/// }
   23         -
/// ```
   24         -
/// The above code demonstrates that when `unknownvariantcollidingenum` represents
          33  +
/// /* ClientEnumGenerator.kt:256 */```
          34  +
/// /* ClientEnumGenerator.kt:257 */The above code demonstrates that when `unknownvariantcollidingenum` represents
   25     35   
/// `NewFeature`, the execution path will lead to the second last match arm,
   26     36   
/// even though the enum does not contain a variant `UnknownVariantCollidingEnum::NewFeature`
   27     37   
/// in the current version of SDK. The reason is that the variable `other`,
   28     38   
/// created by the `@` operator, is bound to
   29     39   
/// `UnknownVariantCollidingEnum::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
   30     40   
/// and calling `as_str` on it yields `"NewFeature"`.
   31     41   
/// This match expression is forward-compatible when executed with a newer
   32     42   
/// version of SDK where the variant `UnknownVariantCollidingEnum::NewFeature` is defined.
   33     43   
/// Specifically, when `unknownvariantcollidingenum` represents `NewFeature`,
   34     44   
/// the execution path will hit the second last match arm as before by virtue of
   35     45   
/// calling `as_str` on `UnknownVariantCollidingEnum::NewFeature` also yielding `"NewFeature"`.
   36         -
///
   37         -
/// Explicitly matching on the `Unknown` variant should
          46  +
/// /* ClientEnumGenerator.kt:273 */
          47  +
/// /* ClientEnumGenerator.kt:274 */Explicitly matching on the `Unknown` variant should
   38     48   
/// be avoided for two reasons:
   39     49   
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
   40     50   
/// - It might inadvertently shadow other intended match arms.
          51  +
/// /* ClientEnumGenerator.kt:282 */
          52  +
/* EnumGenerator.kt:159 */
   41     53   
///
   42         -
///
   43         -
/// _Note: `UnknownVariantCollidingEnum::Self` has been renamed to `::SelfValue`.
          54  +
/// /* EnumGenerator.kt:160 */_Note: `UnknownVariantCollidingEnum::Self` has been renamed to `::SelfValue`.
   44     55   
/// `UnknownVariantCollidingEnum::SelfValue` has been renamed to `::SelfValue_`.
   45     56   
/// `UnknownVariantCollidingEnum::Unknown` has been renamed to `::UnknownValue`.
   46     57   
/// `UnknownVariantCollidingEnum::UnknownValue` has been renamed to `::UnknownValue_`._
          58  +
/* RustType.kt:516 */
   47     59   
#[non_exhaustive]
          60  +
/* RustType.kt:516 */
   48     61   
#[derive(
   49     62   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
   50     63   
)]
   51         -
pub enum UnknownVariantCollidingEnum {
   52         -
    #[allow(missing_docs)] // documentation missing in model
          64  +
pub /* EnumGenerator.kt:267 */ enum UnknownVariantCollidingEnum {
          65  +
    /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
          66  +
    /* EnumGenerator.kt:143 */
   53     67   
    Known,
          68  +
    /* EnumGenerator.kt:159 */
   54     69   
    ///
   55         -
    /// _Note: `::Self` has been renamed to `::SelfValue`._
          70  +
    /// /* EnumGenerator.kt:160 */_Note: `::Self` has been renamed to `::SelfValue`._
          71  +
    /* EnumGenerator.kt:143 */
   56     72   
    SelfValue,
          73  +
    /* EnumGenerator.kt:159 */
   57     74   
    ///
   58         -
    /// _Note: `::SelfValue` has been renamed to `::SelfValue_`._
          75  +
    /// /* EnumGenerator.kt:160 */_Note: `::SelfValue` has been renamed to `::SelfValue_`._
          76  +
    /* EnumGenerator.kt:143 */
   59     77   
    SelfValue_,
          78  +
    /* EnumGenerator.kt:159 */
   60     79   
    ///
   61         -
    /// _Note: `::Unknown` has been renamed to `::UnknownValue`._
          80  +
    /// /* EnumGenerator.kt:160 */_Note: `::Unknown` has been renamed to `::UnknownValue`._
          81  +
    /* EnumGenerator.kt:143 */
   62     82   
    UnknownValue,
          83  +
    /* EnumGenerator.kt:159 */
   63     84   
    ///
   64         -
    /// _Note: `::UnknownValue` has been renamed to `::UnknownValue_`._
          85  +
    /// /* EnumGenerator.kt:160 */_Note: `::UnknownValue` has been renamed to `::UnknownValue_`._
          86  +
    /* EnumGenerator.kt:143 */
   65     87   
    UnknownValue_,
   66         -
    /// `Unknown` contains new variants that have been added since this code was generated.
          88  +
    /// /* ClientEnumGenerator.kt:175 */`Unknown` contains new variants that have been added since this code was generated.
          89  +
    /* ClientEnumGenerator.kt:176 */
   67     90   
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
   68         -
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
          91  +
    /* ClientEnumGenerator.kt:179 */
          92  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), /* EnumGenerator.kt:267 */
   69     93   
}
          94  +
/* ClientEnumGenerator.kt:42 */
   70     95   
impl ::std::convert::From<&str> for UnknownVariantCollidingEnum {
   71     96   
    fn from(s: &str) -> Self {
   72     97   
        match s {
   73     98   
            "Known" => UnknownVariantCollidingEnum::Known,
   74     99   
            "Self" => UnknownVariantCollidingEnum::SelfValue,
   75    100   
            "SelfValue" => UnknownVariantCollidingEnum::SelfValue_,
   76    101   
            "Unknown" => UnknownVariantCollidingEnum::UnknownValue,
   77    102   
            "UnknownValue" => UnknownVariantCollidingEnum::UnknownValue_,
   78    103   
            other => UnknownVariantCollidingEnum::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
   79    104   
        }
   80    105   
    }
   81    106   
}
         107  +
/* ClientEnumGenerator.kt:68 */
   82    108   
impl ::std::str::FromStr for UnknownVariantCollidingEnum {
   83    109   
    type Err = ::std::convert::Infallible;
   84    110   
   85    111   
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
   86    112   
        ::std::result::Result::Ok(UnknownVariantCollidingEnum::from(s))
   87    113   
    }
   88    114   
}
         115  +
/* EnumGenerator.kt:274 */
   89    116   
impl UnknownVariantCollidingEnum {
   90    117   
    /// Returns the `&str` value of the enum member.
   91    118   
    pub fn as_str(&self) -> &str {
   92    119   
        match self {
   93    120   
            UnknownVariantCollidingEnum::Known => "Known",
   94    121   
            UnknownVariantCollidingEnum::SelfValue => "Self",
   95    122   
            UnknownVariantCollidingEnum::SelfValue_ => "SelfValue",
   96    123   
            UnknownVariantCollidingEnum::UnknownValue => "Unknown",
   97    124   
            UnknownVariantCollidingEnum::UnknownValue_ => "UnknownValue",
   98    125   
            UnknownVariantCollidingEnum::Unknown(value) => value.as_str(),
   99    126   
        }
  100    127   
    }
  101    128   
    /// Returns all the `&str` representations of the enum members.
  102    129   
    pub const fn values() -> &'static [&'static str] {
  103    130   
        &["Known", "Self", "SelfValue", "Unknown", "UnknownValue"]
  104    131   
    }
  105    132   
}
         133  +
/* EnumGenerator.kt:223 */
  106    134   
impl ::std::convert::AsRef<str> for UnknownVariantCollidingEnum {
  107    135   
    fn as_ref(&self) -> &str {
  108    136   
        self.as_str()
  109    137   
    }
  110    138   
}
         139  +
/* ClientEnumGenerator.kt:117 */
  111    140   
impl UnknownVariantCollidingEnum {
  112    141   
    /// Parses the enum value while disallowing unknown variants.
  113    142   
    ///
  114    143   
    /// Unknown variants will result in an error.
  115    144   
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
  116    145   
        match Self::from(value) {
  117    146   
            #[allow(deprecated)]
  118    147   
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
  119    148   
            known => Ok(known),
  120    149   
        }
  121    150   
    }
  122    151   
}
         152  +
/* ClientEnumGenerator.kt:136 */
  123    153   
impl ::std::fmt::Display for UnknownVariantCollidingEnum {
  124    154   
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
  125    155   
        match self {
  126    156   
            UnknownVariantCollidingEnum::Known => write!(f, "Known"),
  127    157   
            UnknownVariantCollidingEnum::SelfValue => write!(f, "Self"),
  128    158   
            UnknownVariantCollidingEnum::SelfValue_ => write!(f, "SelfValue"),
  129    159   
            UnknownVariantCollidingEnum::UnknownValue => write!(f, "Unknown"),
  130    160   
            UnknownVariantCollidingEnum::UnknownValue_ => write!(f, "UnknownValue"),
  131    161   
            UnknownVariantCollidingEnum::Unknown(value) => write!(f, "{}", value),
  132    162   
        }

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

@@ -1,1 +89,134 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Describes one specific validation failure for an input member.
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */Describes one specific validation failure for an input member.
           4  +
/* RustType.kt:516 */
    4      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    5      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct ValidationExceptionField {
    7         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
           8  +
pub /* StructureGenerator.kt:201 */ struct ValidationExceptionField {
           9  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
    8     10   
    pub path: ::std::string::String,
    9         -
    /// A detailed description of the validation failure.
          11  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
   10     12   
    pub message: ::std::string::String,
          13  +
    /* StructureGenerator.kt:201 */
   11     14   
}
          15  +
/* StructureGenerator.kt:135 */
   12     16   
impl ValidationExceptionField {
   13         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          17  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          18  +
    /* StructureGenerator.kt:166 */
   14     19   
    pub fn path(&self) -> &str {
          20  +
        /* StructureGenerator.kt:171 */
   15     21   
        use std::ops::Deref;
   16     22   
        self.path.deref()
          23  +
        /* StructureGenerator.kt:166 */
   17     24   
    }
   18         -
    /// A detailed description of the validation failure.
          25  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
          26  +
    /* StructureGenerator.kt:166 */
   19     27   
    pub fn message(&self) -> &str {
          28  +
        /* StructureGenerator.kt:171 */
   20     29   
        use std::ops::Deref;
   21     30   
        self.message.deref()
          31  +
        /* StructureGenerator.kt:166 */
   22     32   
    }
          33  +
    /* StructureGenerator.kt:135 */
   23     34   
}
          35  +
/* ClientCodegenVisitor.kt:237 */
   24     36   
impl ValidationExceptionField {
   25         -
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::types::ValidationExceptionField).
          37  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::types::ValidationExceptionField).
          38  +
    /* BuilderGenerator.kt:175 */
   26     39   
    pub fn builder() -> crate::types::builders::ValidationExceptionFieldBuilder {
          40  +
        /* BuilderGenerator.kt:176 */
   27     41   
        crate::types::builders::ValidationExceptionFieldBuilder::default()
          42  +
        /* BuilderGenerator.kt:175 */
   28     43   
    }
          44  +
    /* ClientCodegenVisitor.kt:237 */
   29     45   
}
   30     46   
   31         -
/// A builder for [`ValidationExceptionField`](crate::types::ValidationExceptionField).
          47  +
/// /* BuilderGenerator.kt:342 */A builder for [`ValidationExceptionField`](crate::types::ValidationExceptionField).
          48  +
/* RustType.kt:516 */
   32     49   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          50  +
/* RustType.kt:516 */
   33     51   
#[non_exhaustive]
          52  +
/* BuilderGenerator.kt:345 */
   34     53   
pub struct ValidationExceptionFieldBuilder {
   35         -
    pub(crate) path: ::std::option::Option<::std::string::String>,
   36         -
    pub(crate) message: ::std::option::Option<::std::string::String>,
          54  +
    /* BuilderGenerator.kt:275 */ pub(crate) path: ::std::option::Option<::std::string::String>,
          55  +
    /* BuilderGenerator.kt:275 */ pub(crate) message: ::std::option::Option<::std::string::String>,
          56  +
    /* BuilderGenerator.kt:345 */
   37     57   
}
          58  +
/* BuilderGenerator.kt:355 */
   38     59   
impl ValidationExceptionFieldBuilder {
   39         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
   40         -
    /// This field is required.
          60  +
    /// /* BuilderGenerator.kt:286 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          61  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          62  +
    /* BuilderGenerator.kt:291 */
   41     63   
    pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          64  +
        /* BuilderGenerator.kt:292 */
   42     65   
        self.path = ::std::option::Option::Some(input.into());
          66  +
        /* BuilderGenerator.kt:293 */
   43     67   
        self
          68  +
        /* BuilderGenerator.kt:291 */
   44     69   
    }
   45         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          70  +
    /// /* BuilderGenerator.kt:312 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          71  +
    /* BuilderGenerator.kt:314 */
   46     72   
    pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          73  +
        /* BuilderGenerator.kt:315 */
   47     74   
        self.path = input;
   48     75   
        self
          76  +
        /* BuilderGenerator.kt:314 */
   49     77   
    }
   50         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          78  +
    /// /* BuilderGenerator.kt:334 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          79  +
    /* BuilderGenerator.kt:336 */
   51     80   
    pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
          81  +
        /* BuilderGenerator.kt:337 */
   52     82   
        &self.path
          83  +
        /* BuilderGenerator.kt:336 */
   53     84   
    }
   54         -
    /// A detailed description of the validation failure.
   55         -
    /// This field is required.
          85  +
    /// /* BuilderGenerator.kt:286 */A detailed description of the validation failure.
          86  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          87  +
    /* BuilderGenerator.kt:291 */
   56     88   
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          89  +
        /* BuilderGenerator.kt:292 */
   57     90   
        self.message = ::std::option::Option::Some(input.into());
          91  +
        /* BuilderGenerator.kt:293 */
   58     92   
        self
          93  +
        /* BuilderGenerator.kt:291 */
   59     94   
    }
   60         -
    /// A detailed description of the validation failure.
          95  +
    /// /* BuilderGenerator.kt:312 */A detailed description of the validation failure.
          96  +
    /* BuilderGenerator.kt:314 */
   61     97   
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          98  +
        /* BuilderGenerator.kt:315 */
   62     99   
        self.message = input;
   63    100   
        self
         101  +
        /* BuilderGenerator.kt:314 */
   64    102   
    }
   65         -
    /// A detailed description of the validation failure.
         103  +
    /// /* BuilderGenerator.kt:334 */A detailed description of the validation failure.
         104  +
    /* BuilderGenerator.kt:336 */
   66    105   
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
         106  +
        /* BuilderGenerator.kt:337 */
   67    107   
        &self.message
         108  +
        /* BuilderGenerator.kt:336 */
   68    109   
    }
   69         -
    /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::types::ValidationExceptionField).
   70         -
    /// This method will fail if any of the following fields are not set:
   71         -
    /// - [`path`](crate::types::builders::ValidationExceptionFieldBuilder::path)
   72         -
    /// - [`message`](crate::types::builders::ValidationExceptionFieldBuilder::message)
         110  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ValidationExceptionField`](crate::types::ValidationExceptionField).
         111  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
         112  +
    /// /* BuilderGenerator.kt:246 */- [`path`](crate::types::builders::ValidationExceptionFieldBuilder::path)
         113  +
    /// /* BuilderGenerator.kt:246 */- [`message`](crate::types::builders::ValidationExceptionFieldBuilder::message)
         114  +
    /* BuilderGenerator.kt:253 */
   73    115   
    pub fn build(self) -> ::std::result::Result<crate::types::ValidationExceptionField, ::aws_smithy_types::error::operation::BuildError> {
   74         -
        ::std::result::Result::Ok(crate::types::ValidationExceptionField {
   75         -
            path: self.path.ok_or_else(|| {
   76         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   77         -
                    "path",
   78         -
                    "path was not specified but it is required when building ValidationExceptionField",
   79         -
                )
   80         -
            })?,
   81         -
            message: self.message.ok_or_else(|| {
   82         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
   83         -
                    "message",
   84         -
                    "message was not specified but it is required when building ValidationExceptionField",
   85         -
                )
   86         -
            })?,
   87         -
        })
         116  +
        /* BuilderGenerator.kt:254 */
         117  +
        ::std::result::Result::Ok(
         118  +
            /* BuilderGenerator.kt:477 */crate::types::ValidationExceptionField {
         119  +
                /* BuilderGenerator.kt:481 */path: self.path
         120  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         121  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("path", "path was not specified but it is required when building ValidationExceptionField")
         122  +
                    /* BuilderGenerator.kt:494 */)?
         123  +
                ,
         124  +
                /* BuilderGenerator.kt:481 */message: self.message
         125  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         126  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("message", "message was not specified but it is required when building ValidationExceptionField")
         127  +
                    /* BuilderGenerator.kt:494 */)?
         128  +
                ,
         129  +
            /* BuilderGenerator.kt:477 */}
         130  +
        /* BuilderGenerator.kt:254 */)
         131  +
        /* BuilderGenerator.kt:253 */
   88    132   
    }
         133  +
    /* BuilderGenerator.kt:355 */
   89    134   
}

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

@@ -1,1 +47,88 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct Vec {
           8  +
pub /* StructureGenerator.kt:201 */ struct Vec {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub pv_member: ::std::option::Option<bool>,
          12  +
    /* StructureGenerator.kt:201 */
    8     13   
}
          14  +
/* StructureGenerator.kt:135 */
    9     15   
impl Vec {
          16  +
    /* StructureGenerator.kt:231 */
   10     17   
    #[allow(missing_docs)] // documentation missing in model
          18  +
                           /* StructureGenerator.kt:166 */
   11     19   
    pub fn pv_member(&self) -> ::std::option::Option<bool> {
          20  +
        /* StructureGenerator.kt:168 */
   12     21   
        self.pv_member
          22  +
        /* StructureGenerator.kt:166 */
   13     23   
    }
          24  +
    /* StructureGenerator.kt:135 */
   14     25   
}
          26  +
/* ClientCodegenVisitor.kt:237 */
   15     27   
impl Vec {
   16         -
    /// Creates a new builder-style object to manufacture [`Vec`](crate::types::Vec).
          28  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`Vec`](crate::types::Vec).
          29  +
    /* BuilderGenerator.kt:175 */
   17     30   
    pub fn builder() -> crate::types::builders::VecBuilder {
          31  +
        /* BuilderGenerator.kt:176 */
   18     32   
        crate::types::builders::VecBuilder::default()
          33  +
        /* BuilderGenerator.kt:175 */
   19     34   
    }
          35  +
    /* ClientCodegenVisitor.kt:237 */
   20     36   
}
   21     37   
   22         -
/// A builder for [`Vec`](crate::types::Vec).
          38  +
/// /* BuilderGenerator.kt:342 */A builder for [`Vec`](crate::types::Vec).
          39  +
/* RustType.kt:516 */
   23     40   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          41  +
/* RustType.kt:516 */
   24     42   
#[non_exhaustive]
          43  +
/* BuilderGenerator.kt:345 */
   25     44   
pub struct VecBuilder {
   26         -
    pub(crate) pv_member: ::std::option::Option<bool>,
          45  +
    /* BuilderGenerator.kt:275 */ pub(crate) pv_member: ::std::option::Option<bool>,
          46  +
    /* BuilderGenerator.kt:345 */
   27     47   
}
          48  +
/* BuilderGenerator.kt:355 */
   28     49   
impl VecBuilder {
          50  +
    /* BuilderGenerator.kt:286 */
   29     51   
    #[allow(missing_docs)] // documentation missing in model
          52  +
                           /* BuilderGenerator.kt:291 */
   30     53   
    pub fn pv_member(mut self, input: bool) -> Self {
          54  +
        /* BuilderGenerator.kt:292 */
   31     55   
        self.pv_member = ::std::option::Option::Some(input);
          56  +
        /* BuilderGenerator.kt:293 */
   32     57   
        self
          58  +
        /* BuilderGenerator.kt:291 */
   33     59   
    }
          60  +
    /* BuilderGenerator.kt:312 */
   34     61   
    #[allow(missing_docs)] // documentation missing in model
          62  +
                           /* BuilderGenerator.kt:314 */
   35     63   
    pub fn set_pv_member(mut self, input: ::std::option::Option<bool>) -> Self {
          64  +
        /* BuilderGenerator.kt:315 */
   36     65   
        self.pv_member = input;
   37     66   
        self
          67  +
        /* BuilderGenerator.kt:314 */
   38     68   
    }
          69  +
    /* BuilderGenerator.kt:334 */
   39     70   
    #[allow(missing_docs)] // documentation missing in model
          71  +
                           /* BuilderGenerator.kt:336 */
   40     72   
    pub fn get_pv_member(&self) -> &::std::option::Option<bool> {
          73  +
        /* BuilderGenerator.kt:337 */
   41     74   
        &self.pv_member
          75  +
        /* BuilderGenerator.kt:336 */
   42     76   
    }
   43         -
    /// Consumes the builder and constructs a [`Vec`](crate::types::Vec).
          77  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`Vec`](crate::types::Vec).
          78  +
    /* BuilderGenerator.kt:253 */
   44     79   
    pub fn build(self) -> crate::types::Vec {
   45         -
        crate::types::Vec { pv_member: self.pv_member }
          80  +
        /* BuilderGenerator.kt:477 */
          81  +
        crate::types::Vec {
          82  +
            /* BuilderGenerator.kt:481 */ pv_member: self.pv_member,
          83  +
            /* BuilderGenerator.kt:477 */
          84  +
        }
          85  +
        /* BuilderGenerator.kt:253 */
   46     86   
    }
          87  +
    /* BuilderGenerator.kt:355 */
   47     88   
}

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

@@ -1,1 +4,6 @@
    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::ValidationExceptionFieldBuilder;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::_vec::VecBuilder;

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

@@ -1,1 +15,21 @@
    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::error::_validation_exception::ValidationException;
    3      4   
           5  +
/* CodegenDelegator.kt:255 */
    4      6   
pub use crate::types::error::_colliding_exception::CollidingException;
    5      7   
           8  +
/* CodegenDelegator.kt:255 */
    6      9   
pub use crate::types::error::_colliding_error::CollidingError;
    7     10   
          11  +
/* RustModule.kt:172 */
    8     12   
mod _colliding_error;
    9     13   
          14  +
/* RustModule.kt:172 */
   10     15   
mod _colliding_exception;
   11     16   
          17  +
/* RustModule.kt:172 */
   12     18   
mod _validation_exception;
   13     19   
   14         -
/// Builders
          20  +
/// /* CodegenDelegator.kt:51 */Builders
   15     21   
pub mod builders;

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/types/error/_colliding_error.rs

@@ -1,1 +80,133 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    4      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    5         -
pub struct CollidingError {
           8  +
pub /* StructureGenerator.kt:201 */ struct CollidingError {
           9  +
    /* StructureGenerator.kt:231 */
    6     10   
    #[allow(missing_docs)] // documentation missing in model
    7     11   
    pub message: ::std::option::Option<::std::string::String>,
    8         -
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          12  +
    /* ErrorGenerator.kt:53 */ pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          13  +
    /* StructureGenerator.kt:201 */
    9     14   
}
          15  +
/* ErrorImplGenerator.kt:99 */
   10     16   
impl CollidingError {
          17  +
    /* ErrorImplGenerator.kt:128 */
   11     18   
    /// Returns the error message.
   12     19   
    pub fn message(&self) -> ::std::option::Option<&str> {
   13     20   
        self.message.as_deref()
   14     21   
    }
          22  +
    /* ErrorImplGenerator.kt:99 */
   15     23   
}
          24  +
/* ErrorImplGenerator.kt:153 */
   16     25   
impl ::std::fmt::Display for CollidingError {
          26  +
    /* ErrorImplGenerator.kt:154 */
   17     27   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          28  +
        /* ErrorImplGenerator.kt:161 */
   18     29   
        ::std::write!(f, "CollidingError")?;
          30  +
        /* ErrorImplGenerator.kt:166 */
   19     31   
        if let ::std::option::Option::Some(inner_1) = &self.message {
          32  +
            /* ErrorImplGenerator.kt:166 */
   20     33   
            {
          34  +
                /* ErrorImplGenerator.kt:167 */
   21     35   
                ::std::write!(f, ": {}", inner_1)?;
          36  +
                /* ErrorImplGenerator.kt:166 */
   22     37   
            }
          38  +
            /* ErrorImplGenerator.kt:166 */
   23     39   
        }
          40  +
        /* ErrorImplGenerator.kt:171 */
   24     41   
        Ok(())
          42  +
        /* ErrorImplGenerator.kt:154 */
   25     43   
    }
          44  +
    /* ErrorImplGenerator.kt:153 */
   26     45   
}
          46  +
/* ErrorImplGenerator.kt:175 */
   27     47   
impl ::std::error::Error for CollidingError {}
          48  +
/* ErrorGenerator.kt:77 */
   28     49   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CollidingError {
          50  +
    /* ErrorGenerator.kt:78 */
   29     51   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
   30     52   
        &self.meta
   31     53   
    }
          54  +
    /* ErrorGenerator.kt:77 */
   32     55   
}
          56  +
/* ErrorGenerator.kt:81 */
   33     57   
impl CollidingError {
   34         -
    /// Creates a new builder-style object to manufacture [`CollidingError`](crate::types::error::CollidingError).
          58  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CollidingError`](crate::types::error::CollidingError).
          59  +
    /* BuilderGenerator.kt:175 */
   35     60   
    pub fn builder() -> crate::types::error::builders::CollidingErrorBuilder {
          61  +
        /* BuilderGenerator.kt:176 */
   36     62   
        crate::types::error::builders::CollidingErrorBuilder::default()
          63  +
        /* BuilderGenerator.kt:175 */
   37     64   
    }
          65  +
    /* ErrorGenerator.kt:81 */
   38     66   
}
   39     67   
   40         -
/// A builder for [`CollidingError`](crate::types::error::CollidingError).
          68  +
/// /* BuilderGenerator.kt:342 */A builder for [`CollidingError`](crate::types::error::CollidingError).
          69  +
/* RustType.kt:516 */
   41     70   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          71  +
/* RustType.kt:516 */
   42     72   
#[non_exhaustive]
          73  +
/* BuilderGenerator.kt:345 */
   43     74   
pub struct CollidingErrorBuilder {
   44         -
    pub(crate) message: ::std::option::Option<::std::string::String>,
   45         -
    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          75  +
    /* BuilderGenerator.kt:275 */ pub(crate) message: ::std::option::Option<::std::string::String>,
          76  +
    /* ErrorGenerator.kt:97 */ meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          77  +
    /* BuilderGenerator.kt:345 */
   46     78   
}
          79  +
/* BuilderGenerator.kt:355 */
   47     80   
impl CollidingErrorBuilder {
          81  +
    /* BuilderGenerator.kt:286 */
   48     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* BuilderGenerator.kt:291 */
   49     84   
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          85  +
        /* BuilderGenerator.kt:292 */
   50     86   
        self.message = ::std::option::Option::Some(input.into());
          87  +
        /* BuilderGenerator.kt:293 */
   51     88   
        self
          89  +
        /* BuilderGenerator.kt:291 */
   52     90   
    }
          91  +
    /* BuilderGenerator.kt:312 */
   53     92   
    #[allow(missing_docs)] // documentation missing in model
          93  +
                           /* BuilderGenerator.kt:314 */
   54     94   
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          95  +
        /* BuilderGenerator.kt:315 */
   55     96   
        self.message = input;
   56     97   
        self
          98  +
        /* BuilderGenerator.kt:314 */
   57     99   
    }
         100  +
    /* BuilderGenerator.kt:334 */
   58    101   
    #[allow(missing_docs)] // documentation missing in model
         102  +
                           /* BuilderGenerator.kt:336 */
   59    103   
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
         104  +
        /* BuilderGenerator.kt:337 */
   60    105   
        &self.message
         106  +
        /* BuilderGenerator.kt:336 */
   61    107   
    }
         108  +
    /* ErrorGenerator.kt:101 */
   62    109   
    /// Sets error metadata
   63    110   
    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
   64    111   
        self.meta = Some(meta);
   65    112   
        self
   66    113   
    }
   67    114   
   68    115   
    /// Sets error metadata
   69    116   
    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
   70    117   
        self.meta = meta;
   71    118   
        self
   72    119   
    }
   73         -
    /// Consumes the builder and constructs a [`CollidingError`](crate::types::error::CollidingError).
         120  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CollidingError`](crate::types::error::CollidingError).
         121  +
    /* BuilderGenerator.kt:253 */
   74    122   
    pub fn build(self) -> crate::types::error::CollidingError {
         123  +
        /* BuilderGenerator.kt:477 */
   75    124   
        crate::types::error::CollidingError {
   76         -
            message: self.message,
         125  +
            /* BuilderGenerator.kt:481 */ message: self.message,
         126  +
            /* ErrorGenerator.kt:120 */
   77    127   
            meta: self.meta.unwrap_or_default(),
         128  +
            /* BuilderGenerator.kt:477 */
   78    129   
        }
         130  +
        /* BuilderGenerator.kt:253 */
   79    131   
    }
         132  +
    /* BuilderGenerator.kt:355 */
   80    133   
}

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/types/error/_colliding_exception.rs

@@ -1,1 +81,133 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// This will be renamed to CollidingError
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */This will be renamed to CollidingError
           4  +
/* RustType.kt:516 */
    4      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    5      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct CollidingException {
           8  +
pub /* StructureGenerator.kt:201 */ struct CollidingException {
           9  +
    /* StructureGenerator.kt:231 */
    7     10   
    #[allow(missing_docs)] // documentation missing in model
    8     11   
    pub message: ::std::option::Option<::std::string::String>,
    9         -
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          12  +
    /* ErrorGenerator.kt:53 */ pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          13  +
    /* StructureGenerator.kt:201 */
   10     14   
}
          15  +
/* ErrorImplGenerator.kt:99 */
   11     16   
impl CollidingException {
          17  +
    /* ErrorImplGenerator.kt:128 */
   12     18   
    /// Returns the error message.
   13     19   
    pub fn message(&self) -> ::std::option::Option<&str> {
   14     20   
        self.message.as_deref()
   15     21   
    }
          22  +
    /* ErrorImplGenerator.kt:99 */
   16     23   
}
          24  +
/* ErrorImplGenerator.kt:153 */
   17     25   
impl ::std::fmt::Display for CollidingException {
          26  +
    /* ErrorImplGenerator.kt:154 */
   18     27   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          28  +
        /* ErrorImplGenerator.kt:161 */
   19     29   
        ::std::write!(f, "CollidingException")?;
          30  +
        /* ErrorImplGenerator.kt:166 */
   20     31   
        if let ::std::option::Option::Some(inner_1) = &self.message {
          32  +
            /* ErrorImplGenerator.kt:166 */
   21     33   
            {
          34  +
                /* ErrorImplGenerator.kt:167 */
   22     35   
                ::std::write!(f, ": {}", inner_1)?;
          36  +
                /* ErrorImplGenerator.kt:166 */
   23     37   
            }
          38  +
            /* ErrorImplGenerator.kt:166 */
   24     39   
        }
          40  +
        /* ErrorImplGenerator.kt:171 */
   25     41   
        Ok(())
          42  +
        /* ErrorImplGenerator.kt:154 */
   26     43   
    }
          44  +
    /* ErrorImplGenerator.kt:153 */
   27     45   
}
          46  +
/* ErrorImplGenerator.kt:175 */
   28     47   
impl ::std::error::Error for CollidingException {}
          48  +
/* ErrorGenerator.kt:77 */
   29     49   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CollidingException {
          50  +
    /* ErrorGenerator.kt:78 */
   30     51   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
   31     52   
        &self.meta
   32     53   
    }
          54  +
    /* ErrorGenerator.kt:77 */
   33     55   
}
          56  +
/* ErrorGenerator.kt:81 */
   34     57   
impl CollidingException {
   35         -
    /// Creates a new builder-style object to manufacture [`CollidingException`](crate::types::error::CollidingException).
          58  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`CollidingException`](crate::types::error::CollidingException).
          59  +
    /* BuilderGenerator.kt:175 */
   36     60   
    pub fn builder() -> crate::types::error::builders::CollidingExceptionBuilder {
          61  +
        /* BuilderGenerator.kt:176 */
   37     62   
        crate::types::error::builders::CollidingExceptionBuilder::default()
          63  +
        /* BuilderGenerator.kt:175 */
   38     64   
    }
          65  +
    /* ErrorGenerator.kt:81 */
   39     66   
}
   40     67   
   41         -
/// A builder for [`CollidingException`](crate::types::error::CollidingException).
          68  +
/// /* BuilderGenerator.kt:342 */A builder for [`CollidingException`](crate::types::error::CollidingException).
          69  +
/* RustType.kt:516 */
   42     70   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          71  +
/* RustType.kt:516 */
   43     72   
#[non_exhaustive]
          73  +
/* BuilderGenerator.kt:345 */
   44     74   
pub struct CollidingExceptionBuilder {
   45         -
    pub(crate) message: ::std::option::Option<::std::string::String>,
   46         -
    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          75  +
    /* BuilderGenerator.kt:275 */ pub(crate) message: ::std::option::Option<::std::string::String>,
          76  +
    /* ErrorGenerator.kt:97 */ meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          77  +
    /* BuilderGenerator.kt:345 */
   47     78   
}
          79  +
/* BuilderGenerator.kt:355 */
   48     80   
impl CollidingExceptionBuilder {
          81  +
    /* BuilderGenerator.kt:286 */
   49     82   
    #[allow(missing_docs)] // documentation missing in model
          83  +
                           /* BuilderGenerator.kt:291 */
   50     84   
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          85  +
        /* BuilderGenerator.kt:292 */
   51     86   
        self.message = ::std::option::Option::Some(input.into());
          87  +
        /* BuilderGenerator.kt:293 */
   52     88   
        self
          89  +
        /* BuilderGenerator.kt:291 */
   53     90   
    }
          91  +
    /* BuilderGenerator.kt:312 */
   54     92   
    #[allow(missing_docs)] // documentation missing in model
          93  +
                           /* BuilderGenerator.kt:314 */
   55     94   
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
          95  +
        /* BuilderGenerator.kt:315 */
   56     96   
        self.message = input;
   57     97   
        self
          98  +
        /* BuilderGenerator.kt:314 */
   58     99   
    }
         100  +
    /* BuilderGenerator.kt:334 */
   59    101   
    #[allow(missing_docs)] // documentation missing in model
         102  +
                           /* BuilderGenerator.kt:336 */
   60    103   
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
         104  +
        /* BuilderGenerator.kt:337 */
   61    105   
        &self.message
         106  +
        /* BuilderGenerator.kt:336 */
   62    107   
    }
         108  +
    /* ErrorGenerator.kt:101 */
   63    109   
    /// Sets error metadata
   64    110   
    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
   65    111   
        self.meta = Some(meta);
   66    112   
        self
   67    113   
    }
   68    114   
   69    115   
    /// Sets error metadata
   70    116   
    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
   71    117   
        self.meta = meta;
   72    118   
        self
   73    119   
    }
   74         -
    /// Consumes the builder and constructs a [`CollidingException`](crate::types::error::CollidingException).
         120  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`CollidingException`](crate::types::error::CollidingException).
         121  +
    /* BuilderGenerator.kt:253 */
   75    122   
    pub fn build(self) -> crate::types::error::CollidingException {
         123  +
        /* BuilderGenerator.kt:477 */
   76    124   
        crate::types::error::CollidingException {
   77         -
            message: self.message,
         125  +
            /* BuilderGenerator.kt:481 */ message: self.message,
         126  +
            /* ErrorGenerator.kt:120 */
   78    127   
            meta: self.meta.unwrap_or_default(),
         128  +
            /* BuilderGenerator.kt:477 */
   79    129   
        }
         130  +
        /* BuilderGenerator.kt:253 */
   80    131   
    }
         132  +
    /* BuilderGenerator.kt:355 */
   81    133   
}

tmp-codegen-diff/codegen-client-test/naming_test_ops/rust-client-codegen/src/types/error/_validation_exception.rs

@@ -1,1 +119,184 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
           4  +
/* RustType.kt:516 */
    4      5   
#[non_exhaustive]
           6  +
/* RustType.kt:516 */
    5      7   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
    6         -
pub struct ValidationException {
    7         -
    /// A summary of the validation failure.
           8  +
pub /* StructureGenerator.kt:201 */ struct ValidationException {
           9  +
    /// /* StructureGenerator.kt:231 */A summary of the validation failure.
    8     10   
    pub message: ::std::string::String,
    9         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
          11  +
    /// /* StructureGenerator.kt:231 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
   10     12   
    pub field_list: ::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>>,
   11         -
    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          13  +
    /* ErrorGenerator.kt:53 */ pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
          14  +
    /* StructureGenerator.kt:201 */
   12     15   
}
          16  +
/* StructureGenerator.kt:135 */
   13     17   
impl ValidationException {
   14         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
   15         -
    ///
   16         -
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.field_list.is_none()`.
          18  +
    /// /* StructureGenerator.kt:231 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
          19  +
    /// /* StructureGenerator.kt:162 */
          20  +
    /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.field_list.is_none()`.
          21  +
    /* StructureGenerator.kt:166 */
   17     22   
    pub fn field_list(&self) -> &[crate::types::ValidationExceptionField] {
   18         -
        self.field_list.as_deref().unwrap_or_default()
          23  +
        /* StructureGenerator.kt:169 */
          24  +
        self.field_list
          25  +
            .as_deref()
          26  +
            /* StructureGenerator.kt:175 */
          27  +
            .unwrap_or_default()
          28  +
        /* StructureGenerator.kt:166 */
   19     29   
    }
          30  +
    /* StructureGenerator.kt:135 */
   20     31   
}
          32  +
/* ErrorImplGenerator.kt:99 */
   21     33   
impl ValidationException {
          34  +
    /* ErrorImplGenerator.kt:128 */
   22     35   
    /// Returns the error message.
   23     36   
    pub fn message(&self) -> &str {
   24     37   
        &self.message
   25     38   
    }
          39  +
    /* ErrorImplGenerator.kt:99 */
   26     40   
}
          41  +
/* ErrorImplGenerator.kt:153 */
   27     42   
impl ::std::fmt::Display for ValidationException {
          43  +
    /* ErrorImplGenerator.kt:154 */
   28     44   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          45  +
        /* ErrorImplGenerator.kt:161 */
   29     46   
        ::std::write!(f, "ValidationException")?;
          47  +
        /* ErrorImplGenerator.kt:166 */
   30     48   
        {
          49  +
            /* ErrorImplGenerator.kt:167 */
   31     50   
            ::std::write!(f, ": {}", &self.message)?;
          51  +
            /* ErrorImplGenerator.kt:166 */
   32     52   
        }
          53  +
        /* ErrorImplGenerator.kt:171 */
   33     54   
        Ok(())
          55  +
        /* ErrorImplGenerator.kt:154 */
   34     56   
    }
          57  +
    /* ErrorImplGenerator.kt:153 */
   35     58   
}
          59  +
/* ErrorImplGenerator.kt:175 */
   36     60   
impl ::std::error::Error for ValidationException {}
          61  +
/* ErrorGenerator.kt:77 */
   37     62   
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ValidationException {
          63  +
    /* ErrorGenerator.kt:78 */
   38     64   
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
   39     65   
        &self.meta
   40     66   
    }
          67  +
    /* ErrorGenerator.kt:77 */
   41     68   
}
          69  +
/* ErrorGenerator.kt:81 */
   42     70   
impl ValidationException {
   43         -
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::types::error::ValidationException).
          71  +
    /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ValidationException`](crate::types::error::ValidationException).
          72  +
    /* BuilderGenerator.kt:175 */
   44     73   
    pub fn builder() -> crate::types::error::builders::ValidationExceptionBuilder {
          74  +
        /* BuilderGenerator.kt:176 */
   45     75   
        crate::types::error::builders::ValidationExceptionBuilder::default()
          76  +
        /* BuilderGenerator.kt:175 */
   46     77   
    }
          78  +
    /* ErrorGenerator.kt:81 */
   47     79   
}
   48     80   
   49         -
/// A builder for [`ValidationException`](crate::types::error::ValidationException).
          81  +
/// /* BuilderGenerator.kt:342 */A builder for [`ValidationException`](crate::types::error::ValidationException).
          82  +
/* RustType.kt:516 */
   50     83   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
          84  +
/* RustType.kt:516 */
   51     85   
#[non_exhaustive]
          86  +
/* BuilderGenerator.kt:345 */
   52     87   
pub struct ValidationExceptionBuilder {
   53         -
    pub(crate) message: ::std::option::Option<::std::string::String>,
   54         -
    pub(crate) field_list: ::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>>,
   55         -
    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          88  +
    /* BuilderGenerator.kt:275 */ pub(crate) message: ::std::option::Option<::std::string::String>,
          89  +
    /* BuilderGenerator.kt:275 */ pub(crate) field_list: ::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>>,
          90  +
    /* ErrorGenerator.kt:97 */ meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
          91  +
    /* BuilderGenerator.kt:345 */
   56     92   
}
          93  +
/* BuilderGenerator.kt:355 */
   57     94   
impl ValidationExceptionBuilder {
   58         -
    /// A summary of the validation failure.
   59         -
    /// This field is required.
          95  +
    /// /* BuilderGenerator.kt:286 */A summary of the validation failure.
          96  +
    /// /* BuilderGenerator.kt:288 */This field is required.
          97  +
    /* BuilderGenerator.kt:291 */
   60     98   
    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
          99  +
        /* BuilderGenerator.kt:292 */
   61    100   
        self.message = ::std::option::Option::Some(input.into());
         101  +
        /* BuilderGenerator.kt:293 */
   62    102   
        self
         103  +
        /* BuilderGenerator.kt:291 */
   63    104   
    }
   64         -
    /// A summary of the validation failure.
         105  +
    /// /* BuilderGenerator.kt:312 */A summary of the validation failure.
         106  +
    /* BuilderGenerator.kt:314 */
   65    107   
    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         108  +
        /* BuilderGenerator.kt:315 */
   66    109   
        self.message = input;
   67    110   
        self
         111  +
        /* BuilderGenerator.kt:314 */
   68    112   
    }
   69         -
    /// A summary of the validation failure.
         113  +
    /// /* BuilderGenerator.kt:334 */A summary of the validation failure.
         114  +
    /* BuilderGenerator.kt:336 */
   70    115   
    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
         116  +
        /* BuilderGenerator.kt:337 */
   71    117   
        &self.message
         118  +
        /* BuilderGenerator.kt:336 */
   72    119   
    }
   73         -
    /// Appends an item to `field_list`.
         120  +
    /// /* BuilderGenerator.kt:410 */Appends an item to `field_list`.
         121  +
    /* BuilderGenerator.kt:411 */
   74    122   
    ///
   75         -
    /// To override the contents of this collection use [`set_field_list`](Self::set_field_list).
         123  +
    /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_field_list`](Self::set_field_list).
         124  +
    /* BuilderGenerator.kt:413 */
   76    125   
    ///
   77         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         126  +
    /// /* BuilderGenerator.kt:414 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         127  +
    /* BuilderGenerator.kt:418 */
   78    128   
    pub fn field_list(mut self, input: crate::types::ValidationExceptionField) -> Self {
         129  +
        /* BuilderGenerator.kt:419 */
   79    130   
        let mut v = self.field_list.unwrap_or_default();
   80    131   
        v.push(input);
   81    132   
        self.field_list = ::std::option::Option::Some(v);
   82    133   
        self
         134  +
        /* BuilderGenerator.kt:418 */
   83    135   
    }
   84         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         136  +
    /// /* BuilderGenerator.kt:312 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         137  +
    /* BuilderGenerator.kt:314 */
   85    138   
    pub fn set_field_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>>) -> Self {
         139  +
        /* BuilderGenerator.kt:315 */
   86    140   
        self.field_list = input;
   87    141   
        self
         142  +
        /* BuilderGenerator.kt:314 */
   88    143   
    }
   89         -
    /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         144  +
    /// /* BuilderGenerator.kt:334 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
         145  +
    /* BuilderGenerator.kt:336 */
   90    146   
    pub fn get_field_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>> {
         147  +
        /* BuilderGenerator.kt:337 */
   91    148   
        &self.field_list
         149  +
        /* BuilderGenerator.kt:336 */
   92    150   
    }
         151  +
    /* ErrorGenerator.kt:101 */
   93    152   
    /// Sets error metadata
   94    153   
    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
   95    154   
        self.meta = Some(meta);
   96    155   
        self
   97    156   
    }
   98    157   
   99    158   
    /// Sets error metadata
  100    159   
    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
  101    160   
        self.meta = meta;
  102    161   
        self
  103    162   
    }
  104         -
    /// Consumes the builder and constructs a [`ValidationException`](crate::types::error::ValidationException).
  105         -
    /// This method will fail if any of the following fields are not set:
  106         -
    /// - [`message`](crate::types::error::builders::ValidationExceptionBuilder::message)
         163  +
    /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ValidationException`](crate::types::error::ValidationException).
         164  +
    /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
         165  +
    /// /* BuilderGenerator.kt:246 */- [`message`](crate::types::error::builders::ValidationExceptionBuilder::message)
         166  +
    /* BuilderGenerator.kt:253 */
  107    167   
    pub fn build(self) -> ::std::result::Result<crate::types::error::ValidationException, ::aws_smithy_types::error::operation::BuildError> {
  108         -
        ::std::result::Result::Ok(crate::types::error::ValidationException {
  109         -
            message: self.message.ok_or_else(|| {
  110         -
                ::aws_smithy_types::error::operation::BuildError::missing_field(
  111         -
                    "message",
  112         -
                    "message was not specified but it is required when building ValidationException",
  113         -
                )
  114         -
            })?,
  115         -
            field_list: self.field_list,
  116         -
            meta: self.meta.unwrap_or_default(),
  117         -
        })
         168  +
        /* BuilderGenerator.kt:254 */
         169  +
        ::std::result::Result::Ok(
         170  +
            /* BuilderGenerator.kt:477 */crate::types::error::ValidationException {
         171  +
                /* BuilderGenerator.kt:481 */message: self.message
         172  +
                    /* BuilderGenerator.kt:494 */.ok_or_else(||
         173  +
                        /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("message", "message was not specified but it is required when building ValidationException")
         174  +
                    /* BuilderGenerator.kt:494 */)?
         175  +
                ,
         176  +
                /* BuilderGenerator.kt:481 */field_list: self.field_list
         177  +
                ,
         178  +
                /* ErrorGenerator.kt:120 */meta: self.meta.unwrap_or_default(),
         179  +
            /* BuilderGenerator.kt:477 */}
         180  +
        /* BuilderGenerator.kt:254 */)
         181  +
        /* BuilderGenerator.kt:253 */
  118    182   
    }
         183  +
    /* BuilderGenerator.kt:355 */
  119    184   
}