Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/rest_json/rust-server-codegen/src/protocol_serde/shape_timestamp_format_headers.rs

@@ -1,1 +217,293 @@
    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_timestamp_format_headers_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::TimestampFormatHeadersInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::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::rest_json_1::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::timestamp_format_headers_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:794 */
   22     30   
        if let Some(value) =
   23     31   
            crate::protocol_serde::shape_timestamp_format_headers_input::de_default_format_header(
   24     32   
                &headers,
   25     33   
            )?
   26     34   
        {
   27     35   
            input = input.set_default_format(Some(value))
   28     36   
        }
          37  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   29     38   
        if let Some(value) =
   30     39   
            crate::protocol_serde::shape_timestamp_format_headers_input::de_member_date_time_header(
   31     40   
                &headers,
   32     41   
            )?
   33     42   
        {
   34     43   
            input = input.set_member_date_time(Some(value))
   35     44   
        }
          45  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   36     46   
        if let Some(value) = crate::protocol_serde::shape_timestamp_format_headers_input::de_member_epoch_seconds_header(&headers)? {
   37     47   
                                input = input.set_member_epoch_seconds(Some(value))
   38     48   
                            }
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   39     50   
        if let Some(value) =
   40     51   
            crate::protocol_serde::shape_timestamp_format_headers_input::de_member_http_date_header(
   41     52   
                &headers,
   42     53   
            )?
   43     54   
        {
   44     55   
            input = input.set_member_http_date(Some(value))
   45     56   
        }
          57  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   46     58   
        if let Some(value) =
   47     59   
            crate::protocol_serde::shape_timestamp_format_headers_input::de_target_date_time_header(
   48     60   
                &headers,
   49     61   
            )?
   50     62   
        {
   51     63   
            input = input.set_target_date_time(Some(value))
   52     64   
        }
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   53     66   
        if let Some(value) = crate::protocol_serde::shape_timestamp_format_headers_input::de_target_epoch_seconds_header(&headers)? {
   54     67   
                                input = input.set_target_epoch_seconds(Some(value))
   55     68   
                            }
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   56     70   
        if let Some(value) =
   57     71   
            crate::protocol_serde::shape_timestamp_format_headers_input::de_target_http_date_header(
   58     72   
                &headers,
   59     73   
            )?
   60     74   
        {
   61     75   
            input = input.set_target_http_date(Some(value))
   62     76   
        }
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   63     78   
        input.build()
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   64     80   
    })
          81  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   65     82   
}
   66     83   
          84  +
/* RustType.kt:516 */
   67     85   
#[allow(clippy::unnecessary_wraps)]
          86  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   68     87   
pub fn ser_timestamp_format_headers_http_response(
   69     88   
    #[allow(unused_variables)] output: crate::output::TimestampFormatHeadersOutput,
   70     89   
) -> std::result::Result<
   71     90   
    ::aws_smithy_http_server::response::Response,
   72     91   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   73     92   
> {
          93  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   74     94   
    Ok({
          95  +
        /* RustType.kt:516 */
   75     96   
        #[allow(unused_mut)]
          97  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   76     98   
        let mut builder = ::http::Response::builder();
          99  +
        /* ServerHttpBoundProtocolGenerator.kt:629 */
   77    100   
        builder = crate::protocol_serde::shape_timestamp_format_headers::ser_timestamp_format_headers_headers(&output, builder)?;
         101  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   78    102   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79    103   
            builder,
   80    104   
            ::http::header::CONTENT_TYPE,
   81    105   
            "application/json",
   82    106   
        );
         107  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   83    108   
        let http_status: u16 = 200;
   84    109   
        builder = builder.status(http_status);
         110  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   85    111   
        let payload =
   86         -
            crate::protocol_serde::shape_timestamp_format_headers_output::ser_timestamp_format_headers_output_output_output(&output)?
   87         -
        ;
         112  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_timestamp_format_headers_output::ser_timestamp_format_headers_output_output_output(&output)?
         113  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
         114  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   88    115   
        let content_length = payload.len();
   89    116   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   90    117   
            builder,
   91    118   
            ::http::header::CONTENT_LENGTH,
   92    119   
            content_length,
   93    120   
        );
         121  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   94    122   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         123  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   95    124   
        builder.body(body)?
         125  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   96    126   
    })
         127  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   97    128   
}
   98    129   
         130  +
/* HttpBindingGenerator.kt:542 */
   99    131   
pub fn ser_timestamp_format_headers_headers(
  100    132   
    input: &crate::output::TimestampFormatHeadersOutput,
  101    133   
    mut builder: ::http::response::Builder,
  102    134   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  103    135   
{
         136  +
    /* HttpBindingGenerator.kt:592 */
  104    137   
    if let ::std::option::Option::Some(inner_1) = &input.member_epoch_seconds {
         138  +
        /* HttpBindingGenerator.kt:704 */
  105    139   
        let formatted_2 = inner_1.fmt(::aws_smithy_types::date_time::Format::EpochSeconds)?;
         140  +
        /* HttpBindingGenerator.kt:705 */
  106    141   
        if !formatted_2.is_empty() {
         142  +
            /* HttpBindingGenerator.kt:706 */
  107    143   
            let header_value = formatted_2;
  108    144   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  109    145   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  110    146   
                    "member_epoch_seconds",
  111    147   
                    format!(
  112    148   
                        "`{}` cannot be used as a header value: {}",
  113    149   
                        &header_value, err
  114    150   
                    ),
  115    151   
                )
  116    152   
            })?;
  117    153   
            builder = builder.header("X-memberEpochSeconds", header_value);
         154  +
            /* HttpBindingGenerator.kt:705 */
  118    155   
        }
         156  +
        /* HttpBindingGenerator.kt:592 */
  119    157   
    }
         158  +
    /* HttpBindingGenerator.kt:592 */
  120    159   
    if let ::std::option::Option::Some(inner_3) = &input.member_http_date {
         160  +
        /* HttpBindingGenerator.kt:704 */
  121    161   
        let formatted_4 = inner_3.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
         162  +
        /* HttpBindingGenerator.kt:705 */
  122    163   
        if !formatted_4.is_empty() {
         164  +
            /* HttpBindingGenerator.kt:706 */
  123    165   
            let header_value = formatted_4;
  124    166   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  125    167   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  126    168   
                    "member_http_date",
  127    169   
                    format!(
  128    170   
                        "`{}` cannot be used as a header value: {}",
  129    171   
                        &header_value, err
  130    172   
                    ),
  131    173   
                )
  132    174   
            })?;
  133    175   
            builder = builder.header("X-memberHttpDate", header_value);
         176  +
            /* HttpBindingGenerator.kt:705 */
  134    177   
        }
         178  +
        /* HttpBindingGenerator.kt:592 */
  135    179   
    }
         180  +
    /* HttpBindingGenerator.kt:592 */
  136    181   
    if let ::std::option::Option::Some(inner_5) = &input.member_date_time {
         182  +
        /* HttpBindingGenerator.kt:704 */
  137    183   
        let formatted_6 = inner_5.fmt(::aws_smithy_types::date_time::Format::DateTime)?;
         184  +
        /* HttpBindingGenerator.kt:705 */
  138    185   
        if !formatted_6.is_empty() {
         186  +
            /* HttpBindingGenerator.kt:706 */
  139    187   
            let header_value = formatted_6;
  140    188   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  141    189   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  142    190   
                    "member_date_time",
  143    191   
                    format!(
  144    192   
                        "`{}` cannot be used as a header value: {}",
  145    193   
                        &header_value, err
  146    194   
                    ),
  147    195   
                )
  148    196   
            })?;
  149    197   
            builder = builder.header("X-memberDateTime", header_value);
         198  +
            /* HttpBindingGenerator.kt:705 */
  150    199   
        }
         200  +
        /* HttpBindingGenerator.kt:592 */
  151    201   
    }
         202  +
    /* HttpBindingGenerator.kt:592 */
  152    203   
    if let ::std::option::Option::Some(inner_7) = &input.default_format {
         204  +
        /* HttpBindingGenerator.kt:704 */
  153    205   
        let formatted_8 = inner_7.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
         206  +
        /* HttpBindingGenerator.kt:705 */
  154    207   
        if !formatted_8.is_empty() {
         208  +
            /* HttpBindingGenerator.kt:706 */
  155    209   
            let header_value = formatted_8;
  156    210   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  157    211   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  158    212   
                    "default_format",
  159    213   
                    format!(
  160    214   
                        "`{}` cannot be used as a header value: {}",
  161    215   
                        &header_value, err
  162    216   
                    ),
  163    217   
                )
  164    218   
            })?;
  165    219   
            builder = builder.header("X-defaultFormat", header_value);
         220  +
            /* HttpBindingGenerator.kt:705 */
  166    221   
        }
         222  +
        /* HttpBindingGenerator.kt:592 */
  167    223   
    }
         224  +
    /* HttpBindingGenerator.kt:592 */
  168    225   
    if let ::std::option::Option::Some(inner_9) = &input.target_epoch_seconds {
         226  +
        /* HttpBindingGenerator.kt:704 */
  169    227   
        let formatted_10 = inner_9.fmt(::aws_smithy_types::date_time::Format::EpochSeconds)?;
         228  +
        /* HttpBindingGenerator.kt:705 */
  170    229   
        if !formatted_10.is_empty() {
         230  +
            /* HttpBindingGenerator.kt:706 */
  171    231   
            let header_value = formatted_10;
  172    232   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  173    233   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  174    234   
                    "target_epoch_seconds",
  175    235   
                    format!(
  176    236   
                        "`{}` cannot be used as a header value: {}",
  177    237   
                        &header_value, err
  178    238   
                    ),
  179    239   
                )
  180    240   
            })?;
  181    241   
            builder = builder.header("X-targetEpochSeconds", header_value);
         242  +
            /* HttpBindingGenerator.kt:705 */
  182    243   
        }
         244  +
        /* HttpBindingGenerator.kt:592 */
  183    245   
    }
         246  +
    /* HttpBindingGenerator.kt:592 */
  184    247   
    if let ::std::option::Option::Some(inner_11) = &input.target_http_date {
         248  +
        /* HttpBindingGenerator.kt:704 */
  185    249   
        let formatted_12 = inner_11.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
         250  +
        /* HttpBindingGenerator.kt:705 */
  186    251   
        if !formatted_12.is_empty() {
         252  +
            /* HttpBindingGenerator.kt:706 */
  187    253   
            let header_value = formatted_12;
  188    254   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  189    255   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  190    256   
                    "target_http_date",
  191    257   
                    format!(
  192    258   
                        "`{}` cannot be used as a header value: {}",
  193    259   
                        &header_value, err
  194    260   
                    ),
  195    261   
                )
  196    262   
            })?;
  197    263   
            builder = builder.header("X-targetHttpDate", header_value);
         264  +
            /* HttpBindingGenerator.kt:705 */
  198    265   
        }
         266  +
        /* HttpBindingGenerator.kt:592 */
  199    267   
    }
         268  +
    /* HttpBindingGenerator.kt:592 */
  200    269   
    if let ::std::option::Option::Some(inner_13) = &input.target_date_time {
         270  +
        /* HttpBindingGenerator.kt:704 */
  201    271   
        let formatted_14 = inner_13.fmt(::aws_smithy_types::date_time::Format::DateTime)?;
         272  +
        /* HttpBindingGenerator.kt:705 */
  202    273   
        if !formatted_14.is_empty() {
         274  +
            /* HttpBindingGenerator.kt:706 */
  203    275   
            let header_value = formatted_14;
  204    276   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  205    277   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  206    278   
                    "target_date_time",
  207    279   
                    format!(
  208    280   
                        "`{}` cannot be used as a header value: {}",
  209    281   
                        &header_value, err
  210    282   
                    ),
  211    283   
                )
  212    284   
            })?;
  213    285   
            builder = builder.header("X-targetDateTime", header_value);
         286  +
            /* HttpBindingGenerator.kt:705 */
  214    287   
        }
         288  +
        /* HttpBindingGenerator.kt:592 */
  215    289   
    }
         290  +
    /* HttpBindingGenerator.kt:555 */
  216    291   
    Ok(builder)
         292  +
    /* HttpBindingGenerator.kt:542 */
  217    293   
}

