Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_operation_with_required_members_output.rs

@@ -1,1 +93,150 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_operation_with_required_members_output_output_output(
    3      4   
    value: &crate::output::OperationWithRequiredMembersOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_operation_with_required_members_output::ser_operation_with_required_members_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_operation_with_required_members_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::OperationWithRequiredMembersOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* SerializerUtil.kt:42 */
   16     23   
    {
          24  +
        /* JsonSerializerGenerator.kt:423 */
   17     25   
        object
   18     26   
            .key("requiredString")
   19     27   
            .string(input.required_string.as_str());
          28  +
        /* SerializerUtil.kt:42 */
   20     29   
    }
          30  +
    /* SerializerUtil.kt:42 */
   21     31   
    {
          32  +
        /* JsonSerializerGenerator.kt:424 */
   22     33   
        object
   23     34   
            .key("requiredBoolean")
   24     35   
            .boolean(input.required_boolean);
          36  +
        /* SerializerUtil.kt:42 */
   25     37   
    }
          38  +
    /* SerializerUtil.kt:42 */
   26     39   
    {
          40  +
        /* JsonSerializerGenerator.kt:484 */
   27     41   
        let mut array_1 = object.key("requiredList").start_array();
          42  +
        /* JsonSerializerGenerator.kt:524 */
   28     43   
        for item_2 in &input.required_list {
          44  +
            /* SerializerUtil.kt:42 */
   29     45   
            {
          46  +
                /* JsonSerializerGenerator.kt:423 */
   30     47   
                array_1.value().string(item_2.as_str());
          48  +
                /* SerializerUtil.kt:42 */
   31     49   
            }
          50  +
            /* JsonSerializerGenerator.kt:524 */
   32     51   
        }
          52  +
        /* JsonSerializerGenerator.kt:486 */
   33     53   
        array_1.finish();
          54  +
        /* SerializerUtil.kt:42 */
   34     55   
    }
          56  +
    /* SerializerUtil.kt:42 */
   35     57   
    {
          58  +
        /* JsonSerializerGenerator.kt:448 */
   36     59   
        object.key("requiredTimestamp").date_time(
   37     60   
            &input.required_timestamp,
   38     61   
            ::aws_smithy_types::date_time::Format::EpochSeconds,
   39     62   
        )?;
          63  +
        /* SerializerUtil.kt:42 */
   40     64   
    }
          65  +
    /* SerializerUtil.kt:42 */
   41     66   
    {
          67  +
        /* JsonSerializerGenerator.kt:439 */
   42     68   
        object
   43     69   
            .key("requiredBlob")
   44     70   
            .string_unchecked(&::aws_smithy_types::base64::encode(&input.required_blob));
          71  +
        /* SerializerUtil.kt:42 */
   45     72   
    }
          73  +
    /* SerializerUtil.kt:42 */
   46     74   
    {
          75  +
        /* JsonSerializerGenerator.kt:432 */
   47     76   
        object.key("requiredByte").number(
   48     77   
            #[allow(clippy::useless_conversion)]
   49     78   
            ::aws_smithy_types::Number::NegInt((input.required_byte).into()),
   50     79   
        );
          80  +
        /* SerializerUtil.kt:42 */
   51     81   
    }
          82  +
    /* SerializerUtil.kt:42 */
   52     83   
    {
          84  +
        /* JsonSerializerGenerator.kt:432 */
   53     85   
        object.key("requiredShort").number(
   54     86   
            #[allow(clippy::useless_conversion)]
   55     87   
            ::aws_smithy_types::Number::NegInt((input.required_short).into()),
   56     88   
        );
          89  +
        /* SerializerUtil.kt:42 */
   57     90   
    }
          91  +
    /* SerializerUtil.kt:42 */
   58     92   
    {
          93  +
        /* JsonSerializerGenerator.kt:432 */
   59     94   
        object.key("requiredInteger").number(
   60     95   
            #[allow(clippy::useless_conversion)]
   61     96   
            ::aws_smithy_types::Number::NegInt((input.required_integer).into()),
   62     97   
        );
          98  +
        /* SerializerUtil.kt:42 */
   63     99   
    }
         100  +
    /* SerializerUtil.kt:42 */
   64    101   
    {
         102  +
        /* JsonSerializerGenerator.kt:432 */
   65    103   
        object.key("requiredLong").number(
   66    104   
            #[allow(clippy::useless_conversion)]
   67    105   
            ::aws_smithy_types::Number::NegInt((input.required_long).into()),
   68    106   
        );
         107  +
        /* SerializerUtil.kt:42 */
   69    108   
    }
         109  +
    /* SerializerUtil.kt:42 */
   70    110   
    {
         111  +
        /* JsonSerializerGenerator.kt:432 */
   71    112   
        object.key("requiredFloat").number(
   72    113   
            #[allow(clippy::useless_conversion)]
   73    114   
            ::aws_smithy_types::Number::Float((input.required_float).into()),
   74    115   
        );
         116  +
        /* SerializerUtil.kt:42 */
   75    117   
    }
         118  +
    /* SerializerUtil.kt:42 */
   76    119   
    {
         120  +
        /* JsonSerializerGenerator.kt:432 */
   77    121   
        object.key("requiredDouble").number(
   78    122   
            #[allow(clippy::useless_conversion)]
   79    123   
            ::aws_smithy_types::Number::Float((input.required_double).into()),
   80    124   
        );
         125  +
        /* SerializerUtil.kt:42 */
   81    126   
    }
         127  +
    /* SerializerUtil.kt:42 */
   82    128   
    {
         129  +
        /* JsonSerializerGenerator.kt:495 */
   83    130   
        #[allow(unused_mut)]
         131  +
        /* JsonSerializerGenerator.kt:496 */
   84    132   
        let mut object_3 = object.key("requiredMap").start_object();
         133  +
        /* JsonSerializerGenerator.kt:537 */
   85    134   
        for (key_4, value_5) in &input.required_map {
         135  +
            /* SerializerUtil.kt:42 */
   86    136   
            {
         137  +
                /* JsonSerializerGenerator.kt:423 */
   87    138   
                object_3.key(key_4.as_str()).string(value_5.as_str());
         139  +
                /* SerializerUtil.kt:42 */
   88    140   
            }
         141  +
            /* JsonSerializerGenerator.kt:537 */
   89    142   
        }
         143  +
        /* JsonSerializerGenerator.kt:515 */
   90    144   
        object_3.finish();
         145  +
        /* SerializerUtil.kt:42 */
   91    146   
    }
         147  +
    /* JsonSerializerGenerator.kt:372 */
   92    148   
    Ok(())
         149  +
    /* JsonSerializerGenerator.kt:358 */
   93    150   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_put_with_content_encoding.rs

@@ -1,1 +119,177 @@
    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  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_put_with_content_encoding_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::PutWithContentEncodingInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::put_with_content_encoding_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.0"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding(bytes.as_ref(), input)?;
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   29     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     42   
        input.build()
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     44   
    })
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     46   
}
   33     47   
          48  +
/* RustType.kt:516 */
   34     49   
#[allow(clippy::unnecessary_wraps)]
          50  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     51   
pub fn ser_put_with_content_encoding_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::PutWithContentEncodingOutput,
   37     53   
) -> std::result::Result<
   38     54   
    ::aws_smithy_http_server::response::Response,
   39     55   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     56   
> {
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     58   
    Ok({
          59  +
        /* RustType.kt:516 */
   42     60   
        #[allow(unused_mut)]
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     62   
        let mut builder = ::http::Response::builder();
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     65   
            builder,
   46     66   
            ::http::header::CONTENT_TYPE,
   47     67   
            "application/x-amz-json-1.0",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
   51         -
        let payload = "";
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          73  +
        let payload =
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   52     77   
        let content_length = payload.len();
   53     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     79   
            builder,
   55     80   
            ::http::header::CONTENT_LENGTH,
   56     81   
            content_length,
   57     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   58     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   59     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   60     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   61     90   
}
   62     91   
          92  +
/* JsonParserGenerator.kt:148 */
   63     93   
pub(crate) fn de_put_with_content_encoding(
   64     94   
    value: &[u8],
   65     95   
    mut builder: crate::input::put_with_content_encoding_input::Builder,
   66     96   
) -> ::std::result::Result<
   67     97   
    crate::input::put_with_content_encoding_input::Builder,
   68     98   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   69     99   
> {
         100  +
    /* JsonParserGenerator.kt:153 */
   70    101   
    let mut tokens_owned =
   71    102   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
   72    103   
            .peekable();
   73    104   
    let tokens = &mut tokens_owned;
   74    105   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         106  +
    /* JsonParserGenerator.kt:684 */
   75    107   
    loop {
         108  +
        /* JsonParserGenerator.kt:685 */
   76    109   
        match tokens.next().transpose()? {
         110  +
            /* JsonParserGenerator.kt:686 */
   77    111   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   78    112   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         113  +
                /* JsonParserGenerator.kt:260 */
   79    114   
                match key.to_unescaped()?.as_ref() {
         115  +
                    /* JsonParserGenerator.kt:262 */
   80    116   
                    "encoding" => {
         117  +
                        /* JsonParserGenerator.kt:272 */
   81    118   
                        builder = builder.set_encoding(
         119  +
                            /* JsonParserGenerator.kt:354 */
   82    120   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   83    121   
                                tokens.next(),
   84    122   
                            )?
   85         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   86         -
                            .transpose()?,
         123  +
                            .map(|s|
         124  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         125  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         126  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         127  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
   87    128   
                        );
         129  +
                        /* JsonParserGenerator.kt:262 */
   88    130   
                    }
         131  +
                    /* JsonParserGenerator.kt:262 */
   89    132   
                    "data" => {
         133  +
                        /* JsonParserGenerator.kt:272 */
   90    134   
                        builder = builder.set_data(
         135  +
                            /* JsonParserGenerator.kt:354 */
   91    136   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   92    137   
                                tokens.next(),
   93    138   
                            )?
   94         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   95         -
                            .transpose()?,
         139  +
                            .map(|s|
         140  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         141  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         142  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         143  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
   96    144   
                        );
         145  +
                        /* JsonParserGenerator.kt:262 */
   97    146   
                    }
   98         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         147  +
                    /* JsonParserGenerator.kt:290 */
         148  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   99    149   
                }
         150  +
                /* JsonParserGenerator.kt:686 */
  100    151   
            }
         152  +
            /* JsonParserGenerator.kt:695 */
  101    153   
            other => {
  102    154   
                return Err(
  103    155   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  104    156   
                        "expected object key or end object, found: {:?}",
  105    157   
                        other
  106    158   
                    )),
  107    159   
                )
         160  +
            } /* JsonParserGenerator.kt:685 */
  108    161   
        }
         162  +
        /* JsonParserGenerator.kt:684 */
  109    163   
    }
  110         -
    }
         164  +
    /* JsonParserGenerator.kt:250 */
  111    165   
    if tokens.next().is_some() {
         166  +
        /* JsonParserGenerator.kt:251 */
  112    167   
        return Err(
  113    168   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  114    169   
                "found more JSON tokens after completing parsing",
  115    170   
            ),
  116    171   
        );
         172  +
        /* JsonParserGenerator.kt:250 */
  117    173   
    }
         174  +
    /* JsonParserGenerator.kt:163 */
  118    175   
    Ok(builder)
         176  +
    /* JsonParserGenerator.kt:148 */
  119    177   
}

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

@@ -1,1 +123,173 @@
    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  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_simple_scalar_properties_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::SimpleScalarPropertiesInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::simple_scalar_properties_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.0"),
   27     37   
            )?;
   28     38   
            input =
   29     39   
                crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties(
   30     40   
                    bytes.as_ref(),
   31     41   
                    input,
   32     42   
                )?;
          43  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   33     44   
        }
          45  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   34     46   
        input.build()
          47  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   35     48   
    })
          49  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   36     50   
}
   37     51   
          52  +
/* RustType.kt:516 */
   38     53   
#[allow(clippy::unnecessary_wraps)]
          54  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   39     55   
pub fn ser_simple_scalar_properties_http_response(
   40     56   
    #[allow(unused_variables)] output: crate::output::SimpleScalarPropertiesOutput,
   41     57   
) -> std::result::Result<
   42     58   
    ::aws_smithy_http_server::response::Response,
   43     59   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   44     60   
> {
          61  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   45     62   
    Ok({
          63  +
        /* RustType.kt:516 */
   46     64   
        #[allow(unused_mut)]
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   47     66   
        let mut builder = ::http::Response::builder();
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   48     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     69   
            builder,
   50     70   
            ::http::header::CONTENT_TYPE,
   51     71   
            "application/x-amz-json-1.0",
   52     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   53     74   
        let http_status: u16 = 200;
   54     75   
        builder = builder.status(http_status);
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   55     77   
        let payload =
   56         -
            crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_output_output_output(&output)?
   57         -
        ;
          78  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_output_output_output(&output)?
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          80  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   58     81   
        let content_length = payload.len();
   59     82   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   60     83   
            builder,
   61     84   
            ::http::header::CONTENT_LENGTH,
   62     85   
            content_length,
   63     86   
        );
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   64     88   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          89  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   65     90   
        builder.body(body)?
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   66     92   
    })
          93  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   67     94   
}
   68     95   
          96  +
/* JsonParserGenerator.kt:148 */
   69     97   
pub(crate) fn de_simple_scalar_properties(
   70     98   
    value: &[u8],
   71     99   
    mut builder: crate::input::simple_scalar_properties_input::Builder,
   72    100   
) -> ::std::result::Result<
   73    101   
    crate::input::simple_scalar_properties_input::Builder,
   74    102   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   75    103   
> {
         104  +
    /* JsonParserGenerator.kt:153 */
   76    105   
    let mut tokens_owned =
   77    106   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
   78    107   
            .peekable();
   79    108   
    let tokens = &mut tokens_owned;
   80    109   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         110  +
    /* JsonParserGenerator.kt:684 */
   81    111   
    loop {
         112  +
        /* JsonParserGenerator.kt:685 */
   82    113   
        match tokens.next().transpose()? {
         114  +
            /* JsonParserGenerator.kt:686 */
   83    115   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   84    116   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         117  +
                /* JsonParserGenerator.kt:260 */
   85    118   
                match key.to_unescaped()?.as_ref() {
         119  +
                    /* JsonParserGenerator.kt:262 */
   86    120   
                    "floatValue" => {
         121  +
                        /* JsonParserGenerator.kt:272 */
   87    122   
                        builder = builder.set_float_value(
         123  +
                            /* JsonParserGenerator.kt:361 */
   88    124   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
   89    125   
                                tokens.next(),
   90    126   
                            )?
   91         -
                            .map(|v| v.to_f32_lossy()),
         127  +
                            .map(|v| v.to_f32_lossy()), /* JsonParserGenerator.kt:272 */
   92    128   
                        );
         129  +
                        /* JsonParserGenerator.kt:262 */
   93    130   
                    }
         131  +
                    /* JsonParserGenerator.kt:262 */
   94    132   
                    "doubleValue" => {
         133  +
                        /* JsonParserGenerator.kt:272 */
   95    134   
                        builder = builder.set_double_value(
         135  +
                            /* JsonParserGenerator.kt:363 */
   96    136   
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
   97    137   
                                tokens.next(),
   98    138   
                            )?
   99         -
                            .map(|v| v.to_f64_lossy()),
         139  +
                            .map(|v| v.to_f64_lossy()), /* JsonParserGenerator.kt:272 */
  100    140   
                        );
         141  +
                        /* JsonParserGenerator.kt:262 */
  101    142   
                    }
  102         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         143  +
                    /* JsonParserGenerator.kt:290 */
         144  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  103    145   
                }
         146  +
                /* JsonParserGenerator.kt:686 */
  104    147   
            }
         148  +
            /* JsonParserGenerator.kt:695 */
  105    149   
            other => {
  106    150   
                return Err(
  107    151   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  108    152   
                        "expected object key or end object, found: {:?}",
  109    153   
                        other
  110    154   
                    )),
  111    155   
                )
         156  +
            } /* JsonParserGenerator.kt:685 */
  112    157   
        }
         158  +
        /* JsonParserGenerator.kt:684 */
  113    159   
    }
  114         -
    }
         160  +
    /* JsonParserGenerator.kt:250 */
  115    161   
    if tokens.next().is_some() {
         162  +
        /* JsonParserGenerator.kt:251 */
  116    163   
        return Err(
  117    164   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  118    165   
                "found more JSON tokens after completing parsing",
  119    166   
            ),
  120    167   
        );
         168  +
        /* JsonParserGenerator.kt:250 */
  121    169   
    }
         170  +
    /* JsonParserGenerator.kt:163 */
  122    171   
    Ok(builder)
         172  +
    /* JsonParserGenerator.kt:148 */
  123    173   
}

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