tmp-codegen-diff/codegen-server-test/rest_json/rust-server-codegen/src/protocol_serde/shape_timestamp_format_headers_input.rs

@@ -1,1 +154,175 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:153 */
    2      3   
pub(crate) fn de_default_format_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::option::Option<::aws_smithy_types::DateTime>,
    6      7   
    ::aws_smithy_http::header::ParseError,
    7      8   
> {
           9  +
    /* HttpBindingGenerator.kt:160 */
    8     10   
    let headers = header_map.get_all("X-defaultFormat");
    9         -
    let var_1: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(
   10         -
        headers,
   11         -
        ::aws_smithy_types::date_time::Format::HttpDate,
   12         -
    )?;
          11  +
    /* HttpBindingGenerator.kt:394 */
          12  +
    let var_1: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(headers, ::aws_smithy_types::date_time::Format::HttpDate)?
          13  +
    /* HttpBindingGenerator.kt:402 */;
          14  +
    /* HttpBindingGenerator.kt:468 */
   13     15   
    if var_1.len() > 1 {
   14     16   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   15     17   
            "expected one item but found {}",
   16     18   
            var_1.len()
   17     19   
        )))
   18     20   
    } else {
   19     21   
        let mut var_1 = var_1;
   20     22   
        Ok(var_1.pop())
   21     23   
    }
          24  +
    /* HttpBindingGenerator.kt:153 */
   22     25   
}
   23     26   
          27  +
/* HttpBindingGenerator.kt:153 */
   24     28   
pub(crate) fn de_member_date_time_header(
   25     29   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   26     30   
) -> ::std::result::Result<
   27     31   
    ::std::option::Option<::aws_smithy_types::DateTime>,
   28     32   
    ::aws_smithy_http::header::ParseError,
   29     33   
> {
          34  +
    /* HttpBindingGenerator.kt:160 */
   30     35   
    let headers = header_map.get_all("X-memberDateTime");
   31         -
    let var_2: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(
   32         -
        headers,
   33         -
        ::aws_smithy_types::date_time::Format::DateTime,
   34         -
    )?;
          36  +
    /* HttpBindingGenerator.kt:394 */
          37  +
    let var_2: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(headers, ::aws_smithy_types::date_time::Format::DateTime)?
          38  +
    /* HttpBindingGenerator.kt:402 */;
          39  +
    /* HttpBindingGenerator.kt:468 */
   35     40   
    if var_2.len() > 1 {
   36     41   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   37     42   
            "expected one item but found {}",
   38     43   
            var_2.len()
   39     44   
        )))
   40     45   
    } else {
   41     46   
        let mut var_2 = var_2;
   42     47   
        Ok(var_2.pop())
   43     48   
    }
          49  +
    /* HttpBindingGenerator.kt:153 */
   44     50   
}
   45     51   
          52  +
/* HttpBindingGenerator.kt:153 */
   46     53   
pub(crate) fn de_member_epoch_seconds_header(
   47     54   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   48     55   
) -> ::std::result::Result<
   49     56   
    ::std::option::Option<::aws_smithy_types::DateTime>,
   50     57   
    ::aws_smithy_http::header::ParseError,
   51     58   
> {
          59  +
    /* HttpBindingGenerator.kt:160 */
   52     60   
    let headers = header_map.get_all("X-memberEpochSeconds");
   53         -
    let var_3: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(
   54         -
        headers,
   55         -
        ::aws_smithy_types::date_time::Format::EpochSeconds,
   56         -
    )?;
          61  +
    /* HttpBindingGenerator.kt:394 */
          62  +
    let var_3: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(headers, ::aws_smithy_types::date_time::Format::EpochSeconds)?
          63  +
    /* HttpBindingGenerator.kt:402 */;
          64  +
    /* HttpBindingGenerator.kt:468 */
   57     65   
    if var_3.len() > 1 {
   58     66   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   59     67   
            "expected one item but found {}",
   60     68   
            var_3.len()
   61     69   
        )))
   62     70   
    } else {
   63     71   
        let mut var_3 = var_3;
   64     72   
        Ok(var_3.pop())
   65     73   
    }
          74  +
    /* HttpBindingGenerator.kt:153 */
   66     75   
}
   67     76   
          77  +
/* HttpBindingGenerator.kt:153 */
   68     78   
pub(crate) fn de_member_http_date_header(
   69     79   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   70     80   
) -> ::std::result::Result<
   71     81   
    ::std::option::Option<::aws_smithy_types::DateTime>,
   72     82   
    ::aws_smithy_http::header::ParseError,
   73     83   
> {
          84  +
    /* HttpBindingGenerator.kt:160 */
   74     85   
    let headers = header_map.get_all("X-memberHttpDate");
   75         -
    let var_4: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(
   76         -
        headers,
   77         -
        ::aws_smithy_types::date_time::Format::HttpDate,
   78         -
    )?;
          86  +
    /* HttpBindingGenerator.kt:394 */
          87  +
    let var_4: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(headers, ::aws_smithy_types::date_time::Format::HttpDate)?
          88  +
    /* HttpBindingGenerator.kt:402 */;
          89  +
    /* HttpBindingGenerator.kt:468 */
   79     90   
    if var_4.len() > 1 {
   80     91   
        Err(::aws_smithy_http::header::ParseError::new(format!(
   81     92   
            "expected one item but found {}",
   82     93   
            var_4.len()
   83     94   
        )))
   84     95   
    } else {
   85     96   
        let mut var_4 = var_4;
   86     97   
        Ok(var_4.pop())
   87     98   
    }
          99  +
    /* HttpBindingGenerator.kt:153 */
   88    100   
}
   89    101   
         102  +
/* HttpBindingGenerator.kt:153 */
   90    103   
pub(crate) fn de_target_date_time_header(
   91    104   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   92    105   
) -> ::std::result::Result<
   93    106   
    ::std::option::Option<::aws_smithy_types::DateTime>,
   94    107   
    ::aws_smithy_http::header::ParseError,
   95    108   
> {
         109  +
    /* HttpBindingGenerator.kt:160 */
   96    110   
    let headers = header_map.get_all("X-targetDateTime");
   97         -
    let var_5: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(
   98         -
        headers,
   99         -
        ::aws_smithy_types::date_time::Format::DateTime,
  100         -
    )?;
         111  +
    /* HttpBindingGenerator.kt:394 */
         112  +
    let var_5: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(headers, ::aws_smithy_types::date_time::Format::DateTime)?
         113  +
    /* HttpBindingGenerator.kt:402 */;
         114  +
    /* HttpBindingGenerator.kt:468 */
  101    115   
    if var_5.len() > 1 {
  102    116   
        Err(::aws_smithy_http::header::ParseError::new(format!(
  103    117   
            "expected one item but found {}",
  104    118   
            var_5.len()
  105    119   
        )))
  106    120   
    } else {
  107    121   
        let mut var_5 = var_5;
  108    122   
        Ok(var_5.pop())
  109    123   
    }
         124  +
    /* HttpBindingGenerator.kt:153 */
  110    125   
}
  111    126   
         127  +
/* HttpBindingGenerator.kt:153 */
  112    128   
pub(crate) fn de_target_epoch_seconds_header(
  113    129   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  114    130   
) -> ::std::result::Result<
  115    131   
    ::std::option::Option<::aws_smithy_types::DateTime>,
  116    132   
    ::aws_smithy_http::header::ParseError,
  117    133   
> {
         134  +
    /* HttpBindingGenerator.kt:160 */
  118    135   
    let headers = header_map.get_all("X-targetEpochSeconds");
  119         -
    let var_6: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(
  120         -
        headers,
  121         -
        ::aws_smithy_types::date_time::Format::EpochSeconds,
  122         -
    )?;
         136  +
    /* HttpBindingGenerator.kt:394 */
         137  +
    let var_6: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(headers, ::aws_smithy_types::date_time::Format::EpochSeconds)?
         138  +
    /* HttpBindingGenerator.kt:402 */;
         139  +
    /* HttpBindingGenerator.kt:468 */
  123    140   
    if var_6.len() > 1 {
  124    141   
        Err(::aws_smithy_http::header::ParseError::new(format!(
  125    142   
            "expected one item but found {}",
  126    143   
            var_6.len()
  127    144   
        )))
  128    145   
    } else {
  129    146   
        let mut var_6 = var_6;
  130    147   
        Ok(var_6.pop())
  131    148   
    }
         149  +
    /* HttpBindingGenerator.kt:153 */
  132    150   
}
  133    151   
         152  +
/* HttpBindingGenerator.kt:153 */
  134    153   
pub(crate) fn de_target_http_date_header(
  135    154   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  136    155   
) -> ::std::result::Result<
  137    156   
    ::std::option::Option<::aws_smithy_types::DateTime>,
  138    157   
    ::aws_smithy_http::header::ParseError,
  139    158   
> {
         159  +
    /* HttpBindingGenerator.kt:160 */
  140    160   
    let headers = header_map.get_all("X-targetHttpDate");
  141         -
    let var_7: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(
  142         -
        headers,
  143         -
        ::aws_smithy_types::date_time::Format::HttpDate,
  144         -
    )?;
         161  +
    /* HttpBindingGenerator.kt:394 */
         162  +
    let var_7: Vec<::aws_smithy_types::DateTime> = ::aws_smithy_http::header::many_dates(headers, ::aws_smithy_types::date_time::Format::HttpDate)?
         163  +
    /* HttpBindingGenerator.kt:402 */;
         164  +
    /* HttpBindingGenerator.kt:468 */
  145    165   
    if var_7.len() > 1 {
  146    166   
        Err(::aws_smithy_http::header::ParseError::new(format!(
  147    167   
            "expected one item but found {}",
  148    168   
            var_7.len()
  149    169   
        )))
  150    170   
    } else {
  151    171   
        let mut var_7 = var_7;
  152    172   
        Ok(var_7.pop())
  153    173   
    }
         174  +
    /* HttpBindingGenerator.kt:153 */
  154    175   
}

tmp-codegen-diff/codegen-server-test/rest_json/rust-server-codegen/src/protocol_serde/shape_timestamp_format_headers_output.rs

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_timestamp_format_headers_output_output_output(
    3      4   
    value: &crate::output::TimestampFormatHeadersOutput,
    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_timestamp_format_headers_output::ser_timestamp_format_headers_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_timestamp_format_headers_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::TimestampFormatHeadersOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

tmp-codegen-diff/codegen-server-test/rest_json/rust-server-codegen/src/protocol_serde/shape_timestamp_list.rs

@@ -1,1 +52,74 @@
    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_timestamp_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::vec::Vec<::aws_smithy_types::DateTime>>,
    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   
                    _ => {
          37  +
                        /* JsonParserGenerator.kt:419 */
   27     38   
                        let value =
   28         -
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   29         -
                                tokens.next(),
   30         -
                                ::aws_smithy_types::date_time::Format::EpochSeconds,
   31         -
                            )?;
          39  +
                            /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::EpochSeconds)?
          40  +
                        /* JsonParserGenerator.kt:419 */;
          41  +
                        /* JsonParserGenerator.kt:422 */
   32     42   
                        if let Some(value) = value {
   33     43   
                            items.push(value);
   34         -
                        } else {
          44  +
                        }
          45  +
                        /* JsonParserGenerator.kt:430 */
          46  +
                        else {
   35     47   
                            return Err(
   36     48   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     49   
                                    "dense list cannot contain null values",
   38     50   
                                ),
   39     51   
                            );
   40     52   
                        }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   41     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   42     57   
            }
   43         -
            }
          58  +
            /* JsonParserGenerator.kt:446 */
   44     59   
            Ok(Some(items))
          60  +
            /* JsonParserGenerator.kt:713 */
   45     61   
        }
   46         -
        _ => Err(
          62  +
        /* JsonParserGenerator.kt:722 */
          63  +
        _ => {
          64  +
            /* JsonParserGenerator.kt:723 */
          65  +
            Err(
   47     66   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48     67   
                    "expected start array or null",
   49     68   
                ),
   50         -
        ),
          69  +
            )
          70  +
            /* JsonParserGenerator.kt:722 */
          71  +
        } /* JsonParserGenerator.kt:712 */
   51     72   
    }
          73  +
    /* JsonParserGenerator.kt:398 */
   52     74   
}

tmp-codegen-diff/codegen-server-test/rest_json/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/rest_json/rust-server-codegen/src/protocol_serde/shape_union_payload.rs

@@ -1,1 +128,166 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:175 */
    2      3   
pub(crate) fn de_union_payload_payload(
    3      4   
    input: &[u8],
    4      5   
) -> ::std::result::Result<
    5      6   
    crate::model::UnionPayload,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
> {
           9  +
    /* JsonParserGenerator.kt:187 */
    8     10   
    let mut tokens_owned =
    9     11   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(input))
   10     12   
            .peekable();
   11     13   
    let tokens = &mut tokens_owned;
          14  +
    /* JsonParserGenerator.kt:194 */
   12     15   
    let result =
   13         -
        crate::protocol_serde::shape_union_payload::de_union_payload(tokens)?.ok_or_else(|| {
   14         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   15         -
                "expected payload member value",
   16         -
            )
   17         -
        });
          16  +
    /* JsonParserGenerator.kt:660 */crate::protocol_serde::shape_union_payload::de_union_payload(tokens)?
          17  +
    /* JsonParserGenerator.kt:196 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("expected payload member value"));
          18  +
    /* JsonParserGenerator.kt:250 */
   18     19   
    if tokens.next().is_some() {
          20  +
        /* JsonParserGenerator.kt:251 */
   19     21   
        return Err(
   20     22   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   21     23   
                "found more JSON tokens after completing parsing",
   22     24   
            ),
   23     25   
        );
          26  +
        /* JsonParserGenerator.kt:250 */
   24     27   
    }
          28  +
    /* JsonParserGenerator.kt:198 */
   25     29   
    result
          30  +
    /* JsonParserGenerator.kt:175 */
   26     31   
}
   27     32   
          33  +
/* JsonSerializerGenerator.kt:547 */
   28     34   