@@ -1,1 +29,43 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_simple_scalar_properties_output_output_output(
    3      4   
    value: &crate::output::SimpleScalarPropertiesOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_simple_scalar_properties_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::SimpleScalarPropertiesOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.float_value {
          24  +
        /* JsonSerializerGenerator.kt:432 */
   17     25   
        object.key("floatValue").number(
   18     26   
            #[allow(clippy::useless_conversion)]
   19     27   
            ::aws_smithy_types::Number::Float((*var_1).into()),
   20     28   
        );
          29  +
        /* JsonSerializerGenerator.kt:382 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:382 */
   22     32   
    if let Some(var_2) = &input.double_value {
          33  +
        /* JsonSerializerGenerator.kt:432 */
   23     34   
        object.key("doubleValue").number(
   24     35   
            #[allow(clippy::useless_conversion)]
   25     36   
            ::aws_smithy_types::Number::Float((*var_2).into()),
   26     37   
        );
          38  +
        /* JsonSerializerGenerator.kt:382 */
   27     39   
    }
          40  +
    /* JsonSerializerGenerator.kt:372 */
   28     41   
    Ok(())
          42  +
    /* JsonSerializerGenerator.kt:358 */
   29     43   
}

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

@@ -1,1 +52,78 @@
    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_string_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::std::string::String>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   32     46   
                        if let Some(value) = value {
   33     47   
                            items.push(value);
   34         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   35     51   
                            return Err(
   36     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                    "dense list cannot contain null values",
   38     54   
                                ),
   39     55   
                            );
   40     56   
                        }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   41     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   42     61   
            }
   43         -
            }
          62  +
            /* JsonParserGenerator.kt:446 */
   44     63   
            Ok(Some(items))
          64  +
            /* JsonParserGenerator.kt:713 */
   45     65   
        }
   46         -
        _ => Err(
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
   47     70   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48     71   
                    "expected start array or null",
   49     72   
                ),
   50         -
        ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   51     76   
    }
          77  +
    /* JsonParserGenerator.kt:398 */
   52     78   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_string_map.rs

@@ -1,1 +60,87 @@
    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_string_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* JsonParserGenerator.kt:469 */
   19     23   
            let mut map = ::std::collections::HashMap::new();
          24  +
            /* JsonParserGenerator.kt:684 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   21     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   22     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   24         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   25         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   26         -
                            tokens.next(),
   27         -
                        )?
   28         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                        .transpose()?;
          31  +
                        /* JsonParserGenerator.kt:471 */
          32  +
                        let key =
          33  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          34  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                            /* JsonParserGenerator.kt:339 */)
          36  +
                        /* JsonParserGenerator.kt:471 */?;
          37  +
                        /* JsonParserGenerator.kt:474 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:474 */;
          45  +
                        /* JsonParserGenerator.kt:481 */
   30     46   
                        match value {
   31     47   
                            Some(value) => {
   32     48   
                                map.insert(key, value);
   33     49   
                            }
   34     50   
                            None => {
   35     51   
                                return Err(
   36     52   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                        "dense map cannot contain null values",
   38     54   
                                    ),
   39     55   
                                )
   40     56   
                            }
   41     57   
                        }
          58  +
                        /* JsonParserGenerator.kt:686 */
   42     59   
                    }
          60  +
                    /* JsonParserGenerator.kt:695 */
   43     61   
                    other => {
   44     62   
                        return Err(
   45     63   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46     64   
                                format!("expected object key or end object, found: {:?}", other),
   47     65   
                            ),
   48     66   
                        )
          67  +
                    } /* JsonParserGenerator.kt:685 */
   49     68   
                }
          69  +
                /* JsonParserGenerator.kt:684 */
   50     70   
            }
   51         -
            }
          71  +
            /* JsonParserGenerator.kt:504 */
   52     72   
            Ok(Some(map))
          73  +
            /* JsonParserGenerator.kt:713 */
   53     74   
        }
   54         -
        _ => Err(
          75  +
        /* JsonParserGenerator.kt:722 */
          76  +
        _ => {
          77  +
            /* JsonParserGenerator.kt:723 */
          78  +
            Err(
   55     79   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   56     80   
                    "expected start object or null",
   57     81   
                ),
   58         -
        ),
          82  +
            )
          83  +
            /* JsonParserGenerator.kt:722 */
          84  +
        } /* JsonParserGenerator.kt:712 */
   59     85   
    }
          86  +
    /* JsonParserGenerator.kt:460 */
   60     87   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_test_string_list.rs

@@ -1,1 +52,78 @@
    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_test_string_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::std::string::String>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   32     46   
                        if let Some(value) = value {
   33     47   
                            items.push(value);
   34         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   35     51   
                            return Err(
   36     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                    "dense list cannot contain null values",
   38     54   
                                ),
   39     55   
                            );
   40     56   
                        }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   41     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   42     61   
            }
   43         -
            }
          62  +
            /* JsonParserGenerator.kt:446 */
   44     63   
            Ok(Some(items))
          64  +
            /* JsonParserGenerator.kt:713 */
   45     65   
        }
   46         -
        _ => Err(
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
   47     70   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48     71   
                    "expected start array or null",
   49     72   
                ),
   50         -
        ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   51     76   
    }
          77  +
    /* JsonParserGenerator.kt:398 */
   52     78   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_test_string_map.rs

@@ -1,1 +60,87 @@
    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_test_string_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* JsonParserGenerator.kt:469 */
   19     23   
            let mut map = ::std::collections::HashMap::new();
          24  +
            /* JsonParserGenerator.kt:684 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   21     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   22     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   24         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   25         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   26         -
                            tokens.next(),
   27         -
                        )?
   28         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                        .transpose()?;
          31  +
                        /* JsonParserGenerator.kt:471 */
          32  +
                        let key =
          33  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          34  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                            /* JsonParserGenerator.kt:339 */)
          36  +
                        /* JsonParserGenerator.kt:471 */?;
          37  +
                        /* JsonParserGenerator.kt:474 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:474 */;
          45  +
                        /* JsonParserGenerator.kt:481 */
   30     46   
                        match value {
   31     47   
                            Some(value) => {
   32     48   
                                map.insert(key, value);
   33     49   
                            }
   34     50   
                            None => {
   35     51   
                                return Err(
   36     52   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                        "dense map cannot contain null values",
   38     54   
                                    ),
   39     55   
                                )
   40     56   
                            }
   41     57   
                        }
          58  +
                        /* JsonParserGenerator.kt:686 */
   42     59   
                    }
          60  +
                    /* JsonParserGenerator.kt:695 */
   43     61   
                    other => {
   44     62   
                        return Err(
   45     63   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46     64   
                                format!("expected object key or end object, found: {:?}", other),
   47     65   
                            ),
   48     66   
                        )
          67  +
                    } /* JsonParserGenerator.kt:685 */
   49     68   
                }
          69  +
                /* JsonParserGenerator.kt:684 */
   50     70   
            }
   51         -
            }
          71  +
            /* JsonParserGenerator.kt:504 */
   52     72   
            Ok(Some(map))
          73  +
            /* JsonParserGenerator.kt:713 */
   53     74   
        }
   54         -
        _ => Err(
          75  +
        /* JsonParserGenerator.kt:722 */
          76  +
        _ => {
          77  +
            /* JsonParserGenerator.kt:723 */
          78  +
            Err(
   55     79   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   56     80   
                    "expected start object or null",
   57     81   
                ),
   58         -
        ),
          82  +
            )
          83  +
            /* JsonParserGenerator.kt:722 */
          84  +
        } /* JsonParserGenerator.kt:712 */
   59     85   
    }
          86  +
    /* JsonParserGenerator.kt:460 */
   60     87   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_top_level.rs

@@ -1,1 +67,107 @@
    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_top_level<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::top_level::Builder>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* RustType.kt:516 */
   19     23   
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
   20     25   
            let mut builder = crate::model::top_level::Builder::default();
          26  +
            /* JsonParserGenerator.kt:684 */
   21     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:685 */
   22     29   
                match tokens.next().transpose()? {
          30  +
                    /* JsonParserGenerator.kt:686 */
   23     31   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   24         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key
   25         -
                        .to_unescaped()?
   26         -
                        .as_ref()
   27         -
                    {
          32  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
          34  +
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
   28     36   
                            "dialog" => {
   29         -
                            if let Some(v) = crate::protocol_serde::shape_dialog::de_dialog(tokens)?
          37  +
                                /* JsonParserGenerator.kt:276 */
          38  +
                                if let Some(v) =
          39  +
                                    /* JsonParserGenerator.kt:544 */
          40  +
                                    crate::protocol_serde::shape_dialog::de_dialog(tokens)?
          41  +
                                /* JsonParserGenerator.kt:278 */
   30     42   
                                {
   31     43   
                                    builder = builder.set_dialog(v);
   32     44   
                                }
          45  +
                                /* JsonParserGenerator.kt:262 */
   33     46   
                            }
          47  +
                            /* JsonParserGenerator.kt:262 */
   34     48   
                            "dialogList" => {
          49  +
                                /* JsonParserGenerator.kt:276 */
   35     50   
                                if let Some(v) =
   36         -
                                crate::protocol_serde::shape_dialog_list::de_dialog_list(tokens)?
          51  +
                                    /* JsonParserGenerator.kt:451 */
          52  +
                                    crate::protocol_serde::shape_dialog_list::de_dialog_list(
          53  +
                                            tokens,
          54  +
                                        )?
          55  +
                                /* JsonParserGenerator.kt:278 */
   37     56   
                                {
   38     57   
                                    builder = builder.set_dialog_list(v);
   39     58   
                                }
          59  +
                                /* JsonParserGenerator.kt:262 */
   40     60   
                            }
          61  +
                            /* JsonParserGenerator.kt:262 */
   41     62   
                            "dialogMap" => {
          63  +
                                /* JsonParserGenerator.kt:276 */
   42     64   
                                if let Some(v) =
   43         -
                                crate::protocol_serde::shape_dialog_map::de_dialog_map(tokens)?
          65  +
                                    /* JsonParserGenerator.kt:509 */
          66  +
                                    crate::protocol_serde::shape_dialog_map::de_dialog_map(
          67  +
                                            tokens,
          68  +
                                        )?
          69  +
                                /* JsonParserGenerator.kt:278 */
   44     70   
                                {
   45     71   
                                    builder = builder.set_dialog_map(v);
   46     72   
                                }
          73  +
                                /* JsonParserGenerator.kt:262 */
          74  +
                            }
          75  +
                            /* JsonParserGenerator.kt:290 */
          76  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
          77  +
                        }
          78  +
                        /* JsonParserGenerator.kt:686 */
   47     79   
                    }
   48         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   49         -
                    },
          80  +
                    /* JsonParserGenerator.kt:695 */
   50     81   
                    other => {
   51     82   
                        return Err(
   52     83   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   53     84   
                                format!("expected object key or end object, found: {:?}", other),
   54     85   
                            ),
   55     86   
                        )
          87  +
                    } /* JsonParserGenerator.kt:685 */
   56     88   
                }
          89  +
                /* JsonParserGenerator.kt:684 */
   57     90   
            }
   58         -
            }
          91  +
            /* JsonParserGenerator.kt:540 */
   59     92   
            Ok(Some(builder))
          93  +
            /* JsonParserGenerator.kt:713 */
   60     94   
        }
   61         -
        _ => Err(
          95  +
        /* JsonParserGenerator.kt:722 */
          96  +
        _ => {
          97  +
            /* JsonParserGenerator.kt:723 */
          98  +
            Err(
   62     99   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   63    100   
                    "expected start object or null",
   64    101   
                ),
   65         -
        ),
         102  +
            )
         103  +
            /* JsonParserGenerator.kt:722 */
         104  +
        } /* JsonParserGenerator.kt:712 */
   66    105   
    }
         106  +
    /* JsonParserGenerator.kt:516 */
   67    107   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_validation_exception.rs