pub fn ser_union_payload(
   29     35   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   30     36   
    input: &crate::model::UnionPayload,
   31     37   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          38  +
    /* JsonSerializerGenerator.kt:556 */
   32     39   
    match input {
          40  +
        /* JsonSerializerGenerator.kt:564 */
   33     41   
        crate::model::UnionPayload::Greeting(inner) => {
          42  +
            /* SerializerUtil.kt:42 */
          43  +
            {
          44  +
                /* JsonSerializerGenerator.kt:423 */
   34     45   
                object.key("greeting").string(inner.as_str());
          46  +
                /* SerializerUtil.kt:42 */
   35     47   
            }
          48  +
            /* JsonSerializerGenerator.kt:564 */
   36     49   
        }
          50  +
        /* JsonSerializerGenerator.kt:556 */
          51  +
    }
          52  +
    /* JsonSerializerGenerator.kt:576 */
   37     53   
    Ok(())
          54  +
    /* JsonSerializerGenerator.kt:547 */
   38     55   
}
   39     56   
          57  +
/* JsonParserGenerator.kt:551 */
   40     58   
pub(crate) fn de_union_payload<'a, I>(
   41     59   
    tokens: &mut ::std::iter::Peekable<I>,
   42     60   
) -> ::std::result::Result<
   43     61   
    Option<crate::model::UnionPayload>,
   44     62   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   45     63   
>
   46     64   
where
   47     65   
    I: Iterator<
   48     66   
        Item = Result<
   49     67   
            ::aws_smithy_json::deserialize::Token<'a>,
   50     68   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   51     69   
        >,
   52     70   
    >,
   53     71   
{
          72  +
    /* JsonParserGenerator.kt:565 */
   54     73   
    let mut variant = None;
          74  +
    /* JsonParserGenerator.kt:567 */
   55     75   
    match tokens.next().transpose()? {
          76  +
        /* JsonParserGenerator.kt:568 */
   56     77   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   57         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
          78  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          79  +
            /* JsonParserGenerator.kt:684 */
          80  +
            loop {
          81  +
                /* JsonParserGenerator.kt:685 */
   58     82   
                match tokens.next().transpose()? {
          83  +
                    /* JsonParserGenerator.kt:686 */
   59     84   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   60     85   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          86  +
                        /* JsonParserGenerator.kt:576 */
   61     87   
                        if let ::std::option::Option::Some(::std::result::Result::Ok(
   62     88   
                            ::aws_smithy_json::deserialize::Token::ValueNull { .. },
   63     89   
                        )) = tokens.peek()
   64     90   
                        {
   65     91   
                            let _ = tokens.next().expect("peek returned a token")?;
   66     92   
                            continue;
   67     93   
                        }
          94  +
                        /* JsonParserGenerator.kt:585 */
   68     95   
                        let key = key.to_unescaped()?;
   69     96   
                        if key == "__type" {
   70     97   
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   71     98   
                            continue;
   72     99   
                        }
   73    100   
                        if variant.is_some() {
   74    101   
                            return Err(
   75    102   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   76    103   
                                    "encountered mixed variants in union",
   77    104   
                                ),
   78    105   
                            );
   79    106   
                        }
         107  +
                        /* JsonParserGenerator.kt:598 */
   80    108   
                        variant = match key.as_ref() {
   81         -
                        "greeting" => Some(crate::model::UnionPayload::Greeting(
   82         -
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   83         -
                                tokens.next(),
   84         -
                            )?
   85         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   86         -
                            .transpose()?
   87         -
                            .ok_or_else(|| {
   88         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   89         -
                                    "value for 'greeting' cannot be null",
   90         -
                                )
   91         -
                            })?,
   92         -
                        )),
         109  +
                            /* JsonParserGenerator.kt:601 */
         110  +
                            "greeting" => {
         111  +
                                /* JsonParserGenerator.kt:611 */
         112  +
                                Some(crate::model::UnionPayload::Greeting(
         113  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
         114  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         115  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
         116  +
                                        /* JsonParserGenerator.kt:339 */)
         117  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
         118  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'greeting' cannot be null"))?
         119  +
                                /* JsonParserGenerator.kt:611 */))
         120  +
                                /* JsonParserGenerator.kt:601 */
         121  +
                            }
         122  +
                            /* JsonParserGenerator.kt:634 */
   93    123   
                            variant => {
   94    124   
                                return Err(
   95    125   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   96    126   
                                        format!("unexpected union variant: {}", variant),
   97    127   
                                    ),
   98    128   
                                )
   99         -
                        }
         129  +
                            } /* JsonParserGenerator.kt:598 */
  100    130   
                        };
         131  +
                        /* JsonParserGenerator.kt:686 */
  101    132   
                    }
         133  +
                    /* JsonParserGenerator.kt:695 */
  102    134   
                    other => {
  103    135   
                        return Err(
  104         -
                        ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  105         -
                            "expected object key or end object, found: {:?}",
  106         -
                            other
  107         -
                        )),
         136  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         137  +
                                format!("expected object key or end object, found: {:?}", other),
         138  +
                            ),
  108    139   
                        )
         140  +
                    } /* JsonParserGenerator.kt:685 */
         141  +
                }
         142  +
                /* JsonParserGenerator.kt:684 */
  109    143   
            }
         144  +
            /* JsonParserGenerator.kt:568 */
  110    145   
        }
  111         -
        },
         146  +
        /* JsonParserGenerator.kt:642 */
  112    147   
        _ => {
  113    148   
            return Err(
  114    149   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  115    150   
                    "expected start object or null",
  116    151   
                ),
  117    152   
            )
         153  +
        } /* JsonParserGenerator.kt:567 */
  118    154   
    }
  119         -
    }
         155  +
    /* JsonParserGenerator.kt:649 */
  120    156   
    if variant.is_none() {
  121    157   
        return Err(
  122    158   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  123    159   
                "Union did not contain a valid variant.",
  124    160   
            ),
  125    161   
        );
  126    162   
    }
         163  +
    /* JsonParserGenerator.kt:657 */
  127    164   
    Ok(variant)
         165  +
    /* JsonParserGenerator.kt:551 */
  128    166   
}

tmp-codegen-diff/codegen-server-test/rest_json/rust-server-codegen/src/protocol_serde/shape_union_with_json_name.rs

@@ -1,1 +132,181 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:551 */
    2      3   
pub(crate) fn de_union_with_json_name<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::UnionWithJsonName>,
    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:565 */
   16     18   
    let mut variant = None;
          19  +
    /* JsonParserGenerator.kt:567 */
   17     20   
    match tokens.next().transpose()? {
          21  +
        /* JsonParserGenerator.kt:568 */
   18     22   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   19         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
          23  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          24  +
            /* JsonParserGenerator.kt:684 */
          25  +
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   20     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   21     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   22     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          31  +
                        /* JsonParserGenerator.kt:576 */
   23     32   
                        if let ::std::option::Option::Some(::std::result::Result::Ok(
   24     33   
                            ::aws_smithy_json::deserialize::Token::ValueNull { .. },
   25     34   
                        )) = tokens.peek()
   26     35   
                        {
   27     36   
                            let _ = tokens.next().expect("peek returned a token")?;
   28     37   
                            continue;
   29     38   
                        }
          39  +
                        /* JsonParserGenerator.kt:585 */
   30     40   
                        let key = key.to_unescaped()?;
   31     41   
                        if key == "__type" {
   32     42   
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   33     43   
                            continue;
   34     44   
                        }
   35     45   
                        if variant.is_some() {
   36     46   
                            return Err(
   37     47   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38     48   
                                    "encountered mixed variants in union",
   39     49   
                                ),
   40     50   
                            );
   41     51   
                        }
          52  +
                        /* JsonParserGenerator.kt:598 */
   42     53   
                        variant = match key.as_ref() {
   43         -
                        "FOO" => Some(crate::model::UnionWithJsonName::Foo(
   44         -
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   45         -
                                tokens.next(),
   46         -
                            )?
   47         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   48         -
                            .transpose()?
   49         -
                            .ok_or_else(|| {
   50         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   51         -
                                    "value for 'foo' cannot be null",
   52         -
                                )
   53         -
                            })?,
   54         -
                        )),
   55         -
                        "bar" => Some(crate::model::UnionWithJsonName::Bar(
   56         -
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   57         -
                                tokens.next(),
   58         -
                            )?
   59         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   60         -
                            .transpose()?
   61         -
                            .ok_or_else(|| {
   62         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   63         -
                                    "value for 'bar' cannot be null",
   64         -
                                )
   65         -
                            })?,
   66         -
                        )),
   67         -
                        "_baz" => Some(crate::model::UnionWithJsonName::Baz(
   68         -
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   69         -
                                tokens.next(),
   70         -
                            )?
   71         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   72         -
                            .transpose()?
   73         -
                            .ok_or_else(|| {
   74         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   75         -
                                    "value for 'baz' cannot be null",
   76         -
                                )
   77         -
                            })?,
   78         -
                        )),
          54  +
                            /* JsonParserGenerator.kt:601 */
          55  +
                            "FOO" => {
          56  +
                                /* JsonParserGenerator.kt:611 */
          57  +
                                Some(crate::model::UnionWithJsonName::Foo(
          58  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          59  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          60  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          61  +
                                        /* JsonParserGenerator.kt:339 */)
          62  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          63  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'foo' cannot be null"))?
          64  +
                                /* JsonParserGenerator.kt:611 */))
          65  +
                                /* JsonParserGenerator.kt:601 */
          66  +
                            }
          67  +
                            /* JsonParserGenerator.kt:601 */
          68  +
                            "bar" => {
          69  +
                                /* JsonParserGenerator.kt:611 */
          70  +
                                Some(crate::model::UnionWithJsonName::Bar(
          71  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          72  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          73  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          74  +
                                        /* JsonParserGenerator.kt:339 */)
          75  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          76  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'bar' cannot be null"))?
          77  +
                                /* JsonParserGenerator.kt:611 */))
          78  +
                                /* JsonParserGenerator.kt:601 */
          79  +
                            }
          80  +
                            /* JsonParserGenerator.kt:601 */
          81  +
                            "_baz" => {
          82  +
                                /* JsonParserGenerator.kt:611 */
          83  +
                                Some(crate::model::UnionWithJsonName::Baz(
          84  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          85  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          86  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          87  +
                                        /* JsonParserGenerator.kt:339 */)
          88  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          89  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'baz' cannot be null"))?
          90  +
                                /* JsonParserGenerator.kt:611 */))
          91  +
                                /* JsonParserGenerator.kt:601 */
          92  +
                            }
          93  +
                            /* JsonParserGenerator.kt:634 */
   79     94   
                            variant => {
   80     95   
                                return Err(
   81     96   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   82     97   
                                        format!("unexpected union variant: {}", variant),
   83     98   
                                    ),
   84     99   
                                )
   85         -
                        }
         100  +
                            } /* JsonParserGenerator.kt:598 */
   86    101   
                        };
         102  +
                        /* JsonParserGenerator.kt:686 */
   87    103   
                    }
         104  +
                    /* JsonParserGenerator.kt:695 */
   88    105   
                    other => {
   89    106   
                        return Err(
   90         -
                        ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   91         -
                            "expected object key or end object, found: {:?}",
   92         -
                            other
   93         -
                        )),
         107  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
         108  +
                                format!("expected object key or end object, found: {:?}", other),
         109  +
                            ),
   94    110   
                        )
         111  +
                    } /* JsonParserGenerator.kt:685 */
         112  +
                }
         113  +
                /* JsonParserGenerator.kt:684 */
   95    114   
            }
         115  +
            /* JsonParserGenerator.kt:568 */
   96    116   
        }
   97         -
        },
         117  +
        /* JsonParserGenerator.kt:642 */
   98    118   
        _ => {
   99    119   
            return Err(
  100    120   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  101    121   
                    "expected start object or null",
  102    122   
                ),
  103    123   
            )
         124  +
        } /* JsonParserGenerator.kt:567 */
  104    125   
    }
  105         -
    }
         126  +
    /* JsonParserGenerator.kt:649 */
  106    127   
    if variant.is_none() {
  107    128   
        return Err(
  108    129   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  109    130   
                "Union did not contain a valid variant.",
  110    131   
            ),
  111    132   
        );
  112    133   
    }
         134  +
    /* JsonParserGenerator.kt:657 */
  113    135   
    Ok(variant)
         136  +
    /* JsonParserGenerator.kt:551 */
  114    137   
}
  115    138   
         139  +
/* JsonSerializerGenerator.kt:547 */
  116    140   
pub fn ser_union_with_json_name(
  117    141   
    object_1: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
  118    142   
    input: &crate::model::UnionWithJsonName,
  119    143   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         144  +
    /* JsonSerializerGenerator.kt:556 */
  120    145   
    match input {
         146  +
        /* JsonSerializerGenerator.kt:564 */
  121    147   
        crate::model::UnionWithJsonName::Foo(inner) => {
         148  +
            /* SerializerUtil.kt:42 */
         149  +
            {
         150  +
                /* JsonSerializerGenerator.kt:423 */
  122    151   
                object_1.key("FOO").string(inner.as_str());
         152  +
                /* SerializerUtil.kt:42 */
  123    153   
            }
         154  +
            /* JsonSerializerGenerator.kt:564 */
         155  +
        }
         156  +
        /* JsonSerializerGenerator.kt:564 */
  124    157   
        crate::model::UnionWithJsonName::Bar(inner) => {
         158  +
            /* SerializerUtil.kt:42 */
         159  +
            {
         160  +
                /* JsonSerializerGenerator.kt:423 */
  125    161   
                object_1.key("bar").string(inner.as_str());
         162  +
                /* SerializerUtil.kt:42 */
         163  +
            }
         164  +
            /* JsonSerializerGenerator.kt:564 */
  126    165   
        }
         166  +
        /* JsonSerializerGenerator.kt:564 */
  127    167   
        crate::model::UnionWithJsonName::Baz(inner) => {
         168  +
            /* SerializerUtil.kt:42 */
         169  +
            {
         170  +
                /* JsonSerializerGenerator.kt:423 */
  128    171   
                object_1.key("_baz").string(inner.as_str());
         172  +
                /* SerializerUtil.kt:42 */
         173  +
            }
         174  +
            /* JsonSerializerGenerator.kt:564 */
  129    175   
        }
         176  +
        /* JsonSerializerGenerator.kt:556 */
  130    177   
    }
         178  +
    /* JsonSerializerGenerator.kt:576 */
  131    179   
    Ok(())
         180  +
    /* JsonSerializerGenerator.kt:547 */
  132    181   
}

tmp-codegen-diff/codegen-server-test/rest_json/rust-server-codegen/src/protocol_serde/shape_unit_input_and_output.rs

@@ -1,1 +54,80 @@
    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_unit_input_and_output_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::UnitInputAndOutputInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::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::rest_json_1::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::unit_input_and_output_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:811 */
   22     30   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   23     32   
        input.build()
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   24     34   
    })
          35  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   25     36   
}
   26     37   
          38  +
/* RustType.kt:516 */
   27     39   
#[allow(clippy::unnecessary_wraps)]
          40  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   28     41   
pub fn ser_unit_input_and_output_http_response(
   29     42   
    #[allow(unused_variables)] output: crate::output::UnitInputAndOutputOutput,
   30     43   
) -> std::result::Result<
   31     44   
    ::aws_smithy_http_server::response::Response,
   32     45   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     46   
> {
          47  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   34     48   
    Ok({
          49  +
        /* RustType.kt:516 */
   35     50   
        #[allow(unused_mut)]
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   36     52   
        let mut builder = ::http::Response::builder();
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   37     54   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     55   
            builder,
   39     56   
            ::http::header::CONTENT_TYPE,
   40     57   
            "application/json",
   41     58   
        );
          59  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   42     60   
        let http_status: u16 = 200;
   43     61   
        builder = builder.status(http_status);
   44         -
        let payload = "";
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          63  +
        let payload =
          64  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   45     67   
        let content_length = payload.len();
   46     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   47     69   
            builder,
   48     70   
            ::http::header::CONTENT_LENGTH,
   49     71   
            content_length,
   50     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   51     74   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   52     76   
        builder.body(body)?
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   53     78   
    })
          79  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   54     80   
}

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

@@ -1,1 +35,58 @@
    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  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_validation_exception(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::ValidationException,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.field_list {
          27  +
        /* JsonSerializerGenerator.kt:484 */
   20     28   
        let mut array_2 = object.key("fieldList").start_array();
          29  +
        /* JsonSerializerGenerator.kt:524 */
   21     30   
        for item_3 in var_1 {
          31  +
            /* SerializerUtil.kt:42 */
   22     32   
            {
          33  +
                /* JsonSerializerGenerator.kt:495 */
   23     34   
                #[allow(unused_mut)]
          35  +
                /* JsonSerializerGenerator.kt:496 */
   24     36   
                let mut object_4 = array_2.value().start_object();
          37  +
                /* JsonSerializerGenerator.kt:375 */
   25     38   
                crate::protocol_serde::shape_validation_exception_field::ser_validation_exception_field(&mut object_4, item_3)?;
          39  +
                /* JsonSerializerGenerator.kt:515 */
   26     40   
                object_4.finish();
          41  +
                /* SerializerUtil.kt:42 */
   27     42   
            }
          43  +
            /* JsonSerializerGenerator.kt:524 */
   28     44   
        }
          45  +
        /* JsonSerializerGenerator.kt:486 */
   29     46   
        array_2.finish();
          47  +
        /* JsonSerializerGenerator.kt:382 */
   30     48   
    }
          49  +
    /* SerializerUtil.kt:42 */
   31     50   
    {
          51  +
        /* JsonSerializerGenerator.kt:423 */
   32     52   
        object.key("message").string(input.message.as_str());
          53  +
        /* SerializerUtil.kt:42 */
   33     54   
    }
          55  +
    /* JsonSerializerGenerator.kt:372 */
   34     56   
    Ok(())
          57  +
    /* JsonSerializerGenerator.kt:358 */
   35     58   
}