@@ -1,1 +38,62 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_validation_exception_error(
    3      4   
    value: &crate::error::ValidationException,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_validation_exception::ser_validation_exception(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* ServerAwsJson.kt:95 */
   11     15   
    object
   12     16   
        .key("__type")
   13     17   
        .string("smithy.framework#ValidationException");
          18  +
    /* JsonSerializerGenerator.kt:227 */
   14     19   
    object.finish();
   15     20   
    Ok(out)
          21  +
    /* JsonSerializerGenerator.kt:213 */
   16     22   
}
   17     23   
          24  +
/* JsonSerializerGenerator.kt:358 */
   18     25   
pub fn ser_validation_exception(
   19     26   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   20     27   
    input: &crate::error::ValidationException,
   21     28   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          29  +
    /* SerializerUtil.kt:42 */
   22     30   
    {
          31  +
        /* JsonSerializerGenerator.kt:423 */
   23     32   
        object.key("message").string(input.message.as_str());
          33  +
        /* SerializerUtil.kt:42 */
   24     34   
    }
          35  +
    /* JsonSerializerGenerator.kt:382 */
   25     36   
    if let Some(var_1) = &input.field_list {
          37  +
        /* JsonSerializerGenerator.kt:484 */
   26     38   
        let mut array_2 = object.key("fieldList").start_array();
          39  +
        /* JsonSerializerGenerator.kt:524 */
   27     40   
        for item_3 in var_1 {
          41  +
            /* SerializerUtil.kt:42 */
   28     42   
            {
          43  +
                /* JsonSerializerGenerator.kt:495 */
   29     44   
                #[allow(unused_mut)]
          45  +
                /* JsonSerializerGenerator.kt:496 */
   30     46   
                let mut object_4 = array_2.value().start_object();
          47  +
                /* JsonSerializerGenerator.kt:375 */
   31     48   
                crate::protocol_serde::shape_validation_exception_field::ser_validation_exception_field(&mut object_4, item_3)?;
          49  +
                /* JsonSerializerGenerator.kt:515 */
   32     50   
                object_4.finish();
          51  +
                /* SerializerUtil.kt:42 */
   33     52   
            }
          53  +
            /* JsonSerializerGenerator.kt:524 */
   34     54   
        }
          55  +
        /* JsonSerializerGenerator.kt:486 */
   35     56   
        array_2.finish();
          57  +
        /* JsonSerializerGenerator.kt:382 */
   36     58   
    }
          59  +
    /* JsonSerializerGenerator.kt:372 */
   37     60   
    Ok(())
          61  +
    /* JsonSerializerGenerator.kt:358 */
   38     62   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_validation_exception_field.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_validation_exception_field(
    3      4   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    input: &crate::model::ValidationExceptionField,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* SerializerUtil.kt:42 */
    6      8   
    {
           9  +
        /* JsonSerializerGenerator.kt:423 */
    7     10   
        object.key("path").string(input.path.as_str());
          11  +
        /* SerializerUtil.kt:42 */
    8     12   
    }
          13  +
    /* SerializerUtil.kt:42 */
    9     14   
    {
          15  +
        /* JsonSerializerGenerator.kt:423 */
   10     16   
        object.key("message").string(input.message.as_str());
          17  +
        /* SerializerUtil.kt:42 */
   11     18   
    }
          19  +
    /* JsonSerializerGenerator.kt:372 */
   12     20   
    Ok(())
          21  +
    /* JsonSerializerGenerator.kt:358 */
   13     22   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/service.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerServiceGenerator.kt:795 */
    2      3   
/// The service builder for [`JsonRpc10`].
    3      4   
///
    4      5   
/// Constructed via [`JsonRpc10::builder`].
    5      6   
pub struct JsonRpc10Builder<Body, L, HttpPl, ModelPl> {
    6      7   
    content_type_parameters: Option<::aws_smithy_http_server::routing::Route<Body>>,
    7      8   
    empty_input_and_empty_output: Option<::aws_smithy_http_server::routing::Route<Body>>,
    8      9   
    endpoint_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
    9     10   
    endpoint_with_host_label_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
   10     11   
    greeting_with_errors: Option<::aws_smithy_http_server::routing::Route<Body>>,
   11     12   
    host_with_path_operation: Option<::aws_smithy_http_server::routing::Route<Body>>,
@@ -2928,2929 +2987,2989 @@
 2948   2949   
            "aws.protocoltests.json10",
 2949   2950   
            "JsonRpc10",
 2950   2951   
        );
 2951   2952   
 2952   2953   
    const VERSION: Option<&'static str> = Some("2020-07-14");
 2953   2954   
 2954   2955   
    type Protocol = ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0;
 2955   2956   
 2956   2957   
    type Operations = Operation;
 2957   2958   
}
        2959  +
/* ServiceConfigGenerator.kt:178 */
 2958   2960   
/// Configuration for the [`JsonRpc10`]. This is the central place where to register and
 2959   2961   
/// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
 2960   2962   
///
 2961   2963   
/// ```rust,no_run
 2962   2964   
/// # use json_rpc10::JsonRpc10Config;
 2963   2965   
/// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
 2964   2966   
/// # use ::tower::layer::util::Identity;
 2965   2967   
/// # let authentication_plugin = IdentityPlugin;
 2966   2968   
/// # let authorization_plugin = IdentityPlugin;
 2967   2969   
/// # let server_request_id_provider_layer = Identity::new();
@@ -3043,3045 +3102,3105 @@
 3063   3065   
 3064   3066   
    /// Build the configuration.
 3065   3067   
    pub fn build(self) -> super::JsonRpc10Config<L, H, M> {
 3066   3068   
        super::JsonRpc10Config {
 3067   3069   
            layers: self.layers,
 3068   3070   
            http_plugins: self.http_plugins,
 3069   3071   
            model_plugins: self.model_plugins,
 3070   3072   
        }
 3071   3073   
    }
 3072   3074   
}
        3075  +
/* ScopeMacroGenerator.kt:81 */
 3073   3076   
/// A macro to help with scoping [plugins](crate::server::plugin) to a subset of all operations.
 3074   3077   
///
 3075   3078   
/// In contrast to [`crate::server::scope`](crate::server::scope), this macro has knowledge
 3076   3079   
/// of the service and any operations _not_ specified will be placed in the opposing group.
 3077   3080   
///
 3078   3081   
/// # Example
 3079   3082   
///
 3080   3083   
/// ```rust
 3081   3084   
/// scope! {
 3082   3085   
///     /// Includes [`ContentTypeParameters`], excluding all other operations.

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/types.rs

@@ -1,1 +0,7 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* SmithyTypesPubUseExtra.kt:66 */
    2      3   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
           4  +
/* ServerRequiredCustomizations.kt:69 */
    3      5   
pub use ::aws_smithy_types::error::display::DisplayErrorContext;
    4      6   
pub use ::aws_smithy_types::Blob;
    5         -
pub use ::aws_smithy_types::DateTime;
           7  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/unconstrained.rs

@@ -1,1 +74,84 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/* UnconstrainedUnionGenerator.kt:121 */
    3      4   
impl crate::constrained::Constrained for crate::model::MyUnion {
    4      5   
    type Unconstrained = crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained;
    5      6   
}
    6      7   
    7      8   
impl From<crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained>
    8      9   
    for crate::constrained::MaybeConstrained<crate::model::MyUnion>
    9     10   
{
   10     11   
    fn from(value: crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained) -> Self {
   11     12   
        Self::Unconstrained(value)
   12     13   
    }
   13     14   
}
   14     15   
pub(crate) mod my_union_unconstrained {
   15     16   
          17  +
    /* UnconstrainedUnionGenerator.kt:82 */
   16     18   
    #[allow(clippy::enum_variant_names)]
   17     19   
    #[derive(Debug, Clone)]
   18     20   
    pub(crate) enum MyUnionUnconstrained {
   19         -
        BlobValue(::aws_smithy_types::Blob),
   20         -
        BooleanValue(bool),
   21         -
        EnumValue(::std::string::String),
   22         -
        IntEnumValue(i32),
          21  +
        /* UnconstrainedUnionGenerator.kt:95 */ BlobValue(::aws_smithy_types::Blob),
          22  +
        /* UnconstrainedUnionGenerator.kt:95 */ BooleanValue(bool),
          23  +
        /* UnconstrainedUnionGenerator.kt:95 */ EnumValue(::std::string::String),
          24  +
        /* UnconstrainedUnionGenerator.kt:95 */ IntEnumValue(i32),
          25  +
        /* UnconstrainedUnionGenerator.kt:95 */
   23     26   
        ListValue(::std::vec::Vec<::std::string::String>),
          27  +
        /* UnconstrainedUnionGenerator.kt:95 */
   24     28   
        MapValue(::std::collections::HashMap<::std::string::String, ::std::string::String>),
   25         -
        NumberValue(i32),
   26         -
        StringValue(::std::string::String),
          29  +
        /* UnconstrainedUnionGenerator.kt:95 */ NumberValue(i32),
          30  +
        /* UnconstrainedUnionGenerator.kt:95 */ StringValue(::std::string::String),
          31  +
        /* UnconstrainedUnionGenerator.kt:95 */
   27     32   
        StructureValue(crate::model::GreetingStruct),
          33  +
        /* UnconstrainedUnionGenerator.kt:95 */
   28     34   
        TimestampValue(::aws_smithy_types::DateTime),
          35  +
        /* UnconstrainedUnionGenerator.kt:82 */
   29     36   
    }
          37  +
    /* UnconstrainedUnionGenerator.kt:103 */
   30     38   
    impl ::std::convert::TryFrom<MyUnionUnconstrained> for crate::model::MyUnion {
   31     39   
        type Error = crate::model::my_union::ConstraintViolation;
   32     40   
   33     41   
        fn try_from(value: MyUnionUnconstrained) -> ::std::result::Result<Self, Self::Error> {
   34     42   
            Ok(
   35     43   
        match value {
   36     44   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BlobValue(unconstrained) => Self::BlobValue(
   37     45   
                unconstrained
   38     46   
            ),
   39     47   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BooleanValue(unconstrained) => Self::BooleanValue(
   40     48   
                unconstrained
   41     49   
            ),
   42     50   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::EnumValue(unconstrained) => Self::EnumValue(
   43     51   
                unconstrained
   44     52   
                                        .try_into()
   45     53   
                                        
   46     54   
                                        
   47     55   
                                        .map_err(Self::Error::EnumValue)?
   48     56   
            ),
   49     57   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::IntEnumValue(unconstrained) => Self::IntEnumValue(
   50     58   
                unconstrained
   51     59   
            ),
   52     60   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::ListValue(unconstrained) => Self::ListValue(
   53     61   
                unconstrained
   54     62   
            ),
   55     63   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::MapValue(unconstrained) => Self::MapValue(
   56     64   
                unconstrained
   57     65   
            ),
   58     66   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::NumberValue(unconstrained) => Self::NumberValue(
   59     67   
                unconstrained
   60     68   
            ),
   61     69   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StringValue(unconstrained) => Self::StringValue(
   62     70   
                unconstrained
   63     71   
            ),
   64     72   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StructureValue(unconstrained) => Self::StructureValue(
   65     73   
                unconstrained
   66     74   
            ),
   67     75   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::TimestampValue(unconstrained) => Self::TimestampValue(
   68     76   
                unconstrained
   69     77   
            ),
   70     78   
        }
   71     79   
    )
   72     80   
        }
   73     81   
    }
          82  +
          83  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   74     84   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/constrained.rs

@@ -1,1 +70,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3      3   
pub(crate) mod foo_enum_map_constrained {
    4      4   
           5  +
    /* PubCrateConstrainedMapGenerator.kt:80 */
    5      6   
    #[derive(Debug, Clone)]
    6      7   
    pub(crate) struct FooEnumMapConstrained(
    7      8   
        pub(crate) std::collections::HashMap<::std::string::String, crate::model::FooEnum>,
    8      9   
    );
    9     10   
   10     11   
    impl crate::constrained::Constrained for FooEnumMapConstrained {
   11     12   
        type Unconstrained =
   12     13   
            crate::unconstrained::foo_enum_map_unconstrained::FooEnumMapUnconstrained;
   13     14   
    }
          15  +
    /* PubCrateConstrainedMapGenerator.kt:99 */
   14     16   
    impl
   15     17   
        ::std::convert::From<
   16     18   
            ::std::collections::HashMap<::std::string::String, crate::model::FooEnum>,
   17     19   
        > for FooEnumMapConstrained
   18     20   
    {
   19     21   
        fn from(
   20     22   
            v: ::std::collections::HashMap<::std::string::String, crate::model::FooEnum>,
   21     23   
        ) -> Self {
   22     24   
            Self(v)
   23     25   
        }
   24     26   
    }
   25     27   
   26     28   
    impl ::std::convert::From<FooEnumMapConstrained>
   27     29   
        for ::std::collections::HashMap<::std::string::String, crate::model::FooEnum>
   28     30   
    {
   29     31   
        fn from(v: FooEnumMapConstrained) -> Self {
   30     32   
            v.0
   31     33   
        }
   32     34   
    }
          35  +
          36  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   33     37   
}
   34     38   
pub(crate) mod foo_enum_list_constrained {
   35     39   
          40  +
    /* PubCrateConstrainedCollectionGenerator.kt:79 */
   36     41   
    #[derive(Debug, Clone)]
   37     42   
    pub(crate) struct FooEnumListConstrained(pub(crate) std::vec::Vec<crate::model::FooEnum>);
   38     43   
   39     44   
    impl crate::constrained::Constrained for FooEnumListConstrained {
   40     45   
        type Unconstrained =
   41     46   
            crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained;
   42     47   
    }
          48  +
    /* PubCrateConstrainedCollectionGenerator.kt:108 */
   43     49   
    impl ::std::convert::From<::std::vec::Vec<crate::model::FooEnum>> for FooEnumListConstrained {
   44     50   
        fn from(v: ::std::vec::Vec<crate::model::FooEnum>) -> Self {
   45     51   
            Self(v)
   46     52   
        }
   47     53   
    }
   48     54   
   49     55   
    impl ::std::convert::From<FooEnumListConstrained> for ::std::vec::Vec<crate::model::FooEnum> {
   50     56   
        fn from(v: FooEnumListConstrained) -> Self {
   51     57   
            v.0
   52     58   
        }
   53     59   
    }
          60  +
          61  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   54     62   
}
   55     63   
   56     64   
/*
   57     65   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
   58     66   
 * SPDX-License-Identifier: Apache-2.0
   59     67   
 */
   60     68   
   61     69   
pub(crate) trait Constrained {
   62     70   
    type Unconstrained;
   63     71   
}

tmp-codegen-diff/codegen-server-test/json_rpc11/rust-server-codegen/src/error.rs

@@ -1,1 +766,1447 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/* ServerOperationErrorGenerator.kt:63 */
    3      4   
/// Error type for the `EndpointWithHostLabelOperation` operation.
           5  +
/* ServerOperationErrorGenerator.kt:64 */
    4      6   
/// Each variant represents an error that can occur for the `EndpointWithHostLabelOperation` operation.
           7  +
/* RustType.kt:516 */
    5      8   
#[derive(::std::fmt::Debug)]
    6         -
pub enum EndpointWithHostLabelOperationError {
    7         -
    /// 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.
           9  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum EndpointWithHostLabelOperationError {
          10  +
    /// /* ServerOperationErrorGenerator.kt:68 */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.
          11  +
    /* ServerOperationErrorGenerator.kt:71 */
    8     12   
    ValidationException(crate::error::ValidationException),
          13  +
    /* ServerOperationErrorGenerator.kt:66 */
    9     14   
}
          15  +
/* ServerOperationErrorGenerator.kt:75 */
   10     16   
impl ::std::fmt::Display for EndpointWithHostLabelOperationError {
          17  +
    /* ServerOperationErrorGenerator.kt:76 */
   11     18   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          19  +
        /* ServerOperationErrorGenerator.kt:139 */
   12     20   
        match &self {
   13         -
            EndpointWithHostLabelOperationError::ValidationException(_inner) => _inner.fmt(f),
          21  +
            /* ServerOperationErrorGenerator.kt:142 */
          22  +
            EndpointWithHostLabelOperationError::ValidationException(_inner) =>
          23  +
            /* ServerOperationErrorGenerator.kt:78 */
          24  +
            {
          25  +
                _inner.fmt(f)
          26  +
            }
          27  +
            /* ServerOperationErrorGenerator.kt:139 */
   14     28   
        }
          29  +
        /* ServerOperationErrorGenerator.kt:76 */
   15     30   
    }
          31  +
    /* ServerOperationErrorGenerator.kt:75 */
   16     32   
}
          33  +
/* ServerOperationErrorGenerator.kt:83 */
   17     34   
impl EndpointWithHostLabelOperationError {
          35  +
    /* ServerOperationErrorGenerator.kt:87 */
   18     36   
    /// Returns `true` if the error kind is `EndpointWithHostLabelOperationError::ValidationException`.
          37  +
    /* ServerOperationErrorGenerator.kt:88 */
   19     38   
    pub fn is_validation_exception(&self) -> bool {
          39  +
        /* ServerOperationErrorGenerator.kt:89 */
   20     40   
        matches!(
   21     41   
            &self,
   22     42   
            EndpointWithHostLabelOperationError::ValidationException(_)
   23     43   
        )
          44  +
        /* ServerOperationErrorGenerator.kt:88 */
   24     45   
    }
          46  +
    /* ServerOperationErrorGenerator.kt:92 */
   25     47   
    /// Returns the error name string by matching the correct variant.
          48  +
    /* ServerOperationErrorGenerator.kt:93 */
   26     49   
    pub fn name(&self) -> &'static str {
          50  +
        /* ServerOperationErrorGenerator.kt:139 */
   27     51   
        match &self {
   28         -
            EndpointWithHostLabelOperationError::ValidationException(_inner) => _inner.name(),
          52  +
            /* ServerOperationErrorGenerator.kt:142 */
          53  +
            EndpointWithHostLabelOperationError::ValidationException(_inner) =>
          54  +
            /* ServerOperationErrorGenerator.kt:95 */
          55  +
            {
          56  +
                _inner.name()
          57  +
            }
          58  +
            /* ServerOperationErrorGenerator.kt:139 */
   29     59   
        }
          60  +
        /* ServerOperationErrorGenerator.kt:93 */
   30     61   
    }
          62  +
    /* ServerOperationErrorGenerator.kt:83 */
   31     63   
}
          64  +
/* ServerOperationErrorGenerator.kt:100 */
   32     65   
impl ::std::error::Error for EndpointWithHostLabelOperationError {
          66  +
    /* ServerOperationErrorGenerator.kt:101 */
   33     67   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
          68  +
        /* ServerOperationErrorGenerator.kt:139 */
   34     69   
        match &self {
   35         -
            EndpointWithHostLabelOperationError::ValidationException(_inner) => Some(_inner),
          70  +
            /* ServerOperationErrorGenerator.kt:142 */
          71  +
            EndpointWithHostLabelOperationError::ValidationException(_inner) =>
          72  +
            /* ServerOperationErrorGenerator.kt:103 */
          73  +
            {
          74  +
                Some(_inner)
          75  +
            }
          76  +
            /* ServerOperationErrorGenerator.kt:139 */
   36     77   
        }
          78  +
        /* ServerOperationErrorGenerator.kt:101 */
   37     79   
    }
          80  +
    /* ServerOperationErrorGenerator.kt:100 */
   38     81   
}
          82  +
/* ServerOperationErrorGenerator.kt:110 */
   39     83   
impl ::std::convert::From<crate::error::ValidationException>
   40     84   
    for crate::error::EndpointWithHostLabelOperationError
   41     85   
{
          86  +
    /* ServerOperationErrorGenerator.kt:111 */
   42     87   
    fn from(
   43     88   
        variant: crate::error::ValidationException,
   44     89   
    ) -> crate::error::EndpointWithHostLabelOperationError {
          90  +
        /* ServerOperationErrorGenerator.kt:112 */
   45     91   
        Self::ValidationException(variant)
          92  +
        /* ServerOperationErrorGenerator.kt:111 */
   46     93   
    }
          94  +
    /* ServerOperationErrorGenerator.kt:110 */
   47     95   
}
   48     96   
   49         -
/// 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.
          97  +
/// /* 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.
          98  +
/* RustType.kt:516 */
   50     99   
#[derive(
   51    100   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   52    101   
)]
   53         -
pub struct ValidationException {
   54         -
    /// A summary of the validation failure.
         102  +
pub /* StructureGenerator.kt:201 */ struct ValidationException {
         103  +
    /// /* StructureGenerator.kt:231 */A summary of the validation failure.
   55    104   
    pub message: ::std::string::String,
   56         -
    /// 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.
         105  +
    /// /* 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.
   57    106   
    pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
         107  +
    /* StructureGenerator.kt:201 */
   58    108   
}
         109  +
/* StructureGenerator.kt:135 */
   59    110   
impl ValidationException {
   60         -
    /// 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.
         111  +
    /// /* 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.
         112  +
    /* StructureGenerator.kt:166 */
   61    113   
    pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
         114  +
        /* StructureGenerator.kt:169 */
   62    115   
        self.field_list.as_deref()
         116  +
        /* StructureGenerator.kt:166 */
   63    117   
    }
         118  +
    /* StructureGenerator.kt:135 */
   64    119   
}
         120  +
/* ErrorImplGenerator.kt:99 */
   65    121   
impl ValidationException {
         122  +
    /* ErrorImplGenerator.kt:128 */
   66    123   
    /// Returns the error message.
   67    124   
    pub fn message(&self) -> &str {
   68    125   
        &self.message
   69    126   
    }
         127  +
    /* ErrorImplGenerator.kt:141 */
   70    128   
    #[doc(hidden)]
   71    129   
    /// Returns the error name.
   72    130   
    pub fn name(&self) -> &'static str {
   73    131   
        "ValidationException"
   74    132   
    }
         133  +
    /* ErrorImplGenerator.kt:99 */
   75    134   
}
         135  +
/* ErrorImplGenerator.kt:153 */
   76    136   
impl ::std::fmt::Display for ValidationException {
         137  +
    /* ErrorImplGenerator.kt:154 */
   77    138   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         139  +
        /* ErrorImplGenerator.kt:161 */
   78    140   
        ::std::write!(f, "ValidationException")?;
         141  +
        /* ErrorImplGenerator.kt:166 */
   79    142   
        {
         143  +
            /* ErrorImplGenerator.kt:167 */
   80    144   
            ::std::write!(f, ": {}", &self.message)?;
         145  +
            /* ErrorImplGenerator.kt:166 */
   81    146   
        }
         147  +
        /* ErrorImplGenerator.kt:171 */
   82    148   
        Ok(())
         149  +
        /* ErrorImplGenerator.kt:154 */
   83    150   
    }
         151  +
    /* ErrorImplGenerator.kt:153 */
   84    152   
}
         153  +
/* ErrorImplGenerator.kt:175 */
   85    154   
impl ::std::error::Error for ValidationException {}
         155  +
/* ServerCodegenVisitor.kt:345 */
   86    156   
impl ValidationException {
   87         -
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
         157  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
         158  +
    /* ServerBuilderGenerator.kt:295 */
   88    159   
    pub fn builder() -> crate::error::validation_exception::Builder {
         160  +
        /* ServerBuilderGenerator.kt:296 */
   89    161   
        crate::error::validation_exception::Builder::default()
         162  +
        /* ServerBuilderGenerator.kt:295 */
   90    163   
    }
         164  +
    /* ServerCodegenVisitor.kt:345 */
   91    165   
}
   92    166   
         167  +
/* ServerOperationErrorGenerator.kt:63 */
   93    168   
/// Error type for the `JsonUnions` operation.
         169  +
/* ServerOperationErrorGenerator.kt:64 */
   94    170   
/// Each variant represents an error that can occur for the `JsonUnions` operation.
         171  +
/* RustType.kt:516 */
   95    172   
#[derive(::std::fmt::Debug)]
   96         -
pub enum JsonUnionsError {
   97         -
    /// 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.
         173  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum JsonUnionsError {
         174  +
    /// /* ServerOperationErrorGenerator.kt:68 */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.
         175  +
    /* ServerOperationErrorGenerator.kt:71 */
   98    176   
    ValidationException(crate::error::ValidationException),
         177  +
    /* ServerOperationErrorGenerator.kt:66 */
   99    178   
}
         179  +
/* ServerOperationErrorGenerator.kt:75 */
  100    180   
impl ::std::fmt::Display for JsonUnionsError {
         181  +
    /* ServerOperationErrorGenerator.kt:76 */
  101    182   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         183  +
        /* ServerOperationErrorGenerator.kt:139 */
  102    184   
        match &self {
  103         -
            JsonUnionsError::ValidationException(_inner) => _inner.fmt(f),
         185  +
            /* ServerOperationErrorGenerator.kt:142 */
         186  +
            JsonUnionsError::ValidationException(_inner) =>
         187  +
            /* ServerOperationErrorGenerator.kt:78 */
         188  +
            {
         189  +
                _inner.fmt(f)
         190  +
            }
         191  +
            /* ServerOperationErrorGenerator.kt:139 */
  104    192   
        }
         193  +
        /* ServerOperationErrorGenerator.kt:76 */
  105    194   
    }
         195  +
    /* ServerOperationErrorGenerator.kt:75 */
  106    196   
}
         197  +
/* ServerOperationErrorGenerator.kt:83 */
  107    198   
impl JsonUnionsError {
         199  +
    /* ServerOperationErrorGenerator.kt:87 */
  108    200   
    /// Returns `true` if the error kind is `JsonUnionsError::ValidationException`.
         201  +
    /* ServerOperationErrorGenerator.kt:88 */
  109    202   
    pub fn is_validation_exception(&self) -> bool {
         203  +
        /* ServerOperationErrorGenerator.kt:89 */
  110    204   
        matches!(&self, JsonUnionsError::ValidationException(_))
         205  +
        /* ServerOperationErrorGenerator.kt:88 */
  111    206   
    }
         207  +
    /* ServerOperationErrorGenerator.kt:92 */
  112    208   
    /// Returns the error name string by matching the correct variant.
         209  +
    /* ServerOperationErrorGenerator.kt:93 */
  113    210   
    pub fn name(&self) -> &'static str {
         211  +
        /* ServerOperationErrorGenerator.kt:139 */
  114    212   
        match &self {
  115         -
            JsonUnionsError::ValidationException(_inner) => _inner.name(),
         213  +
            /* ServerOperationErrorGenerator.kt:142 */
         214  +
            JsonUnionsError::ValidationException(_inner) =>
         215  +
            /* ServerOperationErrorGenerator.kt:95 */
         216  +
            {
         217  +
                _inner.name()
         218  +
            }
         219  +
            /* ServerOperationErrorGenerator.kt:139 */
  116    220   
        }
         221  +
        /* ServerOperationErrorGenerator.kt:93 */
  117    222   
    }
         223  +
    /* ServerOperationErrorGenerator.kt:83 */
  118    224   
}
         225  +
/* ServerOperationErrorGenerator.kt:100 */
  119    226   
impl ::std::error::Error for JsonUnionsError {
         227  +
    /* ServerOperationErrorGenerator.kt:101 */
  120    228   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         229  +
        /* ServerOperationErrorGenerator.kt:139 */
  121    230   
        match &self {
  122         -
            JsonUnionsError::ValidationException(_inner) => Some(_inner),
         231  +
            /* ServerOperationErrorGenerator.kt:142 */
         232  +
            JsonUnionsError::ValidationException(_inner) =>
         233  +
            /* ServerOperationErrorGenerator.kt:103 */
         234  +
            {
         235  +
                Some(_inner)
         236  +
            }
         237  +
            /* ServerOperationErrorGenerator.kt:139 */
  123    238   
        }
         239  +
        /* ServerOperationErrorGenerator.kt:101 */
  124    240   
    }
         241  +
    /* ServerOperationErrorGenerator.kt:100 */
  125    242   
}
         243  +
/* ServerOperationErrorGenerator.kt:110 */
  126    244   
impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonUnionsError {
         245  +
    /* ServerOperationErrorGenerator.kt:111 */
  127    246   
    fn from(variant: crate::error::ValidationException) -> crate::error::JsonUnionsError {
         247  +
        /* ServerOperationErrorGenerator.kt:112 */
  128    248   
        Self::ValidationException(variant)
         249  +
        /* ServerOperationErrorGenerator.kt:111 */
  129    250   
    }
         251  +
    /* ServerOperationErrorGenerator.kt:110 */
  130    252   
}
  131    253   
         254  +
/* ServerOperationErrorGenerator.kt:63 */
  132    255   
/// Error type for the `GreetingWithErrors` operation.
         256  +
/* ServerOperationErrorGenerator.kt:64 */
  133    257   
/// Each variant represents an error that can occur for the `GreetingWithErrors` operation.
         258  +
/* RustType.kt:516 */
  134    259   
#[derive(::std::fmt::Debug)]
  135         -
pub enum GreetingWithErrorsError {
  136         -
    /// This error is thrown when an invalid greeting value is provided.
         260  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum GreetingWithErrorsError {
         261  +
    /// /* ServerOperationErrorGenerator.kt:68 */This error is thrown when an invalid greeting value is provided.
         262  +
    /* ServerOperationErrorGenerator.kt:71 */
  137    263   
    InvalidGreeting(crate::error::InvalidGreeting),
  138         -
    /// This error is thrown when a request is invalid.
         264  +
    /// /* ServerOperationErrorGenerator.kt:68 */This error is thrown when a request is invalid.
         265  +
    /* ServerOperationErrorGenerator.kt:71 */
  139    266   
    ComplexError(crate::error::ComplexError),
  140         -
    /// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
         267  +
    /// /* ServerOperationErrorGenerator.kt:68 */This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
         268  +
    /* ServerOperationErrorGenerator.kt:71 */
  141    269   
    FooError(crate::error::FooError),
         270  +
    /* ServerOperationErrorGenerator.kt:66 */
  142    271   
}
         272  +
/* ServerOperationErrorGenerator.kt:75 */
  143    273   
impl ::std::fmt::Display for GreetingWithErrorsError {
         274  +
    /* ServerOperationErrorGenerator.kt:76 */
  144    275   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         276  +
        /* ServerOperationErrorGenerator.kt:139 */
  145    277   
        match &self {
  146         -
            GreetingWithErrorsError::InvalidGreeting(_inner) => _inner.fmt(f),
  147         -
            GreetingWithErrorsError::ComplexError(_inner) => _inner.fmt(f),
  148         -
            GreetingWithErrorsError::FooError(_inner) => _inner.fmt(f),
         278  +
            /* ServerOperationErrorGenerator.kt:142 */
         279  +
            GreetingWithErrorsError::InvalidGreeting(_inner) =>
         280  +
            /* ServerOperationErrorGenerator.kt:78 */
         281  +
            {
         282  +
                _inner.fmt(f)
  149    283   
            }
         284  +
            ,
         285  +
            /* ServerOperationErrorGenerator.kt:142 */
         286  +
            GreetingWithErrorsError::ComplexError(_inner) =>
         287  +
            /* ServerOperationErrorGenerator.kt:78 */
         288  +
            {
         289  +
                _inner.fmt(f)
  150    290   
            }
         291  +
            ,
         292  +
            /* ServerOperationErrorGenerator.kt:142 */
         293  +
            GreetingWithErrorsError::FooError(_inner) =>
         294  +
            /* ServerOperationErrorGenerator.kt:78 */
         295  +
            {
         296  +
                _inner.fmt(f)
         297  +
            }
         298  +
            /* ServerOperationErrorGenerator.kt:139 */
         299  +
        }
         300  +
        /* ServerOperationErrorGenerator.kt:76 */
         301  +
    }
         302  +
    /* ServerOperationErrorGenerator.kt:75 */
  151    303   
}
         304  +
/* ServerOperationErrorGenerator.kt:83 */
  152    305   
impl GreetingWithErrorsError {
         306  +
    /* ServerOperationErrorGenerator.kt:87 */
  153    307   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::InvalidGreeting`.
         308  +
    /* ServerOperationErrorGenerator.kt:88 */
  154    309   
    pub fn is_invalid_greeting(&self) -> bool {
         310  +
        /* ServerOperationErrorGenerator.kt:89 */
  155    311   
        matches!(&self, GreetingWithErrorsError::InvalidGreeting(_))
         312  +
        /* ServerOperationErrorGenerator.kt:88 */
  156    313   
    }
         314  +
    /* ServerOperationErrorGenerator.kt:87 */
  157    315   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::ComplexError`.
         316  +
    /* ServerOperationErrorGenerator.kt:88 */
  158    317   
    pub fn is_complex_error(&self) -> bool {
         318  +
        /* ServerOperationErrorGenerator.kt:89 */
  159    319   
        matches!(&self, GreetingWithErrorsError::ComplexError(_))
         320  +
        /* ServerOperationErrorGenerator.kt:88 */
  160    321   
    }
         322  +
    /* ServerOperationErrorGenerator.kt:87 */
  161    323   
    /// Returns `true` if the error kind is `GreetingWithErrorsError::FooError`.
         324  +
    /* ServerOperationErrorGenerator.kt:88 */
  162    325   
    pub fn is_foo_error(&self) -> bool {
         326  +
        /* ServerOperationErrorGenerator.kt:89 */
  163    327   
        matches!(&self, GreetingWithErrorsError::FooError(_))
         328  +
        /* ServerOperationErrorGenerator.kt:88 */
  164    329   
    }
         330  +
    /* ServerOperationErrorGenerator.kt:92 */
  165    331   
    /// Returns the error name string by matching the correct variant.
         332  +
    /* ServerOperationErrorGenerator.kt:93 */
  166    333   
    pub fn name(&self) -> &'static str {
         334  +
        /* ServerOperationErrorGenerator.kt:139 */
  167    335   
        match &self {
  168         -
            GreetingWithErrorsError::InvalidGreeting(_inner) => _inner.name(),
  169         -
            GreetingWithErrorsError::ComplexError(_inner) => _inner.name(),
  170         -
            GreetingWithErrorsError::FooError(_inner) => _inner.name(),
         336  +
            /* ServerOperationErrorGenerator.kt:142 */
         337  +
            GreetingWithErrorsError::InvalidGreeting(_inner) =>
         338  +
            /* ServerOperationErrorGenerator.kt:95 */
         339  +
            {
         340  +
                _inner.name()
         341  +
            }
         342  +
            ,
         343  +
            /* ServerOperationErrorGenerator.kt:142 */
         344  +
            GreetingWithErrorsError::ComplexError(_inner) =>
         345  +
            /* ServerOperationErrorGenerator.kt:95 */
         346  +
            {
         347  +
                _inner.name()
         348  +
            }
         349  +
            ,
         350  +
            /* ServerOperationErrorGenerator.kt:142 */
         351  +
            GreetingWithErrorsError::FooError(_inner) =>
         352  +
            /* ServerOperationErrorGenerator.kt:95 */
         353  +
            {
         354  +
                _inner.name()
         355  +
            }
         356  +
            /* ServerOperationErrorGenerator.kt:139 */
  171    357   
        }
         358  +
        /* ServerOperationErrorGenerator.kt:93 */
  172    359   
    }
         360  +
    /* ServerOperationErrorGenerator.kt:83 */
  173    361   
}
         362  +