tmp-codegen-diff/codegen-server-test/rest_json/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/rest_json/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 [`RestJson`].
    3      4   
///
    4      5   
/// Constructed via [`RestJson::builder`].
    5      6   
pub struct RestJsonBuilder<Body, L, HttpPl, ModelPl> {
    6      7   
    all_query_string_types: Option<::aws_smithy_http_server::routing::Route<Body>>,
    7      8   
    constant_and_variable_query_string: Option<::aws_smithy_http_server::routing::Route<Body>>,
    8      9   
    constant_query_string: Option<::aws_smithy_http_server::routing::Route<Body>>,
    9     10   
    content_type_parameters: Option<::aws_smithy_http_server::routing::Route<Body>>,
   10     11   
    datetime_offsets: Option<::aws_smithy_http_server::routing::Route<Body>>,
   11     12   
    document_type: Option<::aws_smithy_http_server::routing::Route<Body>>,
@@ -20611,20612 +20670,20672 @@
20631  20632   
            "aws.protocoltests.restjson",
20632  20633   
            "RestJson",
20633  20634   
        );
20634  20635   
20635  20636   
    const VERSION: Option<&'static str> = Some("2019-12-16");
20636  20637   
20637  20638   
    type Protocol = ::aws_smithy_http_server::protocol::rest_json_1::RestJson1;
20638  20639   
20639  20640   
    type Operations = Operation;
20640  20641   
}
       20642  +
/* ServiceConfigGenerator.kt:178 */
20641  20643   
/// Configuration for the [`RestJson`]. This is the central place where to register and
20642  20644   
/// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
20643  20645   
///
20644  20646   
/// ```rust,no_run
20645  20647   
/// # use rest_json::RestJsonConfig;
20646  20648   
/// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
20647  20649   
/// # use ::tower::layer::util::Identity;
20648  20650   
/// # let authentication_plugin = IdentityPlugin;
20649  20651   
/// # let authorization_plugin = IdentityPlugin;
20650  20652   
/// # let server_request_id_provider_layer = Identity::new();
@@ -20726,20728 +20785,20788 @@
20746  20748   
20747  20749   
    /// Build the configuration.
20748  20750   
    pub fn build(self) -> super::RestJsonConfig<L, H, M> {
20749  20751   
        super::RestJsonConfig {
20750  20752   
            layers: self.layers,
20751  20753   
            http_plugins: self.http_plugins,
20752  20754   
            model_plugins: self.model_plugins,
20753  20755   
        }
20754  20756   
    }
20755  20757   
}
       20758  +
/* ScopeMacroGenerator.kt:81 */
20756  20759   
/// A macro to help with scoping [plugins](crate::server::plugin) to a subset of all operations.
20757  20760   
///
20758  20761   
/// In contrast to [`crate::server::scope`](crate::server::scope), this macro has knowledge
20759  20762   
/// of the service and any operations _not_ specified will be placed in the opposing group.
20760  20763   
///
20761  20764   
/// # Example
20762  20765   
///
20763  20766   
/// ```rust
20764  20767   
/// scope! {
20765  20768   
///     /// Includes [`AllQueryStringTypes`], excluding all other operations.

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

@@ -1,1 +0,15 @@
    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::body::SdkBody;
    3      4   
pub use ::aws_smithy_types::byte_stream::error::Error as ByteStreamError;
    4      5   
pub use ::aws_smithy_types::byte_stream::AggregatedBytes;
    5         -
pub use ::aws_smithy_types::byte_stream::ByteStream;
           6  +
/* SmithyTypesPubUseExtra.kt:86 */ pub use ::aws_smithy_types::byte_stream::ByteStream;
    6      7   
#[cfg(feature = "rt-tokio")]
    7      8   
pub use ::aws_smithy_types::byte_stream::FsBuilder;
    8      9   
#[cfg(feature = "rt-tokio")]
    9     10   
pub use ::aws_smithy_types::byte_stream::Length;
   10     11   
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
          12  +
/* ServerRequiredCustomizations.kt:69 */
   11     13   
pub use ::aws_smithy_types::error::display::DisplayErrorContext;
   12     14   
pub use ::aws_smithy_types::Blob;
   13         -
pub use ::aws_smithy_types::DateTime;
          15  +
/* SmithyTypesPubUseExtra.kt:69 */ pub use ::aws_smithy_types::DateTime;

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

@@ -1,1 +338,429 @@
    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   
   15     16   
pub(crate) mod my_union_unconstrained {
   16     17   
          18  +
    /* UnconstrainedUnionGenerator.kt:82 */
   17     19   
    #[allow(clippy::enum_variant_names)]
   18     20   
    #[derive(Debug, Clone)]
   19     21   
    pub(crate) enum MyUnionUnconstrained {
   20         -
        BlobValue(::aws_smithy_types::Blob),
   21         -
        BooleanValue(bool),
   22         -
        EnumValue(::std::string::String),
          22  +
        /* UnconstrainedUnionGenerator.kt:95 */ BlobValue(::aws_smithy_types::Blob),
          23  +
        /* UnconstrainedUnionGenerator.kt:95 */ BooleanValue(bool),
          24  +
        /* UnconstrainedUnionGenerator.kt:95 */ EnumValue(::std::string::String),
          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),
          29  +
        /* UnconstrainedUnionGenerator.kt:95 */ NumberValue(i32),
          30  +
        /* UnconstrainedUnionGenerator.kt:95 */
   26     31   
        RenamedStructureValue(crate::model::RenamedGreeting),
   27         -
        StringValue(::std::string::String),
          32  +
        /* UnconstrainedUnionGenerator.kt:95 */ StringValue(::std::string::String),
          33  +
        /* UnconstrainedUnionGenerator.kt:95 */
   28     34   
        StructureValue(crate::model::GreetingStruct),
          35  +
        /* UnconstrainedUnionGenerator.kt:95 */
   29     36   
        TimestampValue(::aws_smithy_types::DateTime),
          37  +
        /* UnconstrainedUnionGenerator.kt:82 */
   30     38   
    }
          39  +
    /* UnconstrainedUnionGenerator.kt:103 */
   31     40   
    impl ::std::convert::TryFrom<MyUnionUnconstrained> for crate::model::MyUnion {
   32     41   
        type Error = crate::model::my_union::ConstraintViolation;
   33     42   
   34     43   
        fn try_from(value: MyUnionUnconstrained) -> ::std::result::Result<Self, Self::Error> {
   35     44   
            Ok(
   36     45   
        match value {
   37     46   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BlobValue(unconstrained) => Self::BlobValue(
   38     47   
                unconstrained
   39     48   
            ),
   40     49   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::BooleanValue(unconstrained) => Self::BooleanValue(
   41     50   
                unconstrained
   42     51   
            ),
   43     52   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::EnumValue(unconstrained) => Self::EnumValue(
   44     53   
                unconstrained
   45     54   
                                        .try_into()
   46     55   
                                        
   47     56   
                                        
   48     57   
                                        .map_err(Self::Error::EnumValue)?
   49     58   
            ),
   50     59   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::ListValue(unconstrained) => Self::ListValue(
   51     60   
                unconstrained
   52     61   
            ),
   53     62   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::MapValue(unconstrained) => Self::MapValue(
   54     63   
                unconstrained
   55     64   
            ),
   56     65   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::NumberValue(unconstrained) => Self::NumberValue(
   57     66   
                unconstrained
   58     67   
            ),
   59     68   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::RenamedStructureValue(unconstrained) => Self::RenamedStructureValue(
   60     69   
                unconstrained
   61     70   
            ),
   62     71   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StringValue(unconstrained) => Self::StringValue(
   63     72   
                unconstrained
   64     73   
            ),
   65     74   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::StructureValue(unconstrained) => Self::StructureValue(
   66     75   
                unconstrained
   67     76   
            ),
   68     77   
            crate::unconstrained::my_union_unconstrained::MyUnionUnconstrained::TimestampValue(unconstrained) => Self::TimestampValue(
   69     78   
                unconstrained
   70     79   
            ),
   71     80   
        }
   72     81   
    )
   73     82   
        }
   74     83   
    }
          84  +
          85  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   75     86   
}
   76     87   