/* ServerOperationErrorGenerator.kt:100 */
  174    363   
impl ::std::error::Error for GreetingWithErrorsError {
         364  +
    /* ServerOperationErrorGenerator.kt:101 */
  175    365   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         366  +
        /* ServerOperationErrorGenerator.kt:139 */
  176    367   
        match &self {
  177         -
            GreetingWithErrorsError::InvalidGreeting(_inner) => Some(_inner),
  178         -
            GreetingWithErrorsError::ComplexError(_inner) => Some(_inner),
  179         -
            GreetingWithErrorsError::FooError(_inner) => Some(_inner),
         368  +
            /* ServerOperationErrorGenerator.kt:142 */
         369  +
            GreetingWithErrorsError::InvalidGreeting(_inner) =>
         370  +
            /* ServerOperationErrorGenerator.kt:103 */
         371  +
            {
         372  +
                Some(_inner)
         373  +
            }
         374  +
            ,
         375  +
            /* ServerOperationErrorGenerator.kt:142 */
         376  +
            GreetingWithErrorsError::ComplexError(_inner) =>
         377  +
            /* ServerOperationErrorGenerator.kt:103 */
         378  +
            {
         379  +
                Some(_inner)
         380  +
            }
         381  +
            ,
         382  +
            /* ServerOperationErrorGenerator.kt:142 */
         383  +
            GreetingWithErrorsError::FooError(_inner) =>
         384  +
            /* ServerOperationErrorGenerator.kt:103 */
         385  +
            {
         386  +
                Some(_inner)
  180    387   
            }
         388  +
            /* ServerOperationErrorGenerator.kt:139 */
  181    389   
        }
         390  +
        /* ServerOperationErrorGenerator.kt:101 */
         391  +
    }
         392  +
    /* ServerOperationErrorGenerator.kt:100 */
  182    393   
}
         394  +
/* ServerOperationErrorGenerator.kt:110 */
  183    395   
impl ::std::convert::From<crate::error::InvalidGreeting> for crate::error::GreetingWithErrorsError {
         396  +
    /* ServerOperationErrorGenerator.kt:111 */
  184    397   
    fn from(variant: crate::error::InvalidGreeting) -> crate::error::GreetingWithErrorsError {
         398  +
        /* ServerOperationErrorGenerator.kt:112 */
  185    399   
        Self::InvalidGreeting(variant)
         400  +
        /* ServerOperationErrorGenerator.kt:111 */
  186    401   
    }
         402  +
    /* ServerOperationErrorGenerator.kt:110 */
  187    403   
}
         404  +
/* ServerOperationErrorGenerator.kt:110 */
  188    405   
impl ::std::convert::From<crate::error::ComplexError> for crate::error::GreetingWithErrorsError {
         406  +
    /* ServerOperationErrorGenerator.kt:111 */
  189    407   
    fn from(variant: crate::error::ComplexError) -> crate::error::GreetingWithErrorsError {
         408  +
        /* ServerOperationErrorGenerator.kt:112 */
  190    409   
        Self::ComplexError(variant)
         410  +
        /* ServerOperationErrorGenerator.kt:111 */
  191    411   
    }
         412  +
    /* ServerOperationErrorGenerator.kt:110 */
  192    413   
}
         414  +
/* ServerOperationErrorGenerator.kt:110 */
  193    415   
impl ::std::convert::From<crate::error::FooError> for crate::error::GreetingWithErrorsError {
         416  +
    /* ServerOperationErrorGenerator.kt:111 */
  194    417   
    fn from(variant: crate::error::FooError) -> crate::error::GreetingWithErrorsError {
         418  +
        /* ServerOperationErrorGenerator.kt:112 */
  195    419   
        Self::FooError(variant)
         420  +
        /* ServerOperationErrorGenerator.kt:111 */
  196    421   
    }
         422  +
    /* ServerOperationErrorGenerator.kt:110 */
  197    423   
}
  198    424   
  199         -
/// This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
         425  +
/// /* StructureGenerator.kt:197 */This error has test cases that test some of the dark corners of Amazon service framework history. It should only be implemented by clients.
         426  +
/* RustType.kt:516 */
  200    427   
#[derive(
  201    428   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  202    429   
)]
  203         -
pub struct FooError {}
         430  +
pub /* StructureGenerator.kt:201 */ struct FooError {/* StructureGenerator.kt:201 */}
         431  +
/* ErrorImplGenerator.kt:99 */
  204    432   
impl FooError {
         433  +
    /* ErrorImplGenerator.kt:141 */
  205    434   
    #[doc(hidden)]
  206    435   
    /// Returns the error name.
  207    436   
    pub fn name(&self) -> &'static str {
  208    437   
        "FooError"
  209    438   
    }
         439  +
    /* ErrorImplGenerator.kt:99 */
  210    440   
}
         441  +
/* ErrorImplGenerator.kt:153 */
  211    442   
impl ::std::fmt::Display for FooError {
         443  +
    /* ErrorImplGenerator.kt:154 */
  212    444   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         445  +
        /* ErrorImplGenerator.kt:161 */
  213    446   
        ::std::write!(f, "FooError")?;
         447  +
        /* ErrorImplGenerator.kt:171 */
  214    448   
        Ok(())
         449  +
        /* ErrorImplGenerator.kt:154 */
  215    450   
    }
         451  +
    /* ErrorImplGenerator.kt:153 */
  216    452   
}
         453  +
/* ErrorImplGenerator.kt:175 */
  217    454   
impl ::std::error::Error for FooError {}
         455  +
/* ServerCodegenVisitor.kt:345 */
  218    456   
impl FooError {
  219         -
    /// Creates a new builder-style object to manufacture [`FooError`](crate::error::FooError).
         457  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`FooError`](crate::error::FooError).
         458  +
    /* ServerBuilderGenerator.kt:295 */
  220    459   
    pub fn builder() -> crate::error::foo_error::Builder {
         460  +
        /* ServerBuilderGenerator.kt:296 */
  221    461   
        crate::error::foo_error::Builder::default()
         462  +
        /* ServerBuilderGenerator.kt:295 */
  222    463   
    }
         464  +
    /* ServerCodegenVisitor.kt:345 */
  223    465   
}
  224    466   
  225         -
/// This error is thrown when a request is invalid.
         467  +
/// /* StructureGenerator.kt:197 */This error is thrown when a request is invalid.
         468  +
/* RustType.kt:516 */
  226    469   
#[derive(
  227    470   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  228    471   
)]
  229         -
pub struct ComplexError {
         472  +
pub /* StructureGenerator.kt:201 */ struct ComplexError {
         473  +
    /* StructureGenerator.kt:231 */
  230    474   
    #[allow(missing_docs)] // documentation missing in model
  231    475   
    pub top_level: ::std::option::Option<::std::string::String>,
         476  +
    /* StructureGenerator.kt:231 */
  232    477   
    #[allow(missing_docs)] // documentation missing in model
  233    478   
    pub nested: ::std::option::Option<crate::model::ComplexNestedErrorData>,
         479  +
    /* StructureGenerator.kt:201 */
  234    480   
}
         481  +
/* StructureGenerator.kt:135 */
  235    482   
impl ComplexError {
         483  +
    /* StructureGenerator.kt:231 */
  236    484   
    #[allow(missing_docs)] // documentation missing in model
         485  +
                           /* StructureGenerator.kt:166 */
  237    486   
    pub fn top_level(&self) -> ::std::option::Option<&str> {
         487  +
        /* StructureGenerator.kt:169 */
  238    488   
        self.top_level.as_deref()
         489  +
        /* StructureGenerator.kt:166 */
  239    490   
    }
         491  +
    /* StructureGenerator.kt:231 */
  240    492   
    #[allow(missing_docs)] // documentation missing in model
         493  +
                           /* StructureGenerator.kt:166 */
  241    494   
    pub fn nested(&self) -> ::std::option::Option<&crate::model::ComplexNestedErrorData> {
         495  +
        /* StructureGenerator.kt:170 */
  242    496   
        self.nested.as_ref()
         497  +
        /* StructureGenerator.kt:166 */
  243    498   
    }
         499  +
    /* StructureGenerator.kt:135 */
  244    500   
}
         501  +
/* ErrorImplGenerator.kt:99 */
  245    502   
impl ComplexError {
         503  +
    /* ErrorImplGenerator.kt:141 */
  246    504   
    #[doc(hidden)]
  247    505   
    /// Returns the error name.
  248    506   
    pub fn name(&self) -> &'static str {
  249    507   
        "ComplexError"
  250    508   
    }
         509  +
    /* ErrorImplGenerator.kt:99 */
  251    510   
}
         511  +
/* ErrorImplGenerator.kt:153 */
  252    512   
impl ::std::fmt::Display for ComplexError {
         513  +
    /* ErrorImplGenerator.kt:154 */
  253    514   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         515  +
        /* ErrorImplGenerator.kt:161 */
  254    516   
        ::std::write!(f, "ComplexError")?;
         517  +
        /* ErrorImplGenerator.kt:171 */
  255    518   
        Ok(())
         519  +
        /* ErrorImplGenerator.kt:154 */
  256    520   
    }
         521  +
    /* ErrorImplGenerator.kt:153 */
  257    522   
}
         523  +
/* ErrorImplGenerator.kt:175 */
  258    524   
impl ::std::error::Error for ComplexError {}
         525  +
/* ServerCodegenVisitor.kt:345 */
  259    526   
impl ComplexError {
  260         -
    /// Creates a new builder-style object to manufacture [`ComplexError`](crate::error::ComplexError).
         527  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ComplexError`](crate::error::ComplexError).
         528  +
    /* ServerBuilderGenerator.kt:295 */
  261    529   
    pub fn builder() -> crate::error::complex_error::Builder {
         530  +
        /* ServerBuilderGenerator.kt:296 */
  262    531   
        crate::error::complex_error::Builder::default()
         532  +
        /* ServerBuilderGenerator.kt:295 */
  263    533   
    }
         534  +
    /* ServerCodegenVisitor.kt:345 */
  264    535   
}
  265    536   
  266         -
/// This error is thrown when an invalid greeting value is provided.
         537  +
/// /* StructureGenerator.kt:197 */This error is thrown when an invalid greeting value is provided.
         538  +
/* RustType.kt:516 */
  267    539   
#[derive(
  268    540   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  269    541   
)]
  270         -
pub struct InvalidGreeting {
         542  +
pub /* StructureGenerator.kt:201 */ struct InvalidGreeting {
         543  +
    /* StructureGenerator.kt:231 */
  271    544   
    #[allow(missing_docs)] // documentation missing in model
  272    545   
    pub message: ::std::option::Option<::std::string::String>,
         546  +
    /* StructureGenerator.kt:201 */
  273    547   
}
         548  +
/* ErrorImplGenerator.kt:99 */
  274    549   
impl InvalidGreeting {
         550  +
    /* ErrorImplGenerator.kt:128 */
  275    551   
    /// Returns the error message.
  276    552   
    pub fn message(&self) -> ::std::option::Option<&str> {
  277    553   
        self.message.as_deref()
  278    554   
    }
         555  +
    /* ErrorImplGenerator.kt:141 */
  279    556   
    #[doc(hidden)]
  280    557   
    /// Returns the error name.
  281    558   
    pub fn name(&self) -> &'static str {
  282    559   
        "InvalidGreeting"
  283    560   
    }
         561  +
    /* ErrorImplGenerator.kt:99 */
  284    562   
}
         563  +
/* ErrorImplGenerator.kt:153 */
  285    564   
impl ::std::fmt::Display for InvalidGreeting {
         565  +
    /* ErrorImplGenerator.kt:154 */
  286    566   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         567  +
        /* ErrorImplGenerator.kt:161 */
  287    568   
        ::std::write!(f, "InvalidGreeting")?;
         569  +
        /* ErrorImplGenerator.kt:166 */
  288    570   
        if let ::std::option::Option::Some(inner_1) = &self.message {
         571  +
            /* ErrorImplGenerator.kt:166 */
  289    572   
            {
         573  +
                /* ErrorImplGenerator.kt:167 */
  290    574   
                ::std::write!(f, ": {}", inner_1)?;
         575  +
                /* ErrorImplGenerator.kt:166 */
  291    576   
            }
         577  +
            /* ErrorImplGenerator.kt:166 */
  292    578   
        }
         579  +
        /* ErrorImplGenerator.kt:171 */
  293    580   
        Ok(())
         581  +
        /* ErrorImplGenerator.kt:154 */
  294    582   
    }
         583  +
    /* ErrorImplGenerator.kt:153 */
  295    584   
}
         585  +
/* ErrorImplGenerator.kt:175 */
  296    586   
impl ::std::error::Error for InvalidGreeting {}
         587  +
/* ServerCodegenVisitor.kt:345 */
  297    588   
impl InvalidGreeting {
  298         -
    /// Creates a new builder-style object to manufacture [`InvalidGreeting`](crate::error::InvalidGreeting).
         589  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`InvalidGreeting`](crate::error::InvalidGreeting).
         590  +
    /* ServerBuilderGenerator.kt:295 */
  299    591   
    pub fn builder() -> crate::error::invalid_greeting::Builder {
         592  +
        /* ServerBuilderGenerator.kt:296 */
  300    593   
        crate::error::invalid_greeting::Builder::default()
         594  +
        /* ServerBuilderGenerator.kt:295 */
  301    595   
    }
         596  +
    /* ServerCodegenVisitor.kt:345 */
  302    597   
}
  303    598   
         599  +
/* ServerOperationErrorGenerator.kt:63 */
  304    600   
/// Error type for the `JsonEnums` operation.
         601  +
/* ServerOperationErrorGenerator.kt:64 */
  305    602   
/// Each variant represents an error that can occur for the `JsonEnums` operation.
         603  +
/* RustType.kt:516 */
  306    604   
#[derive(::std::fmt::Debug)]
  307         -
pub enum JsonEnumsError {
  308         -
    /// 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.
         605  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum JsonEnumsError {
         606  +
    /// /* ServerOperationErrorGenerator.kt:68 */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.
         607  +
    /* ServerOperationErrorGenerator.kt:71 */
  309    608   
    ValidationException(crate::error::ValidationException),
         609  +
    /* ServerOperationErrorGenerator.kt:66 */
  310    610   
}
         611  +
/* ServerOperationErrorGenerator.kt:75 */
  311    612   
impl ::std::fmt::Display for JsonEnumsError {
         613  +
    /* ServerOperationErrorGenerator.kt:76 */
  312    614   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         615  +
        /* ServerOperationErrorGenerator.kt:139 */
  313    616   
        match &self {
  314         -
            JsonEnumsError::ValidationException(_inner) => _inner.fmt(f),
         617  +
            /* ServerOperationErrorGenerator.kt:142 */
         618  +
            JsonEnumsError::ValidationException(_inner) =>
         619  +
            /* ServerOperationErrorGenerator.kt:78 */
         620  +
            {
         621  +
                _inner.fmt(f)
  315    622   
            }
         623  +
            /* ServerOperationErrorGenerator.kt:139 */
  316    624   
        }
         625  +
        /* ServerOperationErrorGenerator.kt:76 */
         626  +
    }
         627  +
    /* ServerOperationErrorGenerator.kt:75 */
  317    628   
}
         629  +
/* ServerOperationErrorGenerator.kt:83 */
  318    630   
impl JsonEnumsError {
         631  +
    /* ServerOperationErrorGenerator.kt:87 */
  319    632   
    /// Returns `true` if the error kind is `JsonEnumsError::ValidationException`.
         633  +
    /* ServerOperationErrorGenerator.kt:88 */
  320    634   
    pub fn is_validation_exception(&self) -> bool {
         635  +
        /* ServerOperationErrorGenerator.kt:89 */
  321    636   
        matches!(&self, JsonEnumsError::ValidationException(_))
         637  +
        /* ServerOperationErrorGenerator.kt:88 */
  322    638   
    }
         639  +
    /* ServerOperationErrorGenerator.kt:92 */
  323    640   
    /// Returns the error name string by matching the correct variant.
         641  +
    /* ServerOperationErrorGenerator.kt:93 */
  324    642   
    pub fn name(&self) -> &'static str {
         643  +
        /* ServerOperationErrorGenerator.kt:139 */
  325    644   
        match &self {
  326         -
            JsonEnumsError::ValidationException(_inner) => _inner.name(),
         645  +
            /* ServerOperationErrorGenerator.kt:142 */
         646  +
            JsonEnumsError::ValidationException(_inner) =>
         647  +
            /* ServerOperationErrorGenerator.kt:95 */
         648  +
            {
         649  +
                _inner.name()
  327    650   
            }
         651  +
            /* ServerOperationErrorGenerator.kt:139 */
  328    652   
        }
         653  +
        /* ServerOperationErrorGenerator.kt:93 */
         654  +
    }
         655  +
    /* ServerOperationErrorGenerator.kt:83 */
  329    656   
}
         657  +
/* ServerOperationErrorGenerator.kt:100 */
  330    658   
impl ::std::error::Error for JsonEnumsError {
         659  +
    /* ServerOperationErrorGenerator.kt:101 */
  331    660   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         661  +
        /* ServerOperationErrorGenerator.kt:139 */
  332    662   
        match &self {
  333         -
            JsonEnumsError::ValidationException(_inner) => Some(_inner),
         663  +
            /* ServerOperationErrorGenerator.kt:142 */
         664  +
            JsonEnumsError::ValidationException(_inner) =>
         665  +
            /* ServerOperationErrorGenerator.kt:103 */
         666  +
            {
         667  +
                Some(_inner)
         668  +
            }
         669  +
            /* ServerOperationErrorGenerator.kt:139 */
  334    670   
        }
         671  +
        /* ServerOperationErrorGenerator.kt:101 */
  335    672   
    }
         673  +
    /* ServerOperationErrorGenerator.kt:100 */
  336    674   
}
         675  +
/* ServerOperationErrorGenerator.kt:110 */
  337    676   
impl ::std::convert::From<crate::error::ValidationException> for crate::error::JsonEnumsError {
         677  +
    /* ServerOperationErrorGenerator.kt:111 */
  338    678   
    fn from(variant: crate::error::ValidationException) -> crate::error::JsonEnumsError {
         679  +
        /* ServerOperationErrorGenerator.kt:112 */
  339    680   
        Self::ValidationException(variant)
         681  +
        /* ServerOperationErrorGenerator.kt:111 */
  340    682   
    }
         683  +
    /* ServerOperationErrorGenerator.kt:110 */
  341    684   
}
  342    685   
         686  +
/* ServerOperationErrorGenerator.kt:63 */
  343    687   
/// Error type for the `KitchenSinkOperation` operation.
         688  +
/* ServerOperationErrorGenerator.kt:64 */
  344    689   
/// Each variant represents an error that can occur for the `KitchenSinkOperation` operation.
         690  +
/* RustType.kt:516 */
  345    691   
#[derive(::std::fmt::Debug)]
  346         -
pub enum KitchenSinkOperationError {
         692  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum KitchenSinkOperationError {
         693  +
    /* ServerOperationErrorGenerator.kt:68 */
  347    694   
    #[allow(missing_docs)] // documentation missing in model
         695  +
    /* ServerOperationErrorGenerator.kt:71 */
  348    696   
    ErrorWithMembers(crate::error::ErrorWithMembers),
         697  +
    /* ServerOperationErrorGenerator.kt:68 */
  349    698   
    #[allow(missing_docs)] // documentation missing in model
         699  +
    /* ServerOperationErrorGenerator.kt:71 */
  350    700   
    ErrorWithoutMembers(crate::error::ErrorWithoutMembers),
         701  +
    /* ServerOperationErrorGenerator.kt:66 */
  351    702   
}
         703  +
/* ServerOperationErrorGenerator.kt:75 */
  352    704   
impl ::std::fmt::Display for KitchenSinkOperationError {
         705  +
    /* ServerOperationErrorGenerator.kt:76 */
  353    706   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         707  +
        /* ServerOperationErrorGenerator.kt:139 */
  354    708   
        match &self {
  355         -
            KitchenSinkOperationError::ErrorWithMembers(_inner) => _inner.fmt(f),
  356         -
            KitchenSinkOperationError::ErrorWithoutMembers(_inner) => _inner.fmt(f),
         709  +
            /* ServerOperationErrorGenerator.kt:142 */
         710  +
            KitchenSinkOperationError::ErrorWithMembers(_inner) =>
         711  +
            /* ServerOperationErrorGenerator.kt:78 */
         712  +
            {
         713  +
                _inner.fmt(f)
         714  +
            }
         715  +
            ,
         716  +
            /* ServerOperationErrorGenerator.kt:142 */
         717  +
            KitchenSinkOperationError::ErrorWithoutMembers(_inner) =>
         718  +
            /* ServerOperationErrorGenerator.kt:78 */
         719  +
            {
         720  +
                _inner.fmt(f)
         721  +
            }
         722  +
            /* ServerOperationErrorGenerator.kt:139 */
  357    723   
        }
         724  +
        /* ServerOperationErrorGenerator.kt:76 */
  358    725   
    }
         726  +
    /* ServerOperationErrorGenerator.kt:75 */
  359    727   
}
         728  +
/* ServerOperationErrorGenerator.kt:83 */
  360    729   
impl KitchenSinkOperationError {
         730  +
    /* ServerOperationErrorGenerator.kt:87 */
  361    731   
    /// Returns `true` if the error kind is `KitchenSinkOperationError::ErrorWithMembers`.
         732  +
    /* ServerOperationErrorGenerator.kt:88 */
  362    733   
    pub fn is_error_with_members(&self) -> bool {
         734  +
        /* ServerOperationErrorGenerator.kt:89 */
  363    735   
        matches!(&self, KitchenSinkOperationError::ErrorWithMembers(_))
         736  +
        /* ServerOperationErrorGenerator.kt:88 */
  364    737   
    }
         738  +
    /* ServerOperationErrorGenerator.kt:87 */
  365    739   
    /// Returns `true` if the error kind is `KitchenSinkOperationError::ErrorWithoutMembers`.
         740  +
    /* ServerOperationErrorGenerator.kt:88 */
  366    741   
    pub fn is_error_without_members(&self) -> bool {
         742  +
        /* ServerOperationErrorGenerator.kt:89 */
  367    743   
        matches!(&self, KitchenSinkOperationError::ErrorWithoutMembers(_))
         744  +
        /* ServerOperationErrorGenerator.kt:88 */
  368    745   
    }
         746  +
    /* ServerOperationErrorGenerator.kt:92 */
  369    747   
    /// Returns the error name string by matching the correct variant.
         748  +
    /* ServerOperationErrorGenerator.kt:93 */
  370    749   
    pub fn name(&self) -> &'static str {
         750  +
        /* ServerOperationErrorGenerator.kt:139 */
  371    751   
        match &self {
  372         -
            KitchenSinkOperationError::ErrorWithMembers(_inner) => _inner.name(),
  373         -
            KitchenSinkOperationError::ErrorWithoutMembers(_inner) => _inner.name(),
         752  +
            /* ServerOperationErrorGenerator.kt:142 */
         753  +
            KitchenSinkOperationError::ErrorWithMembers(_inner) =>
         754  +
            /* ServerOperationErrorGenerator.kt:95 */
         755  +
            {
         756  +
                _inner.name()
         757  +
            }
         758  +
            ,
         759  +
            /* ServerOperationErrorGenerator.kt:142 */
         760  +
            KitchenSinkOperationError::ErrorWithoutMembers(_inner) =>
         761  +
            /* ServerOperationErrorGenerator.kt:95 */
         762  +
            {
         763  +
                _inner.name()
  374    764   
            }
         765  +
            /* ServerOperationErrorGenerator.kt:139 */
  375    766   
        }
         767  +
        /* ServerOperationErrorGenerator.kt:93 */
         768  +
    }
         769  +
    /* ServerOperationErrorGenerator.kt:83 */
  376    770   
}
         771  +
/* ServerOperationErrorGenerator.kt:100 */
  377    772   
impl ::std::error::Error for KitchenSinkOperationError {
         773  +
    /* ServerOperationErrorGenerator.kt:101 */
  378    774   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         775  +
        /* ServerOperationErrorGenerator.kt:139 */
  379    776   
        match &self {
  380         -
            KitchenSinkOperationError::ErrorWithMembers(_inner) => Some(_inner),
  381         -
            KitchenSinkOperationError::ErrorWithoutMembers(_inner) => Some(_inner),
         777  +
            /* ServerOperationErrorGenerator.kt:142 */
         778  +
            KitchenSinkOperationError::ErrorWithMembers(_inner) =>
         779  +
            /* ServerOperationErrorGenerator.kt:103 */
         780  +
            {
         781  +
                Some(_inner)
         782  +
            }
         783  +
            ,
         784  +
            /* ServerOperationErrorGenerator.kt:142 */
         785  +
            KitchenSinkOperationError::ErrorWithoutMembers(_inner) =>
         786  +
            /* ServerOperationErrorGenerator.kt:103 */
         787  +
            {
         788  +
                Some(_inner)
  382    789   
            }
         790  +
            /* ServerOperationErrorGenerator.kt:139 */
  383    791   
        }
         792  +
        /* ServerOperationErrorGenerator.kt:101 */
         793  +
    }
         794  +
    /* ServerOperationErrorGenerator.kt:100 */
  384    795   
}
         796  +
/* ServerOperationErrorGenerator.kt:110 */
  385    797   
impl ::std::convert::From<crate::error::ErrorWithMembers>
  386    798   
    for crate::error::KitchenSinkOperationError
  387    799   
{
         800  +
    /* ServerOperationErrorGenerator.kt:111 */
  388    801   
    fn from(variant: crate::error::ErrorWithMembers) -> crate::error::KitchenSinkOperationError {
         802  +
        /* ServerOperationErrorGenerator.kt:112 */
  389    803   
        Self::ErrorWithMembers(variant)
         804  +
        /* ServerOperationErrorGenerator.kt:111 */
  390    805   
    }
         806  +
    /* ServerOperationErrorGenerator.kt:110 */
  391    807   
}
         808  +
/* ServerOperationErrorGenerator.kt:110 */
  392    809   
impl ::std::convert::From<crate::error::ErrorWithoutMembers>
  393    810   
    for crate::error::KitchenSinkOperationError
  394    811   
{
         812  +
    /* ServerOperationErrorGenerator.kt:111 */
  395    813   
    fn from(variant: crate::error::ErrorWithoutMembers) -> crate::error::KitchenSinkOperationError {
         814  +
        /* ServerOperationErrorGenerator.kt:112 */
  396    815   
        Self::ErrorWithoutMembers(variant)
         816  +
        /* ServerOperationErrorGenerator.kt:111 */
  397    817   
    }
         818  +
    /* ServerOperationErrorGenerator.kt:110 */
  398    819   
}
  399    820   
         821  +
/* StructureGenerator.kt:197 */
  400    822   
#[allow(missing_docs)] // documentation missing in model
         823  +
/* RustType.kt:516 */
  401    824   
#[derive(
  402    825   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  403    826   
)]
  404         -
pub struct ErrorWithoutMembers {}
         827  +
pub /* StructureGenerator.kt:201 */ struct ErrorWithoutMembers {/* StructureGenerator.kt:201 */}
         828  +
/* ErrorImplGenerator.kt:99 */
  405    829   
impl ErrorWithoutMembers {
         830  +
    /* ErrorImplGenerator.kt:141 */
  406    831   
    #[doc(hidden)]
  407    832   
    /// Returns the error name.
  408    833   
    pub fn name(&self) -> &'static str {
  409    834   
        "ErrorWithoutMembers"
  410    835   
    }
         836  +
    /* ErrorImplGenerator.kt:99 */
  411    837   
}
         838  +
/* ErrorImplGenerator.kt:153 */
  412    839   
impl ::std::fmt::Display for ErrorWithoutMembers {
         840  +
    /* ErrorImplGenerator.kt:154 */
  413    841   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         842  +
        /* ErrorImplGenerator.kt:161 */
  414    843   
        ::std::write!(f, "ErrorWithoutMembers")?;
         844  +
        /* ErrorImplGenerator.kt:171 */
  415    845   
        Ok(())
         846  +
        /* ErrorImplGenerator.kt:154 */
  416    847   
    }
         848  +
    /* ErrorImplGenerator.kt:153 */
  417    849   
}
         850  +
/* ErrorImplGenerator.kt:175 */
  418    851   
impl ::std::error::Error for ErrorWithoutMembers {}
         852  +
/* ServerCodegenVisitor.kt:345 */
  419    853   
impl ErrorWithoutMembers {
  420         -
    /// Creates a new builder-style object to manufacture [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
         854  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
         855  +
    /* ServerBuilderGenerator.kt:295 */
  421    856   
    pub fn builder() -> crate::error::error_without_members::Builder {
         857  +
        /* ServerBuilderGenerator.kt:296 */
  422    858   
        crate::error::error_without_members::Builder::default()
         859  +
        /* ServerBuilderGenerator.kt:295 */
  423    860   
    }
         861  +
    /* ServerCodegenVisitor.kt:345 */
  424    862   
}
  425    863   
         864  +
/* StructureGenerator.kt:197 */
  426    865   
#[allow(missing_docs)] // documentation missing in model
         866  +
/* RustType.kt:516 */
  427    867   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
  428         -
pub struct ErrorWithMembers {
         868  +
pub /* StructureGenerator.kt:201 */ struct ErrorWithMembers {
         869  +
    /* StructureGenerator.kt:231 */
  429    870   
    #[allow(missing_docs)] // documentation missing in model
  430    871   
    pub code: ::std::option::Option<::std::string::String>,
         872  +
    /* StructureGenerator.kt:231 */
  431    873   
    #[allow(missing_docs)] // documentation missing in model
  432    874   
    pub complex_data: ::std::option::Option<crate::model::KitchenSink>,
         875  +
    /* StructureGenerator.kt:231 */
  433    876   
    #[allow(missing_docs)] // documentation missing in model
  434    877   
    pub integer_field: ::std::option::Option<i32>,
         878  +
    /* StructureGenerator.kt:231 */
  435    879   
    #[allow(missing_docs)] // documentation missing in model
  436    880   
    pub list_field: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         881  +
    /* StructureGenerator.kt:231 */
  437    882   
    #[allow(missing_docs)] // documentation missing in model
  438    883   
    pub map_field: ::std::option::Option<
  439    884   
        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  440    885   
    >,
         886  +
    /* StructureGenerator.kt:231 */
  441    887   
    #[allow(missing_docs)] // documentation missing in model
  442    888   
    pub message: ::std::option::Option<::std::string::String>,
  443         -
    /// abc
         889  +
    /// /* StructureGenerator.kt:231 */abc
  444    890   
    pub string_field: ::std::option::Option<::std::string::String>,
         891  +
    /* StructureGenerator.kt:201 */
  445    892   
}
         893  +
/* StructureGenerator.kt:135 */
  446    894   
impl ErrorWithMembers {
         895  +
    /* StructureGenerator.kt:231 */
  447    896   
    #[allow(missing_docs)] // documentation missing in model
         897  +
                           /* StructureGenerator.kt:166 */
  448    898   
    pub fn code(&self) -> ::std::option::Option<&str> {
         899  +
        /* StructureGenerator.kt:169 */
  449    900   
        self.code.as_deref()
         901  +
        /* StructureGenerator.kt:166 */
  450    902   
    }
         903  +
    /* StructureGenerator.kt:231 */
  451    904   
    #[allow(missing_docs)] // documentation missing in model
         905  +
                           /* StructureGenerator.kt:166 */
  452    906   
    pub fn complex_data(&self) -> ::std::option::Option<&crate::model::KitchenSink> {
         907  +
        /* StructureGenerator.kt:170 */
  453    908   
        self.complex_data.as_ref()
         909  +
        /* StructureGenerator.kt:166 */
  454    910   
    }
         911  +
    /* StructureGenerator.kt:231 */
  455    912   
    #[allow(missing_docs)] // documentation missing in model
         913  +
                           /* StructureGenerator.kt:166 */
  456    914   
    pub fn integer_field(&self) -> ::std::option::Option<i32> {
         915  +
        /* StructureGenerator.kt:168 */
  457    916   
        self.integer_field
         917  +
        /* StructureGenerator.kt:166 */
  458    918   
    }
         919  +
    /* StructureGenerator.kt:231 */
  459    920   
    #[allow(missing_docs)] // documentation missing in model
         921  +
                           /* StructureGenerator.kt:166 */
  460    922   
    pub fn list_field(&self) -> ::std::option::Option<&[::std::string::String]> {
         923  +
        /* StructureGenerator.kt:169 */
  461    924   
        self.list_field.as_deref()
         925  +
        /* StructureGenerator.kt:166 */
  462    926   
    }
         927  +
    /* StructureGenerator.kt:231 */
  463    928   
    #[allow(missing_docs)] // documentation missing in model
         929  +
                           /* StructureGenerator.kt:166 */
  464    930   
    pub fn map_field(
  465    931   
        &self,
  466    932   
    ) -> ::std::option::Option<
  467    933   
        &::std::collections::HashMap<::std::string::String, ::std::string::String>,
  468    934   
    > {
         935  +
        /* StructureGenerator.kt:170 */
  469    936   
        self.map_field.as_ref()
         937  +
        /* StructureGenerator.kt:166 */
  470    938   
    }
  471         -
    /// abc
         939  +
    /// /* StructureGenerator.kt:231 */abc
         940  +
    /* StructureGenerator.kt:166 */
  472    941   
    pub fn string_field(&self) -> ::std::option::Option<&str> {
         942  +
        /* StructureGenerator.kt:169 */
  473    943   
        self.string_field.as_deref()
         944  +
        /* StructureGenerator.kt:166 */
  474    945   
    }
         946  +
    /* StructureGenerator.kt:135 */
  475    947   
}
         948  +
/* ErrorImplGenerator.kt:99 */
  476    949   
impl ErrorWithMembers {
         950  +
    /* ErrorImplGenerator.kt:128 */
  477    951   
    /// Returns the error message.
  478    952   
    pub fn message(&self) -> ::std::option::Option<&str> {
  479    953   
        self.message.as_deref()
  480    954   
    }
         955  +
    /* ErrorImplGenerator.kt:141 */
  481    956   
    #[doc(hidden)]
  482    957   
    /// Returns the error name.
  483    958   
    pub fn name(&self) -> &'static str {
  484    959   
        "ErrorWithMembers"
  485    960   
    }
         961  +
    /* ErrorImplGenerator.kt:99 */
  486    962   
}
         963  +
/* ErrorImplGenerator.kt:153 */
  487    964   
impl ::std::fmt::Display for ErrorWithMembers {
         965  +
    /* ErrorImplGenerator.kt:154 */
  488    966   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         967  +
        /* ErrorImplGenerator.kt:161 */
  489    968   
        ::std::write!(f, "ErrorWithMembers")?;
         969  +
        /* ErrorImplGenerator.kt:166 */
  490    970   
        if let ::std::option::Option::Some(inner_2) = &self.message {
         971  +
            /* ErrorImplGenerator.kt:166 */
  491    972   
            {
         973  +
                /* ErrorImplGenerator.kt:167 */
  492    974   
                ::std::write!(f, ": {}", inner_2)?;
         975  +
                /* ErrorImplGenerator.kt:166 */
  493    976   
            }
         977  +
            /* ErrorImplGenerator.kt:166 */
  494    978   
        }
         979  +
        /* ErrorImplGenerator.kt:171 */
  495    980   
        Ok(())
         981  +
        /* ErrorImplGenerator.kt:154 */
  496    982   
    }
         983  +
    /* ErrorImplGenerator.kt:153 */
  497    984   
}
         985  +
/* ErrorImplGenerator.kt:175 */
  498    986   
impl ::std::error::Error for ErrorWithMembers {}
         987  +
/* ServerCodegenVisitor.kt:345 */
  499    988   
impl ErrorWithMembers {
  500         -
    /// Creates a new builder-style object to manufacture [`ErrorWithMembers`](crate::error::ErrorWithMembers).
         989  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ErrorWithMembers`](crate::error::ErrorWithMembers).
         990  +
    /* ServerBuilderGenerator.kt:295 */
  501    991   
    pub fn builder() -> crate::error::error_with_members::Builder {
         992  +
        /* ServerBuilderGenerator.kt:296 */
  502    993   
        crate::error::error_with_members::Builder::default()
         994  +
        /* ServerBuilderGenerator.kt:295 */
  503    995   
    }
         996  +
    /* ServerCodegenVisitor.kt:345 */
  504    997   
}
  505    998   
  506         -