pub(crate) mod sparse_set_map_unconstrained {
   77     88   
          89  +
    /* UnconstrainedMapGenerator.kt:79 */
   78     90   
    #[derive(Debug, Clone)]
   79     91   
    pub(crate) struct SparseSetMapUnconstrained(
   80     92   
        pub(crate)  std::collections::HashMap<
   81     93   
            ::std::string::String,
   82     94   
            ::std::option::Option<
   83     95   
                crate::unconstrained::string_set_unconstrained::StringSetUnconstrained,
   84     96   
            >,
   85     97   
        >,
   86     98   
    );
   87     99   
   88    100   
    impl From<SparseSetMapUnconstrained>
   89    101   
        for crate::constrained::MaybeConstrained<
   90    102   
            crate::constrained::sparse_set_map_constrained::SparseSetMapConstrained,
   91    103   
        >
   92    104   
    {
   93    105   
        fn from(value: SparseSetMapUnconstrained) -> Self {
   94    106   
            Self::Unconstrained(value)
   95    107   
        }
   96    108   
    }
         109  +
    /* UnconstrainedMapGenerator.kt:101 */
   97    110   
    impl std::convert::TryFrom<SparseSetMapUnconstrained>
   98    111   
        for crate::constrained::sparse_set_map_constrained::SparseSetMapConstrained
   99    112   
    {
         113  +
        /* UnconstrainedMapGenerator.kt:102 */
  100    114   
        type Error = crate::model::sparse_set_map::ConstraintViolation;
         115  +
        /* UnconstrainedMapGenerator.kt:104 */
  101    116   
        fn try_from(value: SparseSetMapUnconstrained) -> std::result::Result<Self, Self::Error> {
         117  +
            /* UnconstrainedMapGenerator.kt:186 */
  102    118   
            let res: ::std::result::Result<
  103    119   
                ::std::collections::HashMap<
  104    120   
                    ::std::string::String,
  105    121   
                    ::std::option::Option<crate::model::StringSet>,
  106    122   
                >,
  107    123   
                Self::Error,
  108    124   
            > = value
  109    125   
                .0
  110    126   
                .into_iter()
  111    127   
                .map(|(k, v)| match v {
  112    128   
                    None => Ok((k, None)),
  113    129   
                    Some(v) => match crate::model::StringSet::try_from(v) {
  114    130   
                        Ok(v) => Ok((k, Some(v))),
  115    131   
                        Err(inner_constraint_violation) => {
  116    132   
                            Err(Self::Error::Value(k, inner_constraint_violation))
  117    133   
                        }
  118    134   
                    },
  119    135   
                })
  120    136   
                .collect();
  121    137   
            let hm = res?;
         138  +
            /* UnconstrainedMapGenerator.kt:247 */
  122    139   
            Ok(Self(hm))
         140  +
            /* UnconstrainedMapGenerator.kt:104 */
  123    141   
        }
         142  +
        /* UnconstrainedMapGenerator.kt:101 */
  124    143   
    }
         144  +
         145  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  125    146   
}
  126    147   
pub(crate) mod string_set_unconstrained {
  127    148   
         149  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  128    150   
    #[derive(Debug, Clone)]
  129    151   
    pub(crate) struct StringSetUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
  130    152   
  131    153   
    impl From<StringSetUnconstrained>
  132    154   
        for crate::constrained::MaybeConstrained<crate::model::StringSet>
  133    155   
    {
  134    156   
        fn from(value: StringSetUnconstrained) -> Self {
  135    157   
            Self::Unconstrained(value)
  136    158   
        }
  137    159   
    }
         160  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  138    161   
    impl std::convert::TryFrom<StringSetUnconstrained> for crate::model::StringSet {
         162  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  139    163   
        type Error = crate::model::string_set::ConstraintViolation;
         164  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  140    165   
        fn try_from(value: StringSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         166  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  141    167   
            let inner = value.0;
         168  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  142    169   
            Self::try_from(inner)
         170  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  143    171   
        }
         172  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  144    173   
    }
         174  +
         175  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  145    176   
}
  146    177   
pub(crate) mod dense_set_map_unconstrained {
  147    178   
         179  +
    /* UnconstrainedMapGenerator.kt:79 */
  148    180   
    #[derive(Debug, Clone)]
  149    181   
    pub(crate) struct DenseSetMapUnconstrained(
  150    182   
        pub(crate)  std::collections::HashMap<
  151    183   
            ::std::string::String,
  152    184   
            crate::unconstrained::string_set_unconstrained::StringSetUnconstrained,
  153    185   
        >,
  154    186   
    );
  155    187   
  156    188   
    impl From<DenseSetMapUnconstrained>
  157    189   
        for crate::constrained::MaybeConstrained<
  158    190   
            crate::constrained::dense_set_map_constrained::DenseSetMapConstrained,
  159    191   
        >
  160    192   
    {
  161    193   
        fn from(value: DenseSetMapUnconstrained) -> Self {
  162    194   
            Self::Unconstrained(value)
  163    195   
        }
  164    196   
    }
         197  +
    /* UnconstrainedMapGenerator.kt:101 */
  165    198   
    impl std::convert::TryFrom<DenseSetMapUnconstrained>
  166    199   
        for crate::constrained::dense_set_map_constrained::DenseSetMapConstrained
  167    200   
    {
         201  +
        /* UnconstrainedMapGenerator.kt:102 */
  168    202   
        type Error = crate::model::dense_set_map::ConstraintViolation;
         203  +
        /* UnconstrainedMapGenerator.kt:104 */
  169    204   
        fn try_from(value: DenseSetMapUnconstrained) -> std::result::Result<Self, Self::Error> {
         205  +
            /* UnconstrainedMapGenerator.kt:186 */
  170    206   
            let res: ::std::result::Result<
  171    207   
                ::std::collections::HashMap<::std::string::String, crate::model::StringSet>,
  172    208   
                Self::Error,
  173    209   
            > = value
  174    210   
                .0
  175    211   
                .into_iter()
  176    212   
                .map(|(k, v)| match crate::model::StringSet::try_from(v) {
  177    213   
                    Ok(v) => Ok((k, v)),
  178    214   
                    Err(inner_constraint_violation) => {
  179    215   
                        Err(Self::Error::Value(k, inner_constraint_violation))
  180    216   
                    }
  181    217   
                })
  182    218   
                .collect();
  183    219   
            let hm = res?;
         220  +
            /* UnconstrainedMapGenerator.kt:247 */
  184    221   
            Ok(Self(hm))
         222  +
            /* UnconstrainedMapGenerator.kt:104 */
  185    223   
        }
         224  +
        /* UnconstrainedMapGenerator.kt:101 */
  186    225   
    }
         226  +
         227  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  187    228   
}
  188    229   
pub(crate) mod foo_enum_list_unconstrained {
  189    230   
         231  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  190    232   
    #[derive(Debug, Clone)]
  191    233   
    pub(crate) struct FooEnumListUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
  192    234   
  193    235   
    impl From<FooEnumListUnconstrained>
  194    236   
        for crate::constrained::MaybeConstrained<
  195    237   
            crate::constrained::foo_enum_list_constrained::FooEnumListConstrained,
  196    238   
        >
  197    239   
    {
  198    240   
        fn from(value: FooEnumListUnconstrained) -> Self {
  199    241   
            Self::Unconstrained(value)
  200    242   
        }
  201    243   
    }
         244  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  202    245   
    impl std::convert::TryFrom<FooEnumListUnconstrained>
  203    246   
        for crate::constrained::foo_enum_list_constrained::FooEnumListConstrained
  204    247   
    {
         248  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  205    249   
        type Error = crate::model::foo_enum_list::ConstraintViolation;
         250  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  206    251   
        fn try_from(value: FooEnumListUnconstrained) -> std::result::Result<Self, Self::Error> {
         252  +
            /* UnconstrainedCollectionGenerator.kt:127 */
  207    253   
            let res: ::std::result::Result<
  208    254   
                ::std::vec::Vec<crate::model::FooEnum>,
  209    255   
                (usize, crate::model::foo_enum::ConstraintViolation),
  210    256   
            > = value
  211    257   
                .0
  212    258   
                .into_iter()
  213    259   
                .enumerate()
  214    260   
                .map(|(idx, inner)| {
  215    261   
                    inner
  216    262   
                        .try_into()
  217    263   
                        .map_err(|inner_violation| (idx, inner_violation))
  218    264   
                })
  219    265   
                .collect();
  220    266   
            let inner =
  221    267   
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
         268  +
            /* UnconstrainedCollectionGenerator.kt:191 */
  222    269   
            Ok(Self(inner))
         270  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  223    271   
        }
         272  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  224    273   
    }
         274  +
         275  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  225    276   
}
  226    277   