/// See [`ValidationException`](crate::error::ValidationException).
         999  +
/// /* ServerBuilderGenerator.kt:171 */See [`ValidationException`](crate::error::ValidationException).
  507   1000   
pub mod validation_exception {
  508   1001   
        1002  +
    /* RustType.kt:516 */
  509   1003   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  510         -
    /// Holds one variant for each of the ways the builder can fail.
        1004  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
        1005  +
    /* RustType.kt:516 */
  511   1006   
    #[non_exhaustive]
        1007  +
    /* ServerBuilderConstraintViolations.kt:75 */
  512   1008   
    #[allow(clippy::enum_variant_names)]
  513   1009   
    pub enum ConstraintViolation {
  514         -
        /// `message` was not provided but it is required when building `ValidationException`.
        1010  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`message` was not provided but it is required when building `ValidationException`.
        1011  +
        /* ServerBuilderConstraintViolations.kt:143 */
  515   1012   
        MissingMessage,
        1013  +
        /* ServerBuilderConstraintViolations.kt:75 */
  516   1014   
    }
        1015  +
    /* ServerBuilderConstraintViolations.kt:117 */
  517   1016   
    impl ::std::fmt::Display for ConstraintViolation {
        1017  +
        /* ServerBuilderConstraintViolations.kt:118 */
  518   1018   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        1019  +
            /* ServerBuilderConstraintViolations.kt:119 */
  519   1020   
            match self {
  520         -
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
  521         -
            }
        1021  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
        1022  +
            /* ServerBuilderConstraintViolations.kt:119 */}
        1023  +
            /* ServerBuilderConstraintViolations.kt:118 */
  522   1024   
        }
        1025  +
        /* ServerBuilderConstraintViolations.kt:117 */
  523   1026   
    }
        1027  +
    /* ServerBuilderConstraintViolations.kt:84 */
  524   1028   
    impl ::std::error::Error for ConstraintViolation {}
        1029  +
    /* ServerBuilderGenerator.kt:446 */
  525   1030   
    impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
  526   1031   
        type Error = ConstraintViolation;
  527   1032   
  528   1033   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  529   1034   
            builder.build()
  530   1035   
        }
  531   1036   
    }
  532         -
    /// A builder for [`ValidationException`](crate::error::ValidationException).
        1037  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ValidationException`](crate::error::ValidationException).
        1038  +
    /* RustType.kt:516 */
  533   1039   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1040  +
    /* ServerBuilderGenerator.kt:211 */
  534   1041   
    pub struct Builder {
        1042  +
        /* ServerBuilderGenerator.kt:308 */
  535   1043   
        pub(crate) message: ::std::option::Option<::std::string::String>,
        1044  +
        /* ServerBuilderGenerator.kt:308 */
  536   1045   
        pub(crate) field_list:
  537   1046   
            ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
        1047  +
        /* ServerBuilderGenerator.kt:211 */
  538   1048   
    }
        1049  +
    /* ServerBuilderGenerator.kt:215 */
  539   1050   
    impl Builder {
  540         -
        /// A summary of the validation failure.
        1051  +
        /// /* ServerBuilderGenerator.kt:331 */A summary of the validation failure.
        1052  +
        /* ServerBuilderGenerator.kt:343 */
  541   1053   
        pub fn message(mut self, input: ::std::string::String) -> Self {
  542         -
            self.message = Some(input);
        1054  +
            /* ServerBuilderGenerator.kt:344 */
        1055  +
            self.message =
        1056  +
                /* ServerBuilderGenerator.kt:345 */Some(
        1057  +
                    /* ServerBuilderGenerator.kt:376 */input
        1058  +
                /* ServerBuilderGenerator.kt:345 */)
        1059  +
            /* ServerBuilderGenerator.kt:344 */;
  543   1060   
            self
        1061  +
            /* ServerBuilderGenerator.kt:343 */
  544   1062   
        }
  545         -
        /// 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.
        1063  +
        /// /* ServerBuilderGenerator.kt:331 */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.
        1064  +
        /* ServerBuilderGenerator.kt:343 */
  546   1065   
        pub fn field_list(
  547   1066   
            mut self,
  548   1067   
            input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
  549   1068   
        ) -> Self {
  550         -
            self.field_list = input;
        1069  +
            /* ServerBuilderGenerator.kt:344 */
        1070  +
            self.field_list =
        1071  +
                /* ServerBuilderGenerator.kt:376 */input
        1072  +
            /* ServerBuilderGenerator.kt:344 */;
  551   1073   
            self
        1074  +
            /* ServerBuilderGenerator.kt:343 */
  552   1075   
        }
  553         -
        /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
  554         -
        ///
        1076  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
        1077  +
        /// /* ServerBuilderGenerator.kt:260 */
  555   1078   
        /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if a [`ConstraintViolation`] occurs.
  556   1079   
        ///
        1080  +
        /* ServerBuilderGenerator.kt:271 */
  557   1081   
        pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
  558   1082   
            self.build_enforcing_all_constraints()
  559   1083   
        }
        1084  +
        /* ServerBuilderGenerator.kt:283 */
  560   1085   
        fn build_enforcing_all_constraints(
  561   1086   
            self,
  562   1087   
        ) -> Result<crate::error::ValidationException, ConstraintViolation> {
  563         -
            Ok(crate::error::ValidationException {
  564         -
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
        1088  +
            /* ServerBuilderGenerator.kt:287 */
        1089  +
            Ok(
        1090  +
                /* ServerBuilderGenerator.kt:542 */
        1091  +
                crate::error::ValidationException {
        1092  +
                    /* ServerBuilderGenerator.kt:546 */
        1093  +
                    message: self
        1094  +
                        .message
        1095  +
                        /* ServerBuilderGenerator.kt:569 */
        1096  +
                        .ok_or(ConstraintViolation::MissingMessage)?,
        1097  +
                    /* ServerBuilderGenerator.kt:546 */
  565   1098   
                    field_list: self.field_list,
  566         -
            })
        1099  +
                    /* ServerBuilderGenerator.kt:542 */
        1100  +
                }, /* ServerBuilderGenerator.kt:287 */
        1101  +
            )
        1102  +
            /* ServerBuilderGenerator.kt:283 */
  567   1103   
        }
        1104  +
        /* ServerBuilderGenerator.kt:215 */
  568   1105   
    }
        1106  +
        1107  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  569   1108   
}
  570         -
/// See [`FooError`](crate::error::FooError).
        1109  +
/// /* ServerBuilderGenerator.kt:171 */See [`FooError`](crate::error::FooError).
  571   1110   
pub mod foo_error {
  572   1111   
        1112  +
    /* ServerBuilderGenerator.kt:461 */
  573   1113   
    impl ::std::convert::From<Builder> for crate::error::FooError {
  574   1114   
        fn from(builder: Builder) -> Self {
  575   1115   
            builder.build()
  576   1116   
        }
  577   1117   
    }
  578         -
    /// A builder for [`FooError`](crate::error::FooError).
        1118  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`FooError`](crate::error::FooError).
        1119  +
    /* RustType.kt:516 */
  579   1120   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  580         -
    pub struct Builder {}
        1121  +
    /* ServerBuilderGenerator.kt:211 */
        1122  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
        1123  +
    /* ServerBuilderGenerator.kt:215 */
  581   1124   
    impl Builder {
  582         -
        /// Consumes the builder and constructs a [`FooError`](crate::error::FooError).
        1125  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`FooError`](crate::error::FooError).
        1126  +
        /* ServerBuilderGenerator.kt:271 */
  583   1127   
        pub fn build(self) -> crate::error::FooError {
  584   1128   
            self.build_enforcing_all_constraints()
  585   1129   
        }
        1130  +
        /* ServerBuilderGenerator.kt:283 */
  586   1131   
        fn build_enforcing_all_constraints(self) -> crate::error::FooError {
  587         -
            crate::error::FooError {}
        1132  +
            /* ServerBuilderGenerator.kt:542 */
        1133  +
            crate::error::FooError {
        1134  +
            /* ServerBuilderGenerator.kt:542 */}
        1135  +
            /* ServerBuilderGenerator.kt:283 */
  588   1136   
        }
        1137  +
        /* ServerBuilderGenerator.kt:215 */
  589   1138   
    }
        1139  +
        1140  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  590   1141   
}
  591         -
/// See [`ComplexError`](crate::error::ComplexError).
        1142  +
/// /* ServerBuilderGenerator.kt:171 */See [`ComplexError`](crate::error::ComplexError).
  592   1143   
pub mod complex_error {
  593   1144   
        1145  +
    /* ServerBuilderGenerator.kt:461 */
  594   1146   
    impl ::std::convert::From<Builder> for crate::error::ComplexError {
  595   1147   
        fn from(builder: Builder) -> Self {
  596   1148   
            builder.build()
  597   1149   
        }
  598   1150   
    }
  599         -
    /// A builder for [`ComplexError`](crate::error::ComplexError).
        1151  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ComplexError`](crate::error::ComplexError).
        1152  +
    /* RustType.kt:516 */
  600   1153   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1154  +
    /* ServerBuilderGenerator.kt:211 */
  601   1155   
    pub struct Builder {
        1156  +
        /* ServerBuilderGenerator.kt:308 */
  602   1157   
        pub(crate) top_level: ::std::option::Option<::std::string::String>,
        1158  +
        /* ServerBuilderGenerator.kt:308 */
  603   1159   
        pub(crate) nested: ::std::option::Option<crate::model::ComplexNestedErrorData>,
        1160  +
        /* ServerBuilderGenerator.kt:211 */
  604   1161   
    }
        1162  +
    /* ServerBuilderGenerator.kt:215 */
  605   1163   
    impl Builder {
        1164  +
        /* ServerBuilderGenerator.kt:331 */
  606   1165   
        #[allow(missing_docs)] // documentation missing in model
        1166  +
                               /* ServerBuilderGenerator.kt:343 */
  607   1167   
        pub fn top_level(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  608         -
            self.top_level = input;
        1168  +
            /* ServerBuilderGenerator.kt:344 */
        1169  +
            self.top_level =
        1170  +
                /* ServerBuilderGenerator.kt:376 */input
        1171  +
            /* ServerBuilderGenerator.kt:344 */;
  609   1172   
            self
        1173  +
            /* ServerBuilderGenerator.kt:343 */
  610   1174   
        }
        1175  +
        /* ServerBuilderGenerator.kt:331 */
  611   1176   
        #[allow(missing_docs)] // documentation missing in model
        1177  +
                               /* ServerBuilderGenerator.kt:343 */
  612   1178   
        pub fn nested(
  613   1179   
            mut self,
  614   1180   
            input: ::std::option::Option<crate::model::ComplexNestedErrorData>,
  615   1181   
        ) -> Self {
  616         -
            self.nested = input;
        1182  +
            /* ServerBuilderGenerator.kt:344 */
        1183  +
            self.nested =
        1184  +
                /* ServerBuilderGenerator.kt:376 */input
        1185  +
            /* ServerBuilderGenerator.kt:344 */;
  617   1186   
            self
        1187  +
            /* ServerBuilderGenerator.kt:343 */
  618   1188   
        }
  619         -
        /// Consumes the builder and constructs a [`ComplexError`](crate::error::ComplexError).
        1189  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ComplexError`](crate::error::ComplexError).
        1190  +
        /* ServerBuilderGenerator.kt:271 */
  620   1191   
        pub fn build(self) -> crate::error::ComplexError {
  621   1192   
            self.build_enforcing_all_constraints()
  622   1193   
        }
        1194  +
        /* ServerBuilderGenerator.kt:283 */
  623   1195   
        fn build_enforcing_all_constraints(self) -> crate::error::ComplexError {
        1196  +
            /* ServerBuilderGenerator.kt:542 */
  624   1197   
            crate::error::ComplexError {
        1198  +
                /* ServerBuilderGenerator.kt:546 */
  625   1199   
                top_level: self.top_level,
        1200  +
                /* ServerBuilderGenerator.kt:546 */
  626   1201   
                nested: self.nested,
        1202  +
                /* ServerBuilderGenerator.kt:542 */
  627   1203   
            }
        1204  +
            /* ServerBuilderGenerator.kt:283 */
  628   1205   
        }
        1206  +
        /* ServerBuilderGenerator.kt:215 */
  629   1207   
    }
        1208  +
        1209  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  630   1210   
}
  631         -
/// See [`InvalidGreeting`](crate::error::InvalidGreeting).
        1211  +
/// /* ServerBuilderGenerator.kt:171 */See [`InvalidGreeting`](crate::error::InvalidGreeting).
  632   1212   
pub mod invalid_greeting {
  633   1213   
        1214  +
    /* ServerBuilderGenerator.kt:461 */
  634   1215   
    impl ::std::convert::From<Builder> for crate::error::InvalidGreeting {
  635   1216   
        fn from(builder: Builder) -> Self {
  636   1217   
            builder.build()
  637   1218   
        }
  638   1219   
    }
  639         -
    /// A builder for [`InvalidGreeting`](crate::error::InvalidGreeting).
        1220  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`InvalidGreeting`](crate::error::InvalidGreeting).
        1221  +
    /* RustType.kt:516 */
  640   1222   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1223  +
    /* ServerBuilderGenerator.kt:211 */
  641   1224   
    pub struct Builder {
        1225  +
        /* ServerBuilderGenerator.kt:308 */
  642   1226   
        pub(crate) message: ::std::option::Option<::std::string::String>,
        1227  +
        /* ServerBuilderGenerator.kt:211 */
  643   1228   
    }
        1229  +
    /* ServerBuilderGenerator.kt:215 */
  644   1230   
    impl Builder {
        1231  +
        /* ServerBuilderGenerator.kt:331 */
  645   1232   
        #[allow(missing_docs)] // documentation missing in model
        1233  +
                               /* ServerBuilderGenerator.kt:343 */
  646   1234   
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  647         -
            self.message = input;
        1235  +
            /* ServerBuilderGenerator.kt:344 */
        1236  +
            self.message =
        1237  +
                /* ServerBuilderGenerator.kt:376 */input
        1238  +
            /* ServerBuilderGenerator.kt:344 */;
  648   1239   
            self
        1240  +
            /* ServerBuilderGenerator.kt:343 */
  649   1241   
        }
  650         -
        /// Consumes the builder and constructs a [`InvalidGreeting`](crate::error::InvalidGreeting).
        1242  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`InvalidGreeting`](crate::error::InvalidGreeting).
        1243  +
        /* ServerBuilderGenerator.kt:271 */
  651   1244   
        pub fn build(self) -> crate::error::InvalidGreeting {
  652   1245   
            self.build_enforcing_all_constraints()
  653   1246   
        }
        1247  +
        /* ServerBuilderGenerator.kt:283 */
  654   1248   
        fn build_enforcing_all_constraints(self) -> crate::error::InvalidGreeting {
        1249  +
            /* ServerBuilderGenerator.kt:542 */
  655   1250   
            crate::error::InvalidGreeting {
        1251  +
                /* ServerBuilderGenerator.kt:546 */
  656   1252   
                message: self.message,
        1253  +
                /* ServerBuilderGenerator.kt:542 */
  657   1254   
            }
        1255  +
            /* ServerBuilderGenerator.kt:283 */
  658   1256   
        }
        1257  +
        /* ServerBuilderGenerator.kt:215 */
  659   1258   
    }
        1259  +
        1260  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  660   1261   
}
  661         -
/// See [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
        1262  +
/// /* ServerBuilderGenerator.kt:171 */See [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
  662   1263   
pub mod error_without_members {
  663   1264   
        1265  +
    /* ServerBuilderGenerator.kt:461 */
  664   1266   
    impl ::std::convert::From<Builder> for crate::error::ErrorWithoutMembers {
  665   1267   
        fn from(builder: Builder) -> Self {
  666   1268   
            builder.build()
  667   1269   
        }
  668   1270   
    }
  669         -
    /// A builder for [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
        1271  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
        1272  +
    /* RustType.kt:516 */
  670   1273   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  671         -
    pub struct Builder {}
        1274  +
    /* ServerBuilderGenerator.kt:211 */
        1275  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
        1276  +
    /* ServerBuilderGenerator.kt:215 */
  672   1277   
    impl Builder {
  673         -
        /// Consumes the builder and constructs a [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
        1278  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ErrorWithoutMembers`](crate::error::ErrorWithoutMembers).
        1279  +
        /* ServerBuilderGenerator.kt:271 */
  674   1280   
        pub fn build(self) -> crate::error::ErrorWithoutMembers {
  675   1281   
            self.build_enforcing_all_constraints()
  676   1282   
        }
        1283  +
        /* ServerBuilderGenerator.kt:283 */
  677   1284   
        fn build_enforcing_all_constraints(self) -> crate::error::ErrorWithoutMembers {
  678         -
            crate::error::ErrorWithoutMembers {}
        1285  +
            /* ServerBuilderGenerator.kt:542 */
        1286  +
            crate::error::ErrorWithoutMembers {
        1287  +
            /* ServerBuilderGenerator.kt:542 */}
        1288  +
            /* ServerBuilderGenerator.kt:283 */
  679   1289   
        }
        1290  +
        /* ServerBuilderGenerator.kt:215 */
  680   1291   
    }
        1292  +
        1293  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  681   1294   
}
  682         -
/// See [`ErrorWithMembers`](crate::error::ErrorWithMembers).
        1295  +
/// /* ServerBuilderGenerator.kt:171 */See [`ErrorWithMembers`](crate::error::ErrorWithMembers).
  683   1296   
pub mod error_with_members {
  684   1297   
        1298  +
    /* ServerBuilderGenerator.kt:461 */
  685   1299   
    impl ::std::convert::From<Builder> for crate::error::ErrorWithMembers {
  686   1300   
        fn from(builder: Builder) -> Self {
  687   1301   
            builder.build()
  688   1302   
        }
  689   1303   
    }
  690         -
    /// A builder for [`ErrorWithMembers`](crate::error::ErrorWithMembers).
        1304  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ErrorWithMembers`](crate::error::ErrorWithMembers).
        1305  +
    /* RustType.kt:516 */
  691   1306   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1307  +
    /* ServerBuilderGenerator.kt:211 */
  692   1308   
    pub struct Builder {
        1309  +
        /* ServerBuilderGenerator.kt:308 */
  693   1310   
        pub(crate) code: ::std::option::Option<::std::string::String>,
        1311  +
        /* ServerBuilderGenerator.kt:308 */
  694   1312   
        pub(crate) complex_data: ::std::option::Option<crate::model::KitchenSink>,
        1313  +
        /* ServerBuilderGenerator.kt:308 */
  695   1314   
        pub(crate) integer_field: ::std::option::Option<i32>,
        1315  +
        /* ServerBuilderGenerator.kt:308 */
  696   1316   
        pub(crate) list_field: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
        1317  +
        /* ServerBuilderGenerator.kt:308 */
  697   1318   
        pub(crate) map_field: ::std::option::Option<
  698   1319   
            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  699   1320   
        >,
        1321  +
        /* ServerBuilderGenerator.kt:308 */
  700   1322   
        pub(crate) message: ::std::option::Option<::std::string::String>,
        1323  +
        /* ServerBuilderGenerator.kt:308 */
  701   1324   
        pub(crate) string_field: ::std::option::Option<::std::string::String>,
        1325  +
        /* ServerBuilderGenerator.kt:211 */
  702   1326   
    }
        1327  +
    /* ServerBuilderGenerator.kt:215 */
  703   1328   
    impl Builder {
        1329  +
        /* ServerBuilderGenerator.kt:331 */
  704   1330   
        #[allow(missing_docs)] // documentation missing in model
        1331  +
                               /* ServerBuilderGenerator.kt:343 */
  705   1332   
        pub fn code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  706         -
            self.code = input;
        1333  +
            /* ServerBuilderGenerator.kt:344 */
        1334  +
            self.code =
        1335  +
                /* ServerBuilderGenerator.kt:376 */input
        1336  +
            /* ServerBuilderGenerator.kt:344 */;
  707   1337   
            self
        1338  +
            /* ServerBuilderGenerator.kt:343 */
  708   1339   
        }
        1340  +
        /* ServerBuilderGenerator.kt:331 */
  709   1341   
        #[allow(missing_docs)] // documentation missing in model
        1342  +
                               /* ServerBuilderGenerator.kt:343 */
  710   1343   
        pub fn complex_data(
  711   1344   
            mut self,
  712   1345   
            input: ::std::option::Option<crate::model::KitchenSink>,
  713   1346   
        ) -> Self {
  714         -
            self.complex_data = input;
        1347  +
            /* ServerBuilderGenerator.kt:344 */
        1348  +
            self.complex_data =
        1349  +
                /* ServerBuilderGenerator.kt:376 */input
        1350  +
            /* ServerBuilderGenerator.kt:344 */;
  715   1351   
            self
        1352  +
            /* ServerBuilderGenerator.kt:343 */
  716   1353   
        }
        1354  +
        /* ServerBuilderGenerator.kt:331 */
  717   1355   
        #[allow(missing_docs)] // documentation missing in model
        1356  +
                               /* ServerBuilderGenerator.kt:343 */
  718   1357   
        pub fn integer_field(mut self, input: ::std::option::Option<i32>) -> Self {
  719         -
            self.integer_field = input;
        1358  +
            /* ServerBuilderGenerator.kt:344 */
        1359  +
            self.integer_field =
        1360  +
                /* ServerBuilderGenerator.kt:376 */input
        1361  +
            /* ServerBuilderGenerator.kt:344 */;
  720   1362   
            self
        1363  +
            /* ServerBuilderGenerator.kt:343 */
  721   1364   
        }
        1365  +
        /* ServerBuilderGenerator.kt:331 */
  722   1366   
        #[allow(missing_docs)] // documentation missing in model
        1367  +
                               /* ServerBuilderGenerator.kt:343 */
  723   1368   
        pub fn list_field(
  724   1369   
            mut self,
  725   1370   
            input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
  726   1371   
        ) -> Self {
  727         -
            self.list_field = input;
        1372  +
            /* ServerBuilderGenerator.kt:344 */
        1373  +
            self.list_field =
        1374  +
                /* ServerBuilderGenerator.kt:376 */input
        1375  +
            /* ServerBuilderGenerator.kt:344 */;
  728   1376   
            self
        1377  +
            /* ServerBuilderGenerator.kt:343 */
  729   1378   
        }
        1379  +
        /* ServerBuilderGenerator.kt:331 */
  730   1380   
        #[allow(missing_docs)] // documentation missing in model
        1381  +
                               /* ServerBuilderGenerator.kt:343 */
  731   1382   
        pub fn map_field(
  732   1383   
            mut self,
  733   1384   
            input: ::std::option::Option<
  734   1385   
                ::std::collections::HashMap<::std::string::String, ::std::string::String>,
  735   1386   
            >,
  736   1387   
        ) -> Self {
  737         -
            self.map_field = input;
        1388  +
            /* ServerBuilderGenerator.kt:344 */
        1389  +
            self.map_field =
        1390  +
                /* ServerBuilderGenerator.kt:376 */input
        1391  +
            /* ServerBuilderGenerator.kt:344 */;
  738   1392   
            self
        1393  +
            /* ServerBuilderGenerator.kt:343 */
  739   1394   
        }
        1395  +
        /* ServerBuilderGenerator.kt:331 */
  740   1396   
        #[allow(missing_docs)] // documentation missing in model
        1397  +
                               /* ServerBuilderGenerator.kt:343 */
  741   1398   
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  742         -
            self.message = input;
        1399  +
            /* ServerBuilderGenerator.kt:344 */
        1400  +
            self.message =
        1401  +
                /* ServerBuilderGenerator.kt:376 */input
        1402  +
            /* ServerBuilderGenerator.kt:344 */;
  743   1403   
            self
        1404  +
            /* ServerBuilderGenerator.kt:343 */
  744   1405   
        }
  745         -
        /// abc
        1406  +
        /// /* ServerBuilderGenerator.kt:331 */abc
        1407  +
        /* ServerBuilderGenerator.kt:343 */
  746   1408   
        pub fn string_field(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  747         -
            self.string_field = input;
        1409  +
            /* ServerBuilderGenerator.kt:344 */
        1410  +
            self.string_field =
        1411  +
                /* ServerBuilderGenerator.kt:376 */input
        1412  +
            /* ServerBuilderGenerator.kt:344 */;
  748   1413   
            self
        1414  +
            /* ServerBuilderGenerator.kt:343 */
  749   1415   
        }
  750         -
        /// Consumes the builder and constructs a [`ErrorWithMembers`](crate::error::ErrorWithMembers).
        1416  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ErrorWithMembers`](crate::error::ErrorWithMembers).
        1417  +
        /* ServerBuilderGenerator.kt:271 */
  751   1418   
        pub fn build(self) -> crate::error::ErrorWithMembers {
  752   1419   
            self.build_enforcing_all_constraints()
  753   1420   
        }
        1421  +
        /* ServerBuilderGenerator.kt:283 */
  754   1422   
        fn build_enforcing_all_constraints(self) -> crate::error::ErrorWithMembers {
        1423  +
            /* ServerBuilderGenerator.kt:542 */
  755   1424   
            crate::error::ErrorWithMembers {
        1425  +
                /* ServerBuilderGenerator.kt:546 */
  756   1426   
                code: self.code,
        1427  +
                /* ServerBuilderGenerator.kt:546 */
  757   1428   
                complex_data: self.complex_data,
        1429  +
                /* ServerBuilderGenerator.kt:546 */
  758   1430   
                integer_field: self.integer_field,
        1431  +
                /* ServerBuilderGenerator.kt:546 */
  759   1432   
                list_field: self.list_field,
        1433  +
                /* ServerBuilderGenerator.kt:546 */
  760   1434   
                map_field: self.map_field,
        1435  +
                /* ServerBuilderGenerator.kt:546 */
  761   1436   
                message: self.message,
        1437  +
                /* ServerBuilderGenerator.kt:546 */
  762   1438   
                string_field: self.string_field,
        1439  +
                /* ServerBuilderGenerator.kt:542 */
  763   1440   
            }
        1441  +
            /* ServerBuilderGenerator.kt:283 */
  764   1442   
        }
        1443  +
        /* ServerBuilderGenerator.kt:215 */
  765   1444   
    }
        1445  +
        1446  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  766   1447   
}