pub(crate) mod integer_enum_set_unconstrained {
  227    278   
         279  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  228    280   
    #[derive(Debug, Clone)]
  229    281   
    pub(crate) struct IntegerEnumSetUnconstrained(pub(crate) std::vec::Vec<i32>);
  230    282   
  231    283   
    impl From<IntegerEnumSetUnconstrained>
  232    284   
        for crate::constrained::MaybeConstrained<crate::model::IntegerEnumSet>
  233    285   
    {
  234    286   
        fn from(value: IntegerEnumSetUnconstrained) -> Self {
  235    287   
            Self::Unconstrained(value)
  236    288   
        }
  237    289   
    }
         290  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  238    291   
    impl std::convert::TryFrom<IntegerEnumSetUnconstrained> for crate::model::IntegerEnumSet {
         292  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  239    293   
        type Error = crate::model::integer_enum_set::ConstraintViolation;
         294  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  240    295   
        fn try_from(value: IntegerEnumSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         296  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  241    297   
            let inner = value.0;
         298  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  242    299   
            Self::try_from(inner)
         300  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  243    301   
        }
         302  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  244    303   
    }
         304  +
         305  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  245    306   
}
  246    307   
pub(crate) mod foo_enum_map_unconstrained {
  247    308   
         309  +
    /* UnconstrainedMapGenerator.kt:79 */
  248    310   
    #[derive(Debug, Clone)]
  249    311   
    pub(crate) struct FooEnumMapUnconstrained(
  250    312   
        pub(crate) std::collections::HashMap<::std::string::String, ::std::string::String>,
  251    313   
    );
  252    314   
  253    315   
    impl From<FooEnumMapUnconstrained>
  254    316   
        for crate::constrained::MaybeConstrained<
  255    317   
            crate::constrained::foo_enum_map_constrained::FooEnumMapConstrained,
  256    318   
        >
  257    319   
    {
  258    320   
        fn from(value: FooEnumMapUnconstrained) -> Self {
  259    321   
            Self::Unconstrained(value)
  260    322   
        }
  261    323   
    }
         324  +
    /* UnconstrainedMapGenerator.kt:101 */
  262    325   
    impl std::convert::TryFrom<FooEnumMapUnconstrained>
  263    326   
        for crate::constrained::foo_enum_map_constrained::FooEnumMapConstrained
  264    327   
    {
         328  +
        /* UnconstrainedMapGenerator.kt:102 */
  265    329   
        type Error = crate::model::foo_enum_map::ConstraintViolation;
         330  +
        /* UnconstrainedMapGenerator.kt:104 */
  266    331   
        fn try_from(value: FooEnumMapUnconstrained) -> std::result::Result<Self, Self::Error> {
         332  +
            /* UnconstrainedMapGenerator.kt:186 */
  267    333   
            let res: ::std::result::Result<
  268    334   
                ::std::collections::HashMap<::std::string::String, crate::model::FooEnum>,
  269    335   
                Self::Error,
  270    336   
            > = value
  271    337   
                .0
  272    338   
                .into_iter()
  273    339   
                .map(|(k, v)| match crate::model::FooEnum::try_from(v) {
  274    340   
                    Ok(v) => Ok((k, v)),
  275    341   
                    Err(inner_constraint_violation) => {
  276    342   
                        Err(Self::Error::Value(k, inner_constraint_violation))
  277    343   
                    }
  278    344   
                })
  279    345   
                .collect();
  280    346   
            let hm = res?;
         347  +
            /* UnconstrainedMapGenerator.kt:247 */
  281    348   
            Ok(Self(hm))
         349  +
            /* UnconstrainedMapGenerator.kt:104 */
  282    350   
        }
         351  +
        /* UnconstrainedMapGenerator.kt:101 */
  283    352   
    }
         353  +
         354  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  284    355   
}
  285    356   
pub(crate) mod foo_enum_set_unconstrained {
  286    357   
         358  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  287    359   
    #[derive(Debug, Clone)]
  288    360   
    pub(crate) struct FooEnumSetUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
  289    361   
  290    362   
    impl From<FooEnumSetUnconstrained>
  291    363   
        for crate::constrained::MaybeConstrained<crate::model::FooEnumSet>
  292    364   
    {
  293    365   
        fn from(value: FooEnumSetUnconstrained) -> Self {
  294    366   
            Self::Unconstrained(value)
  295    367   
        }
  296    368   
    }
         369  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  297    370   
    impl std::convert::TryFrom<FooEnumSetUnconstrained> for crate::model::FooEnumSet {
         371  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  298    372   
        type Error = crate::model::foo_enum_set::ConstraintViolation;
         373  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  299    374   
        fn try_from(value: FooEnumSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         375  +
            /* UnconstrainedCollectionGenerator.kt:127 */
  300    376   
            let res: ::std::result::Result<
  301    377   
                ::std::vec::Vec<crate::model::FooEnum>,
  302    378   
                (usize, crate::model::foo_enum::ConstraintViolation),
  303    379   
            > = value
  304    380   
                .0
  305    381   
                .into_iter()
  306    382   
                .enumerate()
  307    383   
                .map(|(idx, inner)| {
  308    384   
                    inner
  309    385   
                        .try_into()
  310    386   
                        .map_err(|inner_violation| (idx, inner_violation))
  311    387   
                })
  312    388   
                .collect();
  313    389   
            let inner =
  314    390   
                res.map_err(|(idx, inner_violation)| Self::Error::Member(idx, inner_violation))?;
         391  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  315    392   
            Self::try_from(inner)
         393  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  316    394   
        }
         395  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  317    396   
    }
         397  +
         398  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  318    399   
}
  319    400   
pub(crate) mod integer_set_unconstrained {
  320    401   
         402  +
    /* UnconstrainedCollectionGenerator.kt:77 */
  321    403   
    #[derive(Debug, Clone)]
  322    404   
    pub(crate) struct IntegerSetUnconstrained(pub(crate) std::vec::Vec<i32>);
  323    405   
  324    406   
    impl From<IntegerSetUnconstrained>
  325    407   
        for crate::constrained::MaybeConstrained<crate::model::IntegerSet>
  326    408   
    {
  327    409   
        fn from(value: IntegerSetUnconstrained) -> Self {
  328    410   
            Self::Unconstrained(value)
  329    411   
        }
  330    412   
    }
         413  +
    /* UnconstrainedCollectionGenerator.kt:97 */
  331    414   
    impl std::convert::TryFrom<IntegerSetUnconstrained> for crate::model::IntegerSet {
         415  +
        /* UnconstrainedCollectionGenerator.kt:98 */
  332    416   
        type Error = crate::model::integer_set::ConstraintViolation;
         417  +
        /* UnconstrainedCollectionGenerator.kt:100 */
  333    418   
        fn try_from(value: IntegerSetUnconstrained) -> std::result::Result<Self, Self::Error> {
         419  +
            /* UnconstrainedCollectionGenerator.kt:185 */
  334    420   
            let inner = value.0;
         421  +
            /* UnconstrainedCollectionGenerator.kt:189 */
  335    422   
            Self::try_from(inner)
         423  +
            /* UnconstrainedCollectionGenerator.kt:100 */
  336    424   
        }
         425  +
        /* UnconstrainedCollectionGenerator.kt:97 */
  337    426   
    }
         427  +
         428  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  338    429   
}

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

@@ -1,1 +49,53 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
    3      3   
pub(crate) mod map_with_enum_key_constrained {
    4      4   
           5  +
    /* PubCrateConstrainedMapGenerator.kt:80 */
    5      6   
    #[derive(Debug, Clone)]
    6      7   
    pub(crate) struct MapWithEnumKeyConstrained(
    7      8   
        pub(crate) std::collections::HashMap<crate::model::StringEnum, ::std::string::String>,
    8      9   
    );
    9     10   
   10     11   
    impl crate::constrained::Constrained for MapWithEnumKeyConstrained {
   11     12   
        type Unconstrained =
   12     13   
            crate::unconstrained::map_with_enum_key_unconstrained::MapWithEnumKeyUnconstrained;
   13     14   
    }
          15  +
    /* PubCrateConstrainedMapGenerator.kt:99 */
   14     16   
    impl
   15     17   
        ::std::convert::From<
   16     18   
            ::std::collections::HashMap<crate::model::StringEnum, ::std::string::String>,
   17     19   
        > for MapWithEnumKeyConstrained
   18     20   
    {
   19     21   
        fn from(
   20     22   
            v: ::std::collections::HashMap<crate::model::StringEnum, ::std::string::String>,
   21     23   
        ) -> Self {
   22     24   
            Self(v)
   23     25   
        }
   24     26   
    }
   25     27   
   26     28   
    impl ::std::convert::From<MapWithEnumKeyConstrained>
   27     29   
        for ::std::collections::HashMap<crate::model::StringEnum, ::std::string::String>
   28     30   
    {
   29     31   
        fn from(v: MapWithEnumKeyConstrained) -> Self {
   30     32   
            v.0
   31     33   
        }
   32     34   
    }
          35  +
          36  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   33     37   
}
   34     38   
   35     39   
/*
   36     40   
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
   37     41   
 * SPDX-License-Identifier: Apache-2.0
   38     42   
 */
   39     43   
   40     44   
pub(crate) trait Constrained {
   41     45   
    type Unconstrained;
   42     46   
}

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

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