Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/protocol_serde/shape_result.rs

@@ -1,1 +65,95 @@
    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_result<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::Result>,
    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::result::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     32   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
   25     34   
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
   26     36   
                            "value" => {
          37  +
                                /* JsonParserGenerator.kt:272 */
   27     38   
                                builder = builder.set_value(
   28         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   29         -
                                        tokens.next(),
   30         -
                                    )?
   31         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   32         -
                                    .transpose()?,
   33         -
                                );
          39  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                        /* JsonParserGenerator.kt:339 */)
          43  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                                /* JsonParserGenerator.kt:272 */);
          45  +
                                /* JsonParserGenerator.kt:262 */
   34     46   
                            }
   35         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          47  +
                            /* JsonParserGenerator.kt:290 */
          48  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   36     49   
                        }
          50  +
                        /* JsonParserGenerator.kt:686 */
   37     51   
                    }
          52  +
                    /* JsonParserGenerator.kt:695 */
   38     53   
                    other => {
   39     54   
                        return Err(
   40     55   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41     56   
                                format!("expected object key or end object, found: {:?}", other),
   42     57   
                            ),
   43     58   
                        )
          59  +
                    } /* JsonParserGenerator.kt:685 */
   44     60   
                }
          61  +
                /* JsonParserGenerator.kt:684 */
   45     62   
            }
   46         -
            }
          63  +
            /* JsonParserGenerator.kt:540 */
   47     64   
            Ok(Some(builder.build()))
          65  +
            /* JsonParserGenerator.kt:713 */
   48     66   
        }
   49         -
        _ => Err(
          67  +
        /* JsonParserGenerator.kt:722 */
          68  +
        _ => {
          69  +
            /* JsonParserGenerator.kt:723 */
          70  +
            Err(
   50     71   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   51     72   
                    "expected start object or null",
   52     73   
                ),
   53         -
        ),
          74  +
            )
          75  +
            /* JsonParserGenerator.kt:722 */
          76  +
        } /* JsonParserGenerator.kt:712 */
   54     77   
    }
          78  +
    /* JsonParserGenerator.kt:516 */
   55     79   
}
   56     80   
          81  +
/* JsonSerializerGenerator.kt:358 */
   57     82   
pub fn ser_result(
   58     83   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   59     84   
    input: &crate::model::Result,
   60     85   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          86  +
    /* JsonSerializerGenerator.kt:382 */
   61     87   
    if let Some(var_1) = &input.value {
          88  +
        /* JsonSerializerGenerator.kt:423 */
   62     89   
        object.key("value").string(var_1.as_str());
          90  +
        /* JsonSerializerGenerator.kt:382 */
   63     91   
    }
          92  +
    /* JsonSerializerGenerator.kt:372 */
   64     93   
    Ok(())
          94  +
    /* JsonSerializerGenerator.kt:358 */
   65     95   
}

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/protocol_serde/shape_result_list.rs

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

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/protocol_serde/shape_some_union.rs

@@ -1,1 +106,162 @@
    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_some_union<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::SomeUnion>,
    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     23   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          24  +
            /* JsonParserGenerator.kt:684 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   21     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   22     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          31  +
                        /* JsonParserGenerator.kt:576 */
   24     32   
                        if let ::std::option::Option::Some(::std::result::Result::Ok(
   25     33   
                            ::aws_smithy_json::deserialize::Token::ValueNull { .. },
   26     34   
                        )) = tokens.peek()
   27     35   
                        {
   28     36   
                            let _ = tokens.next().expect("peek returned a token")?;
   29     37   
                            continue;
   30     38   
                        }
          39  +
                        /* JsonParserGenerator.kt:585 */
   31     40   
                        let key = key.to_unescaped()?;
   32     41   
                        if key == "__type" {
   33     42   
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   34     43   
                            continue;
   35     44   
                        }
   36     45   
                        if variant.is_some() {
   37     46   
                            return Err(
   38     47   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   39     48   
                                    "encountered mixed variants in union",
   40     49   
                                ),
   41     50   
                            );
   42     51   
                        }
          52  +
                        /* JsonParserGenerator.kt:598 */
   43     53   
                        variant = match key.as_ref() {
          54  +
                            /* JsonParserGenerator.kt:601 */
   44     55   
                            "Result" => {
          56  +
                                /* JsonParserGenerator.kt:611 */
   45     57   
                                Some(crate::model::SomeUnion::Result(
   46         -
                                    crate::protocol_serde::shape_result::de_result(tokens)?
   47         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'Result' cannot be null"))?
   48         -
                                ))
          58  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_result::de_result(tokens)?
          59  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'Result' cannot be null"))?
          60  +
                                /* JsonParserGenerator.kt:611 */))
          61  +
                                /* JsonParserGenerator.kt:601 */
   49     62   
                            }
          63  +
                            /* JsonParserGenerator.kt:601 */
   50     64   
                            "Option" => {
          65  +
                                /* JsonParserGenerator.kt:611 */
   51     66   
                                Some(crate::model::SomeUnion::Option(
   52         -
                                    crate::protocol_serde::shape_option::de_option(tokens)?
   53         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'Option' cannot be null"))?
   54         -
                                ))
          67  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_option::de_option(tokens)?
          68  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'Option' cannot be null"))?
          69  +
                                /* JsonParserGenerator.kt:611 */))
          70  +
                                /* JsonParserGenerator.kt:601 */
   55     71   
                            }
   56         -
                            variant => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("unexpected union variant: {}", variant)))
          72  +
                            /* JsonParserGenerator.kt:634 */
          73  +
                            variant => {
          74  +
                                return Err(
          75  +
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          76  +
                                        format!("unexpected union variant: {}", variant),
          77  +
                                    ),
          78  +
                                )
          79  +
                            } /* JsonParserGenerator.kt:598 */
   57     80   
                        };
          81  +
                        /* JsonParserGenerator.kt:686 */
   58     82   
                    }
          83  +
                    /* JsonParserGenerator.kt:695 */
   59     84   
                    other => {
   60     85   
                        return Err(
   61     86   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   62     87   
                                format!("expected object key or end object, found: {:?}", other),
   63     88   
                            ),
   64     89   
                        )
          90  +
                    } /* JsonParserGenerator.kt:685 */
   65     91   
                }
          92  +
                /* JsonParserGenerator.kt:684 */
   66     93   
            }
          94  +
            /* JsonParserGenerator.kt:568 */
   67     95   
        }
   68         -
        }
          96  +
        /* JsonParserGenerator.kt:642 */
   69     97   
        _ => {
   70     98   
            return Err(
   71     99   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   72    100   
                    "expected start object or null",
   73    101   
                ),
   74    102   
            )
         103  +
        } /* JsonParserGenerator.kt:567 */
   75    104   
    }
   76         -
    }
         105  +
    /* JsonParserGenerator.kt:649 */
   77    106   
    if variant.is_none() {
   78    107   
        return Err(
   79    108   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   80    109   
                "Union did not contain a valid variant.",
   81    110   
            ),
   82    111   
        );
   83    112   
    }
         113  +
    /* JsonParserGenerator.kt:657 */
   84    114   
    Ok(variant)
         115  +
    /* JsonParserGenerator.kt:551 */
   85    116   
}
   86    117   
         118  +
/* JsonSerializerGenerator.kt:547 */
   87    119   
pub fn ser_some_union(
   88    120   
    object_14: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   89    121   
    input: &crate::model::SomeUnion,
   90    122   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         123  +
    /* JsonSerializerGenerator.kt:556 */
   91    124   
    match input {
         125  +
        /* JsonSerializerGenerator.kt:564 */
   92    126   
        crate::model::SomeUnion::Result(inner) => {
         127  +
            /* SerializerUtil.kt:42 */
         128  +
            {
         129  +
                /* JsonSerializerGenerator.kt:495 */
   93    130   
                #[allow(unused_mut)]
         131  +
                /* JsonSerializerGenerator.kt:496 */
   94    132   
                let mut object_1 = object_14.key("Result").start_object();
         133  +
                /* JsonSerializerGenerator.kt:375 */
   95    134   
                crate::protocol_serde::shape_result::ser_result(&mut object_1, inner)?;
         135  +
                /* JsonSerializerGenerator.kt:515 */
   96    136   
                object_1.finish();
         137  +
                /* SerializerUtil.kt:42 */
         138  +
            }
         139  +
            /* JsonSerializerGenerator.kt:564 */
   97    140   
        }
         141  +
        /* JsonSerializerGenerator.kt:564 */
   98    142   
        crate::model::SomeUnion::Option(inner) => {
         143  +
            /* SerializerUtil.kt:42 */
         144  +
            {
         145  +
                /* JsonSerializerGenerator.kt:495 */
   99    146   
                #[allow(unused_mut)]
         147  +
                /* JsonSerializerGenerator.kt:496 */
  100    148   
                let mut object_2 = object_14.key("Option").start_object();
         149  +
                /* JsonSerializerGenerator.kt:375 */
  101    150   
                crate::protocol_serde::shape_option::ser_option(&mut object_2, inner)?;
         151  +
                /* JsonSerializerGenerator.kt:515 */
  102    152   
                object_2.finish();
         153  +
                /* SerializerUtil.kt:42 */
         154  +
            }
         155  +
            /* JsonSerializerGenerator.kt:564 */
  103    156   
        }
         157  +
        /* JsonSerializerGenerator.kt:556 */
  104    158   
    }
         159  +
    /* JsonSerializerGenerator.kt:576 */
  105    160   
    Ok(())
         161  +
    /* JsonSerializerGenerator.kt:547 */
  106    162   
}

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/protocol_serde/shape_something_else.rs

@@ -1,1 +121,211 @@
    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_something_else<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::SomethingElse>,
    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::something_else::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   
                            "result" => {
          37  +
                                /* JsonParserGenerator.kt:272 */
   29     38   
                                builder = builder.set_result(
   30         -
                                crate::protocol_serde::shape_result::de_result(tokens)?,
   31         -
                            );
          39  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_result::de_result(tokens)?
          40  +
                                /* JsonParserGenerator.kt:272 */);
          41  +
                                /* JsonParserGenerator.kt:262 */
   32     42   
                            }
          43  +
                            /* JsonParserGenerator.kt:262 */
   33     44   
                            "resultList" => {
          45  +
                                /* JsonParserGenerator.kt:272 */
   34     46   
                                builder = builder.set_result_list(
   35         -
                                crate::protocol_serde::shape_result_list::de_result_list(tokens)?,
          47  +
                                    /* JsonParserGenerator.kt:451 */
          48  +
                                    crate::protocol_serde::shape_result_list::de_result_list(
          49  +
                                        tokens,
          50  +
                                    )?, /* JsonParserGenerator.kt:272 */
   36     51   
                                );
          52  +
                                /* JsonParserGenerator.kt:262 */
   37     53   
                            }
          54  +
                            /* JsonParserGenerator.kt:262 */
   38     55   
                            "option" => {
          56  +
                                /* JsonParserGenerator.kt:272 */
   39     57   
                                builder = builder.set_option(
   40         -
                                crate::protocol_serde::shape_option::de_option(tokens)?,
   41         -
                            );
          58  +
                                    /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_option::de_option(tokens)?
          59  +
                                /* JsonParserGenerator.kt:272 */);
          60  +
                                /* JsonParserGenerator.kt:262 */
   42     61   
                            }
          62  +
                            /* JsonParserGenerator.kt:262 */
   43     63   
                            "optionList" => {
          64  +
                                /* JsonParserGenerator.kt:272 */
   44     65   
                                builder = builder.set_option_list(
   45         -
                                crate::protocol_serde::shape_option_list::de_option_list(tokens)?,
          66  +
                                    /* JsonParserGenerator.kt:451 */
          67  +
                                    crate::protocol_serde::shape_option_list::de_option_list(
          68  +
                                        tokens,
          69  +
                                    )?, /* JsonParserGenerator.kt:272 */
   46     70   
                                );
          71  +
                                /* JsonParserGenerator.kt:262 */
   47     72   
                            }
          73  +
                            /* JsonParserGenerator.kt:262 */
   48     74   
                            "someUnion" => {
   49         -
                            builder = builder.set_some_union(
   50         -
                                crate::protocol_serde::shape_some_union::de_some_union(tokens)?,
          75  +
                                /* JsonParserGenerator.kt:272 */
          76  +
                                builder =
          77  +
                                    builder.set_some_union(
          78  +
                                        /* JsonParserGenerator.kt:660 */
          79  +
                                        crate::protocol_serde::shape_some_union::de_some_union(
          80  +
                                            tokens,
          81  +
                                        )?, /* JsonParserGenerator.kt:272 */
   51     82   
                                    );
          83  +
                                /* JsonParserGenerator.kt:262 */
          84  +
                            }
          85  +
                            /* JsonParserGenerator.kt:290 */
          86  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   52     87   
                        }
   53         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   54         -
                    },
          88  +
                        /* JsonParserGenerator.kt:686 */
          89  +
                    }
          90  +
                    /* JsonParserGenerator.kt:695 */
   55     91   
                    other => {
   56     92   
                        return Err(
   57     93   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   58     94   
                                format!("expected object key or end object, found: {:?}", other),
   59     95   
                            ),
   60     96   
                        )
          97  +
                    } /* JsonParserGenerator.kt:685 */
   61     98   
                }
          99  +
                /* JsonParserGenerator.kt:684 */
   62    100   
            }
   63         -
            }
         101  +
            /* JsonParserGenerator.kt:540 */
   64    102   
            Ok(Some(builder.build()))
         103  +
            /* JsonParserGenerator.kt:713 */
   65    104   
        }
   66         -
        _ => Err(
         105  +
        /* JsonParserGenerator.kt:722 */
         106  +
        _ => {
         107  +
            /* JsonParserGenerator.kt:723 */
         108  +
            Err(
   67    109   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   68    110   
                    "expected start object or null",
   69    111   
                ),
   70         -
        ),
         112  +
            )
         113  +
            /* JsonParserGenerator.kt:722 */
         114  +
        } /* JsonParserGenerator.kt:712 */
   71    115   
    }
         116  +
    /* JsonParserGenerator.kt:516 */
   72    117   
}
   73    118   
         119  +
/* JsonSerializerGenerator.kt:358 */
   74    120   
pub fn ser_something_else(
   75    121   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   76    122   
    input: &crate::model::SomethingElse,
   77    123   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
         124  +
    /* JsonSerializerGenerator.kt:382 */
   78    125   
    if let Some(var_1) = &input.result {
         126  +
        /* JsonSerializerGenerator.kt:495 */
   79    127   
        #[allow(unused_mut)]
         128  +
        /* JsonSerializerGenerator.kt:496 */
   80    129   
        let mut object_2 = object.key("result").start_object();
         130  +
        /* JsonSerializerGenerator.kt:375 */
   81    131   
        crate::protocol_serde::shape_result::ser_result(&mut object_2, var_1)?;
         132  +
        /* JsonSerializerGenerator.kt:515 */
   82    133   
        object_2.finish();
         134  +
        /* JsonSerializerGenerator.kt:382 */
   83    135   
    }
         136  +
    /* JsonSerializerGenerator.kt:382 */
   84    137   
    if let Some(var_3) = &input.result_list {
         138  +
        /* JsonSerializerGenerator.kt:484 */
   85    139   
        let mut array_4 = object.key("resultList").start_array();
         140  +
        /* JsonSerializerGenerator.kt:524 */
   86    141   
        for item_5 in var_3 {
         142  +
            /* SerializerUtil.kt:42 */
   87    143   
            {
         144  +
                /* JsonSerializerGenerator.kt:495 */
   88    145   
                #[allow(unused_mut)]
         146  +
                /* JsonSerializerGenerator.kt:496 */
   89    147   
                let mut object_6 = array_4.value().start_object();
         148  +
                /* JsonSerializerGenerator.kt:375 */
   90    149   
                crate::protocol_serde::shape_result::ser_result(&mut object_6, item_5)?;
         150  +
                /* JsonSerializerGenerator.kt:515 */
   91    151   
                object_6.finish();
         152  +
                /* SerializerUtil.kt:42 */
   92    153   
            }
         154  +
            /* JsonSerializerGenerator.kt:524 */
   93    155   
        }
         156  +
        /* JsonSerializerGenerator.kt:486 */
   94    157   
        array_4.finish();
         158  +
        /* JsonSerializerGenerator.kt:382 */
   95    159   
    }
         160  +
    /* JsonSerializerGenerator.kt:382 */
   96    161   
    if let Some(var_7) = &input.option {
         162  +
        /* JsonSerializerGenerator.kt:495 */
   97    163   
        #[allow(unused_mut)]
         164  +
        /* JsonSerializerGenerator.kt:496 */
   98    165   
        let mut object_8 = object.key("option").start_object();
         166  +
        /* JsonSerializerGenerator.kt:375 */
   99    167   
        crate::protocol_serde::shape_option::ser_option(&mut object_8, var_7)?;
         168  +
        /* JsonSerializerGenerator.kt:515 */
  100    169   
        object_8.finish();
         170  +
        /* JsonSerializerGenerator.kt:382 */
  101    171   
    }
         172  +
    /* JsonSerializerGenerator.kt:382 */
  102    173   
    if let Some(var_9) = &input.option_list {
         174  +
        /* JsonSerializerGenerator.kt:484 */
  103    175   
        let mut array_10 = object.key("optionList").start_array();
         176  +
        /* JsonSerializerGenerator.kt:524 */
  104    177   
        for item_11 in var_9 {
         178  +
            /* SerializerUtil.kt:42 */
  105    179   
            {
         180  +
                /* JsonSerializerGenerator.kt:495 */
  106    181   
                #[allow(unused_mut)]
         182  +
                /* JsonSerializerGenerator.kt:496 */
  107    183   
                let mut object_12 = array_10.value().start_object();
         184  +
                /* JsonSerializerGenerator.kt:375 */
  108    185   
                crate::protocol_serde::shape_result::ser_result(&mut object_12, item_11)?;
         186  +
                /* JsonSerializerGenerator.kt:515 */
  109    187   
                object_12.finish();
         188  +
                /* SerializerUtil.kt:42 */
  110    189   
            }
         190  +
            /* JsonSerializerGenerator.kt:524 */
  111    191   
        }
         192  +
        /* JsonSerializerGenerator.kt:486 */
  112    193   
        array_10.finish();
         194  +
        /* JsonSerializerGenerator.kt:382 */
  113    195   
    }
         196  +
    /* JsonSerializerGenerator.kt:382 */
  114    197   
    if let Some(var_13) = &input.some_union {
         198  +
        /* JsonSerializerGenerator.kt:495 */
  115    199   
        #[allow(unused_mut)]
         200  +
        /* JsonSerializerGenerator.kt:496 */
  116    201   
        let mut object_14 = object.key("someUnion").start_object();
         202  +
        /* JsonSerializerGenerator.kt:579 */
  117    203   
        crate::protocol_serde::shape_some_union::ser_some_union(&mut object_14, var_13)?;
         204  +
        /* JsonSerializerGenerator.kt:515 */
  118    205   
        object_14.finish();
         206  +
        /* JsonSerializerGenerator.kt:382 */
  119    207   
    }
         208  +
    /* JsonSerializerGenerator.kt:372 */
  120    209   
    Ok(())
         210  +
    /* JsonSerializerGenerator.kt:358 */
  121    211   
}

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/protocol_serde/shape_structs.rs

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

tmp-codegen-diff/codegen-server-test/naming_test_structs/rust-server-codegen/src/protocol_serde/shape_structs_output.rs

@@ -1,1 +59,109 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_structs_output_output_output(
    3      4   
    value: &crate::output::StructsOutput,
    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_structs_output::ser_structs_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_structs_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::StructsOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.result {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("result").start_object();
          28  +
        /* JsonSerializerGenerator.kt:375 */
   19     29   
        crate::protocol_serde::shape_result::ser_result(&mut object_2, var_1)?;
          30  +
        /* JsonSerializerGenerator.kt:515 */
   20     31   
        object_2.finish();
          32  +
        /* JsonSerializerGenerator.kt:382 */
   21     33   
    }
          34  +
    /* JsonSerializerGenerator.kt:382 */
   22     35   
    if let Some(var_3) = &input.result_list {
          36  +
        /* JsonSerializerGenerator.kt:484 */
   23     37   
        let mut array_4 = object.key("resultList").start_array();
          38  +
        /* JsonSerializerGenerator.kt:524 */
   24     39   
        for item_5 in var_3 {
          40  +
            /* SerializerUtil.kt:42 */
   25     41   
            {
          42  +
                /* JsonSerializerGenerator.kt:495 */
   26     43   
                #[allow(unused_mut)]
          44  +
                /* JsonSerializerGenerator.kt:496 */
   27     45   
                let mut object_6 = array_4.value().start_object();
          46  +
                /* JsonSerializerGenerator.kt:375 */
   28     47   
                crate::protocol_serde::shape_result::ser_result(&mut object_6, item_5)?;
          48  +
                /* JsonSerializerGenerator.kt:515 */
   29     49   
                object_6.finish();
          50  +
                /* SerializerUtil.kt:42 */
   30     51   
            }
          52  +
            /* JsonSerializerGenerator.kt:524 */
   31     53   
        }
          54  +
        /* JsonSerializerGenerator.kt:486 */
   32     55   
        array_4.finish();
          56  +
        /* JsonSerializerGenerator.kt:382 */
   33     57   
    }
          58  +
    /* JsonSerializerGenerator.kt:382 */
   34     59   
    if let Some(var_7) = &input.option {
          60  +
        /* JsonSerializerGenerator.kt:495 */
   35     61   
        #[allow(unused_mut)]
          62  +
        /* JsonSerializerGenerator.kt:496 */
   36     63   
        let mut object_8 = object.key("option").start_object();
          64  +
        /* JsonSerializerGenerator.kt:375 */
   37     65   
        crate::protocol_serde::shape_option::ser_option(&mut object_8, var_7)?;
          66  +
        /* JsonSerializerGenerator.kt:515 */
   38     67   
        object_8.finish();
          68  +
        /* JsonSerializerGenerator.kt:382 */
   39     69   
    }
          70  +
    /* JsonSerializerGenerator.kt:382 */
   40     71   
    if let Some(var_9) = &input.option_list {
          72  +
        /* JsonSerializerGenerator.kt:484 */
   41     73   
        let mut array_10 = object.key("optionList").start_array();
          74  +
        /* JsonSerializerGenerator.kt:524 */
   42     75   
        for item_11 in var_9 {
          76  +
            /* SerializerUtil.kt:42 */
   43     77   
            {
          78  +
                /* JsonSerializerGenerator.kt:495 */
   44     79   
                #[allow(unused_mut)]
          80  +
                /* JsonSerializerGenerator.kt:496 */
   45     81   
                let mut object_12 = array_10.value().start_object();
          82  +
                /* JsonSerializerGenerator.kt:375 */
   46     83   
                crate::protocol_serde::shape_result::ser_result(&mut object_12, item_11)?;
          84  +
                /* JsonSerializerGenerator.kt:515 */
   47     85   
                object_12.finish();
          86  +
                /* SerializerUtil.kt:42 */
   48     87   
            }
          88  +
            /* JsonSerializerGenerator.kt:524 */
   49     89   
        }
          90  +
        /* JsonSerializerGenerator.kt:486 */
   50     91   
        array_10.finish();
          92  +
        /* JsonSerializerGenerator.kt:382 */
   51     93   
    }
          94  +
    /* JsonSerializerGenerator.kt:382 */
   52     95   
    if let Some(var_13) = &input.something_else {
          96  +
        /* JsonSerializerGenerator.kt:495 */
   53     97   
        #[allow(unused_mut)]
          98  +
        /* JsonSerializerGenerator.kt:496 */
   54     99   
        let mut object_14 = object.key("somethingElse").start_object();
         100  +
        /* JsonSerializerGenerator.kt:375 */
   55    101   
        crate::protocol_serde::shape_something_else::ser_something_else(&mut object_14, var_13)?;
         102  +
        /* JsonSerializerGenerator.kt:515 */
   56    103   
        object_14.finish();
         104  +
        /* JsonSerializerGenerator.kt:382 */
   57    105   
    }
         106  +
    /* JsonSerializerGenerator.kt:372 */
   58    107   
    Ok(())
         108  +
    /* JsonSerializerGenerator.kt:358 */
   59    109   
}

tmp-codegen-diff/codegen-server-test/naming_test_structs/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 [`NamingObstacleCourseStructs`].
    3      4   
///
    4      5   
/// Constructed via [`NamingObstacleCourseStructs::builder`].
    5      6   
pub struct NamingObstacleCourseStructsBuilder<Body, L, HttpPl, ModelPl> {
    6      7   
    structs: Option<::aws_smithy_http_server::routing::Route<Body>>,
    7      8   
    layer: L,
    8      9   
    http_plugin: HttpPl,
    9     10   
    model_plugin: ModelPl,
   10     11   
}
   11     12   
@@ -465,466 +524,526 @@
  485    486   
            "naming_obs_structs",
  486    487   
            "NamingObstacleCourseStructs",
  487    488   
        );
  488    489   
  489    490   
    const VERSION: Option<&'static str> = Some("2006-03-01");
  490    491   
  491    492   
    type Protocol = ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1;
  492    493   
  493    494   
    type Operations = Operation;
  494    495   
}
         496  +
/* ServiceConfigGenerator.kt:178 */
  495    497   
/// Configuration for the [`NamingObstacleCourseStructs`]. This is the central place where to register and
  496    498   
/// configure [`::tower::Layer`]s, HTTP plugins, and model plugins.
  497    499   
///
  498    500   
/// ```rust,no_run
  499    501   
/// # use naming_test_structs::NamingObstacleCourseStructsConfig;
  500    502   
/// # use ::aws_smithy_http_server::plugin::IdentityPlugin;
  501    503   
/// # use ::tower::layer::util::Identity;
  502    504   
/// # let authentication_plugin = IdentityPlugin;
  503    505   
/// # let authorization_plugin = IdentityPlugin;
  504    506   
/// # let server_request_id_provider_layer = Identity::new();
@@ -587,589 +646,649 @@
  607    609   
  608    610   
    /// Build the configuration.
  609    611   
    pub fn build(self) -> super::NamingObstacleCourseStructsConfig<L, H, M> {
  610    612   
        super::NamingObstacleCourseStructsConfig {
  611    613   
            layers: self.layers,
  612    614   
            http_plugins: self.http_plugins,
  613    615   
            model_plugins: self.model_plugins,
  614    616   
        }
  615    617   
    }
  616    618   
}
         619  +
/* ScopeMacroGenerator.kt:81 */
  617    620   
/// A macro to help with scoping [plugins](crate::server::plugin) to a subset of all operations.
  618    621   
///
  619    622   
/// In contrast to [`crate::server::scope`](crate::server::scope), this macro has knowledge
  620    623   
/// of the service and any operations _not_ specified will be placed in the opposing group.
  621    624   
///
  622    625   
/// # Example
  623    626   
///
  624    627   
/// ```rust
  625    628   
/// scope! {
  626    629   
///     /// Includes [`Structs`], excluding all other operations.

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

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

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/error.rs

@@ -1,1 +620,1193 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
           3  +
/* ServerOperationErrorGenerator.kt:63 */
    3      4   
/// Error type for the `CapturePokemon` operation.
           5  +
/* ServerOperationErrorGenerator.kt:64 */
    4      6   
/// Each variant represents an error that can occur for the `CapturePokemon` operation.
           7  +
/* RustType.kt:516 */
    5      8   
#[derive(::std::fmt::Debug)]
    6         -
pub enum CapturePokemonError {
    7         -
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
           9  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum CapturePokemonError {
          10  +
    /// /* ServerOperationErrorGenerator.kt:68 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
          11  +
    /* ServerOperationErrorGenerator.kt:71 */
    8     12   
    ValidationException(crate::error::ValidationException),
          13  +
    /* ServerOperationErrorGenerator.kt:68 */
    9     14   
    #[allow(missing_docs)] // documentation missing in model
          15  +
    /* ServerOperationErrorGenerator.kt:71 */
   10     16   
    MasterBallUnsuccessful(crate::error::MasterBallUnsuccessful),
          17  +
    /* ServerOperationErrorGenerator.kt:68 */
   11     18   
    #[allow(missing_docs)] // documentation missing in model
          19  +
    /* ServerOperationErrorGenerator.kt:71 */
   12     20   
    InvalidPokeballError(crate::error::InvalidPokeballError),
          21  +
    /* ServerOperationErrorGenerator.kt:68 */
   13     22   
    #[allow(missing_docs)] // documentation missing in model
          23  +
    /* ServerOperationErrorGenerator.kt:71 */
   14     24   
    ThrottlingError(crate::error::ThrottlingError),
          25  +
    /* ServerOperationErrorGenerator.kt:68 */
   15     26   
    #[allow(missing_docs)] // documentation missing in model
          27  +
    /* ServerOperationErrorGenerator.kt:71 */
   16     28   
    UnsupportedRegionError(crate::error::UnsupportedRegionError),
          29  +
    /* ServerOperationErrorGenerator.kt:66 */
   17     30   
}
          31  +
/* ServerOperationErrorGenerator.kt:75 */
   18     32   
impl ::std::fmt::Display for CapturePokemonError {
          33  +
    /* ServerOperationErrorGenerator.kt:76 */
   19     34   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
          35  +
        /* ServerOperationErrorGenerator.kt:139 */
   20     36   
        match &self {
   21         -
            CapturePokemonError::ValidationException(_inner) => _inner.fmt(f),
   22         -
            CapturePokemonError::MasterBallUnsuccessful(_inner) => _inner.fmt(f),
   23         -
            CapturePokemonError::InvalidPokeballError(_inner) => _inner.fmt(f),
   24         -
            CapturePokemonError::ThrottlingError(_inner) => _inner.fmt(f),
   25         -
            CapturePokemonError::UnsupportedRegionError(_inner) => _inner.fmt(f),
          37  +
            /* ServerOperationErrorGenerator.kt:142 */
          38  +
            CapturePokemonError::ValidationException(_inner) =>
          39  +
            /* ServerOperationErrorGenerator.kt:78 */
          40  +
            {
          41  +
                _inner.fmt(f)
          42  +
            }
          43  +
            ,
          44  +
            /* ServerOperationErrorGenerator.kt:142 */
          45  +
            CapturePokemonError::MasterBallUnsuccessful(_inner) =>
          46  +
            /* ServerOperationErrorGenerator.kt:78 */
          47  +
            {
          48  +
                _inner.fmt(f)
          49  +
            }
          50  +
            ,
          51  +
            /* ServerOperationErrorGenerator.kt:142 */
          52  +
            CapturePokemonError::InvalidPokeballError(_inner) =>
          53  +
            /* ServerOperationErrorGenerator.kt:78 */
          54  +
            {
          55  +
                _inner.fmt(f)
          56  +
            }
          57  +
            ,
          58  +
            /* ServerOperationErrorGenerator.kt:142 */
          59  +
            CapturePokemonError::ThrottlingError(_inner) =>
          60  +
            /* ServerOperationErrorGenerator.kt:78 */
          61  +
            {
          62  +
                _inner.fmt(f)
          63  +
            }
          64  +
            ,
          65  +
            /* ServerOperationErrorGenerator.kt:142 */
          66  +
            CapturePokemonError::UnsupportedRegionError(_inner) =>
          67  +
            /* ServerOperationErrorGenerator.kt:78 */
          68  +
            {
          69  +
                _inner.fmt(f)
          70  +
            }
          71  +
            /* ServerOperationErrorGenerator.kt:139 */
   26     72   
        }
          73  +
        /* ServerOperationErrorGenerator.kt:76 */
   27     74   
    }
          75  +
    /* ServerOperationErrorGenerator.kt:75 */
   28     76   
}
          77  +
/* ServerOperationErrorGenerator.kt:83 */
   29     78   
impl CapturePokemonError {
          79  +
    /* ServerOperationErrorGenerator.kt:87 */
   30     80   
    /// Returns `true` if the error kind is `CapturePokemonError::ValidationException`.
          81  +
    /* ServerOperationErrorGenerator.kt:88 */
   31     82   
    pub fn is_validation_exception(&self) -> bool {
          83  +
        /* ServerOperationErrorGenerator.kt:89 */
   32     84   
        matches!(&self, CapturePokemonError::ValidationException(_))
          85  +
        /* ServerOperationErrorGenerator.kt:88 */
   33     86   
    }
          87  +
    /* ServerOperationErrorGenerator.kt:87 */
   34     88   
    /// Returns `true` if the error kind is `CapturePokemonError::MasterBallUnsuccessful`.
          89  +
    /* ServerOperationErrorGenerator.kt:88 */
   35     90   
    pub fn is_master_ball_unsuccessful(&self) -> bool {
          91  +
        /* ServerOperationErrorGenerator.kt:89 */
   36     92   
        matches!(&self, CapturePokemonError::MasterBallUnsuccessful(_))
          93  +
        /* ServerOperationErrorGenerator.kt:88 */
   37     94   
    }
          95  +
    /* ServerOperationErrorGenerator.kt:87 */
   38     96   
    /// Returns `true` if the error kind is `CapturePokemonError::InvalidPokeballError`.
          97  +
    /* ServerOperationErrorGenerator.kt:88 */
   39     98   
    pub fn is_invalid_pokeball_error(&self) -> bool {
          99  +
        /* ServerOperationErrorGenerator.kt:89 */
   40    100   
        matches!(&self, CapturePokemonError::InvalidPokeballError(_))
         101  +
        /* ServerOperationErrorGenerator.kt:88 */
   41    102   
    }
         103  +
    /* ServerOperationErrorGenerator.kt:87 */
   42    104   
    /// Returns `true` if the error kind is `CapturePokemonError::ThrottlingError`.
         105  +
    /* ServerOperationErrorGenerator.kt:88 */
   43    106   
    pub fn is_throttling_error(&self) -> bool {
         107  +
        /* ServerOperationErrorGenerator.kt:89 */
   44    108   
        matches!(&self, CapturePokemonError::ThrottlingError(_))
         109  +
        /* ServerOperationErrorGenerator.kt:88 */
   45    110   
    }
         111  +
    /* ServerOperationErrorGenerator.kt:87 */
   46    112   
    /// Returns `true` if the error kind is `CapturePokemonError::UnsupportedRegionError`.
         113  +
    /* ServerOperationErrorGenerator.kt:88 */
   47    114   
    pub fn is_unsupported_region_error(&self) -> bool {
         115  +
        /* ServerOperationErrorGenerator.kt:89 */
   48    116   
        matches!(&self, CapturePokemonError::UnsupportedRegionError(_))
         117  +
        /* ServerOperationErrorGenerator.kt:88 */
   49    118   
    }
         119  +
    /* ServerOperationErrorGenerator.kt:92 */
   50    120   
    /// Returns the error name string by matching the correct variant.
         121  +
    /* ServerOperationErrorGenerator.kt:93 */
   51    122   
    pub fn name(&self) -> &'static str {
         123  +
        /* ServerOperationErrorGenerator.kt:139 */
   52    124   
        match &self {
   53         -
            CapturePokemonError::ValidationException(_inner) => _inner.name(),
   54         -
            CapturePokemonError::MasterBallUnsuccessful(_inner) => _inner.name(),
   55         -
            CapturePokemonError::InvalidPokeballError(_inner) => _inner.name(),
   56         -
            CapturePokemonError::ThrottlingError(_inner) => _inner.name(),
   57         -
            CapturePokemonError::UnsupportedRegionError(_inner) => _inner.name(),
         125  +
            /* ServerOperationErrorGenerator.kt:142 */
         126  +
            CapturePokemonError::ValidationException(_inner) =>
         127  +
            /* ServerOperationErrorGenerator.kt:95 */
         128  +
            {
         129  +
                _inner.name()
         130  +
            }
         131  +
            ,
         132  +
            /* ServerOperationErrorGenerator.kt:142 */
         133  +
            CapturePokemonError::MasterBallUnsuccessful(_inner) =>
         134  +
            /* ServerOperationErrorGenerator.kt:95 */
         135  +
            {
         136  +
                _inner.name()
         137  +
            }
         138  +
            ,
         139  +
            /* ServerOperationErrorGenerator.kt:142 */
         140  +
            CapturePokemonError::InvalidPokeballError(_inner) =>
         141  +
            /* ServerOperationErrorGenerator.kt:95 */
         142  +
            {
         143  +
                _inner.name()
   58    144   
            }
         145  +
            ,
         146  +
            /* ServerOperationErrorGenerator.kt:142 */
         147  +
            CapturePokemonError::ThrottlingError(_inner) =>
         148  +
            /* ServerOperationErrorGenerator.kt:95 */
         149  +
            {
         150  +
                _inner.name()
   59    151   
            }
         152  +
            ,
         153  +
            /* ServerOperationErrorGenerator.kt:142 */
         154  +
            CapturePokemonError::UnsupportedRegionError(_inner) =>
         155  +
            /* ServerOperationErrorGenerator.kt:95 */
         156  +
            {
         157  +
                _inner.name()
         158  +
            }
         159  +
            /* ServerOperationErrorGenerator.kt:139 */
         160  +
        }
         161  +
        /* ServerOperationErrorGenerator.kt:93 */
         162  +
    }
         163  +
    /* ServerOperationErrorGenerator.kt:83 */
   60    164   
}
         165  +
/* ServerOperationErrorGenerator.kt:100 */
   61    166   
impl ::std::error::Error for CapturePokemonError {
         167  +
    /* ServerOperationErrorGenerator.kt:101 */
   62    168   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         169  +
        /* ServerOperationErrorGenerator.kt:139 */
   63    170   
        match &self {
   64         -
            CapturePokemonError::ValidationException(_inner) => Some(_inner),
   65         -
            CapturePokemonError::MasterBallUnsuccessful(_inner) => Some(_inner),
   66         -
            CapturePokemonError::InvalidPokeballError(_inner) => Some(_inner),
   67         -
            CapturePokemonError::ThrottlingError(_inner) => Some(_inner),
   68         -
            CapturePokemonError::UnsupportedRegionError(_inner) => Some(_inner),
         171  +
            /* ServerOperationErrorGenerator.kt:142 */
         172  +
            CapturePokemonError::ValidationException(_inner) =>
         173  +
            /* ServerOperationErrorGenerator.kt:103 */
         174  +
            {
         175  +
                Some(_inner)
         176  +
            }
         177  +
            ,
         178  +
            /* ServerOperationErrorGenerator.kt:142 */
         179  +
            CapturePokemonError::MasterBallUnsuccessful(_inner) =>
         180  +
            /* ServerOperationErrorGenerator.kt:103 */
         181  +
            {
         182  +
                Some(_inner)
   69    183   
            }
         184  +
            ,
         185  +
            /* ServerOperationErrorGenerator.kt:142 */
         186  +
            CapturePokemonError::InvalidPokeballError(_inner) =>
         187  +
            /* ServerOperationErrorGenerator.kt:103 */
         188  +
            {
         189  +
                Some(_inner)
   70    190   
            }
         191  +
            ,
         192  +
            /* ServerOperationErrorGenerator.kt:142 */
         193  +
            CapturePokemonError::ThrottlingError(_inner) =>
         194  +
            /* ServerOperationErrorGenerator.kt:103 */
         195  +
            {
         196  +
                Some(_inner)
         197  +
            }
         198  +
            ,
         199  +
            /* ServerOperationErrorGenerator.kt:142 */
         200  +
            CapturePokemonError::UnsupportedRegionError(_inner) =>
         201  +
            /* ServerOperationErrorGenerator.kt:103 */
         202  +
            {
         203  +
                Some(_inner)
         204  +
            }
         205  +
            /* ServerOperationErrorGenerator.kt:139 */
         206  +
        }
         207  +
        /* ServerOperationErrorGenerator.kt:101 */
         208  +
    }
         209  +
    /* ServerOperationErrorGenerator.kt:100 */
   71    210   
}
         211  +
/* ServerOperationErrorGenerator.kt:110 */
   72    212   
impl ::std::convert::From<crate::error::ValidationException> for crate::error::CapturePokemonError {
         213  +
    /* ServerOperationErrorGenerator.kt:111 */
   73    214   
    fn from(variant: crate::error::ValidationException) -> crate::error::CapturePokemonError {
         215  +
        /* ServerOperationErrorGenerator.kt:112 */
   74    216   
        Self::ValidationException(variant)
         217  +
        /* ServerOperationErrorGenerator.kt:111 */
   75    218   
    }
         219  +
    /* ServerOperationErrorGenerator.kt:110 */
   76    220   
}
         221  +
/* ServerOperationErrorGenerator.kt:110 */
   77    222   
impl ::std::convert::From<crate::error::MasterBallUnsuccessful>
   78    223   
    for crate::error::CapturePokemonError
   79    224   
{
         225  +
    /* ServerOperationErrorGenerator.kt:111 */
   80    226   
    fn from(variant: crate::error::MasterBallUnsuccessful) -> crate::error::CapturePokemonError {
         227  +
        /* ServerOperationErrorGenerator.kt:112 */
   81    228   
        Self::MasterBallUnsuccessful(variant)
         229  +
        /* ServerOperationErrorGenerator.kt:111 */
   82    230   
    }
         231  +
    /* ServerOperationErrorGenerator.kt:110 */
   83    232   
}
         233  +
/* ServerOperationErrorGenerator.kt:110 */
   84    234   
impl ::std::convert::From<crate::error::InvalidPokeballError>
   85    235   
    for crate::error::CapturePokemonError
   86    236   
{
         237  +
    /* ServerOperationErrorGenerator.kt:111 */
   87    238   
    fn from(variant: crate::error::InvalidPokeballError) -> crate::error::CapturePokemonError {
         239  +
        /* ServerOperationErrorGenerator.kt:112 */
   88    240   
        Self::InvalidPokeballError(variant)
         241  +
        /* ServerOperationErrorGenerator.kt:111 */
   89    242   
    }
         243  +
    /* ServerOperationErrorGenerator.kt:110 */
   90    244   
}
         245  +
/* ServerOperationErrorGenerator.kt:110 */
   91    246   
impl ::std::convert::From<crate::error::ThrottlingError> for crate::error::CapturePokemonError {
         247  +
    /* ServerOperationErrorGenerator.kt:111 */
   92    248   
    fn from(variant: crate::error::ThrottlingError) -> crate::error::CapturePokemonError {
         249  +
        /* ServerOperationErrorGenerator.kt:112 */
   93    250   
        Self::ThrottlingError(variant)
         251  +
        /* ServerOperationErrorGenerator.kt:111 */
   94    252   
    }
         253  +
    /* ServerOperationErrorGenerator.kt:110 */
   95    254   
}
         255  +
/* ServerOperationErrorGenerator.kt:110 */
   96    256   
impl ::std::convert::From<crate::error::UnsupportedRegionError>
   97    257   
    for crate::error::CapturePokemonError
   98    258   
{
         259  +
    /* ServerOperationErrorGenerator.kt:111 */
   99    260   
    fn from(variant: crate::error::UnsupportedRegionError) -> crate::error::CapturePokemonError {
         261  +
        /* ServerOperationErrorGenerator.kt:112 */
  100    262   
        Self::UnsupportedRegionError(variant)
         263  +
        /* ServerOperationErrorGenerator.kt:111 */
  101    264   
    }
         265  +
    /* ServerOperationErrorGenerator.kt:110 */
  102    266   
}
  103    267   
         268  +
/* StructureGenerator.kt:197 */
  104    269   
#[allow(missing_docs)] // documentation missing in model
         270  +
/* RustType.kt:516 */
  105    271   
#[derive(
  106    272   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  107    273   
)]
  108         -
pub struct UnsupportedRegionError {
         274  +
pub /* StructureGenerator.kt:201 */ struct UnsupportedRegionError {
         275  +
    /* StructureGenerator.kt:231 */
  109    276   
    #[allow(missing_docs)] // documentation missing in model
  110    277   
    pub region: ::std::string::String,
         278  +
    /* StructureGenerator.kt:201 */
  111    279   
}
         280  +
/* StructureGenerator.kt:135 */
  112    281   
impl UnsupportedRegionError {
         282  +
    /* StructureGenerator.kt:231 */
  113    283   
    #[allow(missing_docs)] // documentation missing in model
         284  +
                           /* StructureGenerator.kt:166 */
  114    285   
    pub fn region(&self) -> &str {
         286  +
        /* StructureGenerator.kt:171 */
  115    287   
        use std::ops::Deref;
  116    288   
        self.region.deref()
         289  +
        /* StructureGenerator.kt:166 */
  117    290   
    }
         291  +
    /* StructureGenerator.kt:135 */
  118    292   
}
         293  +
/* ErrorImplGenerator.kt:99 */
  119    294   
impl UnsupportedRegionError {
         295  +
    /* ErrorImplGenerator.kt:141 */
  120    296   
    #[doc(hidden)]
  121    297   
    /// Returns the error name.
  122    298   
    pub fn name(&self) -> &'static str {
  123    299   
        "UnsupportedRegionError"
  124    300   
    }
         301  +
    /* ErrorImplGenerator.kt:99 */
  125    302   
}
         303  +
/* ErrorImplGenerator.kt:153 */
  126    304   
impl ::std::fmt::Display for UnsupportedRegionError {
         305  +
    /* ErrorImplGenerator.kt:154 */
  127    306   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         307  +
        /* ErrorImplGenerator.kt:161 */
  128    308   
        ::std::write!(f, "UnsupportedRegionError")?;
         309  +
        /* ErrorImplGenerator.kt:171 */
  129    310   
        Ok(())
         311  +
        /* ErrorImplGenerator.kt:154 */
  130    312   
    }
         313  +
    /* ErrorImplGenerator.kt:153 */
  131    314   
}
         315  +
/* ErrorImplGenerator.kt:175 */
  132    316   
impl ::std::error::Error for UnsupportedRegionError {}
         317  +
/* ServerCodegenVisitor.kt:345 */
  133    318   
impl UnsupportedRegionError {
  134         -
    /// Creates a new builder-style object to manufacture [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
         319  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
         320  +
    /* ServerBuilderGenerator.kt:295 */
  135    321   
    pub fn builder() -> crate::error::unsupported_region_error::Builder {
         322  +
        /* ServerBuilderGenerator.kt:296 */
  136    323   
        crate::error::unsupported_region_error::Builder::default()
         324  +
        /* ServerBuilderGenerator.kt:295 */
  137    325   
    }
         326  +
    /* ServerCodegenVisitor.kt:345 */
  138    327   
}
  139    328   
         329  +
/* StructureGenerator.kt:197 */
  140    330   
#[allow(missing_docs)] // documentation missing in model
         331  +
/* RustType.kt:516 */
  141    332   
#[derive(
  142    333   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  143    334   
)]
  144         -
pub struct ThrottlingError {}
         335  +
pub /* StructureGenerator.kt:201 */ struct ThrottlingError {/* StructureGenerator.kt:201 */}
         336  +
/* ErrorImplGenerator.kt:99 */
  145    337   
impl ThrottlingError {
         338  +
    /* ErrorImplGenerator.kt:141 */
  146    339   
    #[doc(hidden)]
  147    340   
    /// Returns the error name.
  148    341   
    pub fn name(&self) -> &'static str {
  149    342   
        "ThrottlingError"
  150    343   
    }
         344  +
    /* ErrorImplGenerator.kt:99 */
  151    345   
}
         346  +
/* ErrorImplGenerator.kt:153 */
  152    347   
impl ::std::fmt::Display for ThrottlingError {
         348  +
    /* ErrorImplGenerator.kt:154 */
  153    349   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         350  +
        /* ErrorImplGenerator.kt:161 */
  154    351   
        ::std::write!(f, "ThrottlingError")?;
         352  +
        /* ErrorImplGenerator.kt:171 */
  155    353   
        Ok(())
         354  +
        /* ErrorImplGenerator.kt:154 */
  156    355   
    }
         356  +
    /* ErrorImplGenerator.kt:153 */
  157    357   
}
         358  +
/* ErrorImplGenerator.kt:175 */
  158    359   
impl ::std::error::Error for ThrottlingError {}
         360  +
/* ServerCodegenVisitor.kt:345 */
  159    361   
impl ThrottlingError {
  160         -
    /// Creates a new builder-style object to manufacture [`ThrottlingError`](crate::error::ThrottlingError).
         362  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ThrottlingError`](crate::error::ThrottlingError).
         363  +
    /* ServerBuilderGenerator.kt:295 */
  161    364   
    pub fn builder() -> crate::error::throttling_error::Builder {
         365  +
        /* ServerBuilderGenerator.kt:296 */
  162    366   
        crate::error::throttling_error::Builder::default()
         367  +
        /* ServerBuilderGenerator.kt:295 */
  163    368   
    }
         369  +
    /* ServerCodegenVisitor.kt:345 */
  164    370   
}
  165    371   
         372  +
/* StructureGenerator.kt:197 */
  166    373   
#[allow(missing_docs)] // documentation missing in model
         374  +
/* RustType.kt:516 */
  167    375   
#[derive(
  168    376   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  169    377   
)]
  170         -
pub struct InvalidPokeballError {
         378  +
pub /* StructureGenerator.kt:201 */ struct InvalidPokeballError {
         379  +
    /* StructureGenerator.kt:231 */
  171    380   
    #[allow(missing_docs)] // documentation missing in model
  172    381   
    pub pokeball: ::std::string::String,
         382  +
    /* StructureGenerator.kt:201 */
  173    383   
}
         384  +
/* StructureGenerator.kt:135 */
  174    385   
impl InvalidPokeballError {
         386  +
    /* StructureGenerator.kt:231 */
  175    387   
    #[allow(missing_docs)] // documentation missing in model
         388  +
                           /* StructureGenerator.kt:166 */
  176    389   
    pub fn pokeball(&self) -> &str {
         390  +
        /* StructureGenerator.kt:171 */
  177    391   
        use std::ops::Deref;
  178    392   
        self.pokeball.deref()
         393  +
        /* StructureGenerator.kt:166 */
  179    394   
    }
         395  +
    /* StructureGenerator.kt:135 */
  180    396   
}
         397  +
/* ErrorImplGenerator.kt:99 */
  181    398   
impl InvalidPokeballError {
         399  +
    /* ErrorImplGenerator.kt:141 */
  182    400   
    #[doc(hidden)]
  183    401   
    /// Returns the error name.
  184    402   
    pub fn name(&self) -> &'static str {
  185    403   
        "InvalidPokeballError"
  186    404   
    }
         405  +
    /* ErrorImplGenerator.kt:99 */
  187    406   
}
         407  +
/* ErrorImplGenerator.kt:153 */
  188    408   
impl ::std::fmt::Display for InvalidPokeballError {
         409  +
    /* ErrorImplGenerator.kt:154 */
  189    410   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         411  +
        /* ErrorImplGenerator.kt:161 */
  190    412   
        ::std::write!(f, "InvalidPokeballError")?;
         413  +
        /* ErrorImplGenerator.kt:171 */
  191    414   
        Ok(())
         415  +
        /* ErrorImplGenerator.kt:154 */
  192    416   
    }
         417  +
    /* ErrorImplGenerator.kt:153 */
  193    418   
}
         419  +
/* ErrorImplGenerator.kt:175 */
  194    420   
impl ::std::error::Error for InvalidPokeballError {}
         421  +
/* ServerCodegenVisitor.kt:345 */
  195    422   
impl InvalidPokeballError {
  196         -
    /// Creates a new builder-style object to manufacture [`InvalidPokeballError`](crate::error::InvalidPokeballError).
         423  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`InvalidPokeballError`](crate::error::InvalidPokeballError).
         424  +
    /* ServerBuilderGenerator.kt:295 */
  197    425   
    pub fn builder() -> crate::error::invalid_pokeball_error::Builder {
         426  +
        /* ServerBuilderGenerator.kt:296 */
  198    427   
        crate::error::invalid_pokeball_error::Builder::default()
         428  +
        /* ServerBuilderGenerator.kt:295 */
  199    429   
    }
         430  +
    /* ServerCodegenVisitor.kt:345 */
  200    431   
}
  201    432   
         433  +
/* StructureGenerator.kt:197 */
  202    434   
#[allow(missing_docs)] // documentation missing in model
         435  +
/* RustType.kt:516 */
  203    436   
#[derive(
  204    437   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  205    438   
)]
  206         -
pub struct MasterBallUnsuccessful {
         439  +
pub /* StructureGenerator.kt:201 */ struct MasterBallUnsuccessful {
         440  +
    /* StructureGenerator.kt:231 */
  207    441   
    #[allow(missing_docs)] // documentation missing in model
  208    442   
    pub message: ::std::option::Option<::std::string::String>,
         443  +
    /* StructureGenerator.kt:201 */
  209    444   
}
         445  +
/* ErrorImplGenerator.kt:99 */
  210    446   
impl MasterBallUnsuccessful {
         447  +
    /* ErrorImplGenerator.kt:128 */
  211    448   
    /// Returns the error message.
  212    449   
    pub fn message(&self) -> ::std::option::Option<&str> {
  213    450   
        self.message.as_deref()
  214    451   
    }
         452  +
    /* ErrorImplGenerator.kt:141 */
  215    453   
    #[doc(hidden)]
  216    454   
    /// Returns the error name.
  217    455   
    pub fn name(&self) -> &'static str {
  218    456   
        "MasterBallUnsuccessful"
  219    457   
    }
         458  +
    /* ErrorImplGenerator.kt:99 */
  220    459   
}
         460  +
/* ErrorImplGenerator.kt:153 */
  221    461   
impl ::std::fmt::Display for MasterBallUnsuccessful {
         462  +
    /* ErrorImplGenerator.kt:154 */
  222    463   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         464  +
        /* ErrorImplGenerator.kt:161 */
  223    465   
        ::std::write!(f, "MasterBallUnsuccessful")?;
         466  +
        /* ErrorImplGenerator.kt:166 */
  224    467   
        if let ::std::option::Option::Some(inner_1) = &self.message {
         468  +
            /* ErrorImplGenerator.kt:166 */
  225    469   
            {
         470  +
                /* ErrorImplGenerator.kt:167 */
  226    471   
                ::std::write!(f, ": {}", inner_1)?;
         472  +
                /* ErrorImplGenerator.kt:166 */
  227    473   
            }
         474  +
            /* ErrorImplGenerator.kt:166 */
  228    475   
        }
         476  +
        /* ErrorImplGenerator.kt:171 */
  229    477   
        Ok(())
         478  +
        /* ErrorImplGenerator.kt:154 */
  230    479   
    }
         480  +
    /* ErrorImplGenerator.kt:153 */
  231    481   
}
         482  +
/* ErrorImplGenerator.kt:175 */
  232    483   
impl ::std::error::Error for MasterBallUnsuccessful {}
         484  +
/* ServerCodegenVisitor.kt:345 */
  233    485   
impl MasterBallUnsuccessful {
  234         -
    /// Creates a new builder-style object to manufacture [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
         486  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
         487  +
    /* ServerBuilderGenerator.kt:295 */
  235    488   
    pub fn builder() -> crate::error::master_ball_unsuccessful::Builder {
         489  +
        /* ServerBuilderGenerator.kt:296 */
  236    490   
        crate::error::master_ball_unsuccessful::Builder::default()
         491  +
        /* ServerBuilderGenerator.kt:295 */
  237    492   
    }
         493  +
    /* ServerCodegenVisitor.kt:345 */
  238    494   
}
         495  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
  239    496   
impl crate::constrained::Constrained for crate::error::MasterBallUnsuccessful {
  240    497   
    type Unconstrained = crate::error::master_ball_unsuccessful::Builder;
  241    498   
}
  242    499   
  243         -
/// 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.
         500  +
/// /* 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.
         501  +
/* RustType.kt:516 */
  244    502   
#[derive(
  245    503   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  246    504   
)]
  247         -
pub struct ValidationException {
  248         -
    /// A summary of the validation failure.
         505  +
pub /* StructureGenerator.kt:201 */ struct ValidationException {
         506  +
    /// /* StructureGenerator.kt:231 */A summary of the validation failure.
  249    507   
    pub message: ::std::string::String,
  250         -
    /// 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.
         508  +
    /// /* 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.
  251    509   
    pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
         510  +
    /* StructureGenerator.kt:201 */
  252    511   
}
         512  +
/* StructureGenerator.kt:135 */
  253    513   
impl ValidationException {
  254         -
    /// 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.
         514  +
    /// /* 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.
         515  +
    /* StructureGenerator.kt:166 */
  255    516   
    pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
         517  +
        /* StructureGenerator.kt:169 */
  256    518   
        self.field_list.as_deref()
         519  +
        /* StructureGenerator.kt:166 */
  257    520   
    }
         521  +
    /* StructureGenerator.kt:135 */
  258    522   
}
         523  +
/* ErrorImplGenerator.kt:99 */
  259    524   
impl ValidationException {
         525  +
    /* ErrorImplGenerator.kt:128 */
  260    526   
    /// Returns the error message.
  261    527   
    pub fn message(&self) -> &str {
  262    528   
        &self.message
  263    529   
    }
         530  +
    /* ErrorImplGenerator.kt:141 */
  264    531   
    #[doc(hidden)]
  265    532   
    /// Returns the error name.
  266    533   
    pub fn name(&self) -> &'static str {
  267    534   
        "ValidationException"
  268    535   
    }
         536  +
    /* ErrorImplGenerator.kt:99 */
  269    537   
}
         538  +
/* ErrorImplGenerator.kt:153 */
  270    539   
impl ::std::fmt::Display for ValidationException {
         540  +
    /* ErrorImplGenerator.kt:154 */
  271    541   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         542  +
        /* ErrorImplGenerator.kt:161 */
  272    543   
        ::std::write!(f, "ValidationException")?;
         544  +
        /* ErrorImplGenerator.kt:166 */
  273    545   
        {
         546  +
            /* ErrorImplGenerator.kt:167 */
  274    547   
            ::std::write!(f, ": {}", &self.message)?;
         548  +
            /* ErrorImplGenerator.kt:166 */
  275    549   
        }
         550  +
        /* ErrorImplGenerator.kt:171 */
  276    551   
        Ok(())
         552  +
        /* ErrorImplGenerator.kt:154 */
  277    553   
    }
         554  +
    /* ErrorImplGenerator.kt:153 */
  278    555   
}
         556  +
/* ErrorImplGenerator.kt:175 */
  279    557   
impl ::std::error::Error for ValidationException {}
         558  +
/* ServerCodegenVisitor.kt:345 */
  280    559   
impl ValidationException {
  281         -
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
         560  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
         561  +
    /* ServerBuilderGenerator.kt:295 */
  282    562   
    pub fn builder() -> crate::error::validation_exception::Builder {
         563  +
        /* ServerBuilderGenerator.kt:296 */
  283    564   
        crate::error::validation_exception::Builder::default()
         565  +
        /* ServerBuilderGenerator.kt:295 */
  284    566   
    }
         567  +
    /* ServerCodegenVisitor.kt:345 */
  285    568   
}
  286    569   
         570  +
/* ServerOperationErrorGenerator.kt:63 */
  287    571   
/// Error type for the `CapturePokemonEvents` operation.
         572  +
/* ServerOperationErrorGenerator.kt:64 */
  288    573   
/// Each variant represents an error that can occur for the `CapturePokemonEvents` operation.
         574  +
/* RustType.kt:516 */
  289    575   
#[derive(::std::fmt::Debug)]
  290         -
pub enum CapturePokemonEventsError {
         576  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum CapturePokemonEventsError {
         577  +
    /* ServerOperationErrorGenerator.kt:68 */
  291    578   
    #[allow(missing_docs)] // documentation missing in model
         579  +
    /* ServerOperationErrorGenerator.kt:71 */
  292    580   
    InvalidPokeballError(crate::error::InvalidPokeballError),
         581  +
    /* ServerOperationErrorGenerator.kt:68 */
  293    582   
    #[allow(missing_docs)] // documentation missing in model
         583  +
    /* ServerOperationErrorGenerator.kt:71 */
  294    584   
    ThrottlingError(crate::error::ThrottlingError),
         585  +
    /* ServerOperationErrorGenerator.kt:66 */
  295    586   
}
         587  +
/* ServerOperationErrorGenerator.kt:75 */
  296    588   
impl ::std::fmt::Display for CapturePokemonEventsError {
         589  +
    /* ServerOperationErrorGenerator.kt:76 */
  297    590   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         591  +
        /* ServerOperationErrorGenerator.kt:139 */
  298    592   
        match &self {
  299         -
            CapturePokemonEventsError::InvalidPokeballError(_inner) => _inner.fmt(f),
  300         -
            CapturePokemonEventsError::ThrottlingError(_inner) => _inner.fmt(f),
         593  +
            /* ServerOperationErrorGenerator.kt:142 */
         594  +
            CapturePokemonEventsError::InvalidPokeballError(_inner) =>
         595  +
            /* ServerOperationErrorGenerator.kt:78 */
         596  +
            {
         597  +
                _inner.fmt(f)
  301    598   
            }
         599  +
            ,
         600  +
            /* ServerOperationErrorGenerator.kt:142 */
         601  +
            CapturePokemonEventsError::ThrottlingError(_inner) =>
         602  +
            /* ServerOperationErrorGenerator.kt:78 */
         603  +
            {
         604  +
                _inner.fmt(f)
         605  +
            }
         606  +
            /* ServerOperationErrorGenerator.kt:139 */
  302    607   
        }
         608  +
        /* ServerOperationErrorGenerator.kt:76 */
         609  +
    }
         610  +
    /* ServerOperationErrorGenerator.kt:75 */
  303    611   
}
         612  +
/* ServerOperationErrorGenerator.kt:83 */
  304    613   
impl CapturePokemonEventsError {
         614  +
    /* ServerOperationErrorGenerator.kt:87 */
  305    615   
    /// Returns `true` if the error kind is `CapturePokemonEventsError::InvalidPokeballError`.
         616  +
    /* ServerOperationErrorGenerator.kt:88 */
  306    617   
    pub fn is_invalid_pokeball_error(&self) -> bool {
         618  +
        /* ServerOperationErrorGenerator.kt:89 */
  307    619   
        matches!(&self, CapturePokemonEventsError::InvalidPokeballError(_))
         620  +
        /* ServerOperationErrorGenerator.kt:88 */
  308    621   
    }
         622  +
    /* ServerOperationErrorGenerator.kt:87 */
  309    623   
    /// Returns `true` if the error kind is `CapturePokemonEventsError::ThrottlingError`.
         624  +
    /* ServerOperationErrorGenerator.kt:88 */
  310    625   
    pub fn is_throttling_error(&self) -> bool {
         626  +
        /* ServerOperationErrorGenerator.kt:89 */
  311    627   
        matches!(&self, CapturePokemonEventsError::ThrottlingError(_))
         628  +
        /* ServerOperationErrorGenerator.kt:88 */
  312    629   
    }
         630  +
    /* ServerOperationErrorGenerator.kt:92 */
  313    631   
    /// Returns the error name string by matching the correct variant.
         632  +
    /* ServerOperationErrorGenerator.kt:93 */
  314    633   
    pub fn name(&self) -> &'static str {
         634  +
        /* ServerOperationErrorGenerator.kt:139 */
  315    635   
        match &self {
  316         -
            CapturePokemonEventsError::InvalidPokeballError(_inner) => _inner.name(),
  317         -
            CapturePokemonEventsError::ThrottlingError(_inner) => _inner.name(),
         636  +
            /* ServerOperationErrorGenerator.kt:142 */
         637  +
            CapturePokemonEventsError::InvalidPokeballError(_inner) =>
         638  +
            /* ServerOperationErrorGenerator.kt:95 */
         639  +
            {
         640  +
                _inner.name()
  318    641   
            }
         642  +
            ,
         643  +
            /* ServerOperationErrorGenerator.kt:142 */
         644  +
            CapturePokemonEventsError::ThrottlingError(_inner) =>
         645  +
            /* ServerOperationErrorGenerator.kt:95 */
         646  +
            {
         647  +
                _inner.name()
         648  +
            }
         649  +
            /* ServerOperationErrorGenerator.kt:139 */
  319    650   
        }
         651  +
        /* ServerOperationErrorGenerator.kt:93 */
         652  +
    }
         653  +
    /* ServerOperationErrorGenerator.kt:83 */
  320    654   
}
         655  +
/* ServerOperationErrorGenerator.kt:100 */
  321    656   
impl ::std::error::Error for CapturePokemonEventsError {
         657  +
    /* ServerOperationErrorGenerator.kt:101 */
  322    658   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         659  +
        /* ServerOperationErrorGenerator.kt:139 */
  323    660   
        match &self {
  324         -
            CapturePokemonEventsError::InvalidPokeballError(_inner) => Some(_inner),
  325         -
            CapturePokemonEventsError::ThrottlingError(_inner) => Some(_inner),
         661  +
            /* ServerOperationErrorGenerator.kt:142 */
         662  +
            CapturePokemonEventsError::InvalidPokeballError(_inner) =>
         663  +
            /* ServerOperationErrorGenerator.kt:103 */
         664  +
            {
         665  +
                Some(_inner)
  326    666   
            }
         667  +
            ,
         668  +
            /* ServerOperationErrorGenerator.kt:142 */
         669  +
            CapturePokemonEventsError::ThrottlingError(_inner) =>
         670  +
            /* ServerOperationErrorGenerator.kt:103 */
         671  +
            {
         672  +
                Some(_inner)
         673  +
            }
         674  +
            /* ServerOperationErrorGenerator.kt:139 */
  327    675   
        }
         676  +
        /* ServerOperationErrorGenerator.kt:101 */
         677  +
    }
         678  +
    /* ServerOperationErrorGenerator.kt:100 */
  328    679   
}
         680  +
/* ServerOperationErrorGenerator.kt:110 */
  329    681   
impl ::std::convert::From<crate::error::InvalidPokeballError>
  330    682   
    for crate::error::CapturePokemonEventsError
  331    683   
{
         684  +
    /* ServerOperationErrorGenerator.kt:111 */
  332    685   
    fn from(
  333    686   
        variant: crate::error::InvalidPokeballError,
  334    687   
    ) -> crate::error::CapturePokemonEventsError {
         688  +
        /* ServerOperationErrorGenerator.kt:112 */
  335    689   
        Self::InvalidPokeballError(variant)
         690  +
        /* ServerOperationErrorGenerator.kt:111 */
  336    691   
    }
         692  +
    /* ServerOperationErrorGenerator.kt:110 */
  337    693   
}
         694  +
/* ServerOperationErrorGenerator.kt:110 */
  338    695   
impl ::std::convert::From<crate::error::ThrottlingError>
  339    696   
    for crate::error::CapturePokemonEventsError
  340    697   
{
         698  +
    /* ServerOperationErrorGenerator.kt:111 */
  341    699   
    fn from(variant: crate::error::ThrottlingError) -> crate::error::CapturePokemonEventsError {
         700  +
        /* ServerOperationErrorGenerator.kt:112 */
  342    701   
        Self::ThrottlingError(variant)
         702  +
        /* ServerOperationErrorGenerator.kt:111 */
  343    703   
    }
         704  +
    /* ServerOperationErrorGenerator.kt:110 */
  344    705   
}
  345    706   
         707  +
/* ServerOperationErrorGenerator.kt:63 */
  346    708   
/// Error type for the `AttemptCapturingPokemonEvent` operation.
         709  +
/* ServerOperationErrorGenerator.kt:64 */
  347    710   
/// Each variant represents an error that can occur for the `AttemptCapturingPokemonEvent` operation.
         711  +
/* RustType.kt:516 */
  348    712   
#[derive(::std::fmt::Debug)]
  349         -
pub enum AttemptCapturingPokemonEventError {
         713  +
pub /* ServerOperationErrorGenerator.kt:66 */ enum AttemptCapturingPokemonEventError {
         714  +
    /* ServerOperationErrorGenerator.kt:68 */
  350    715   
    #[allow(missing_docs)] // documentation missing in model
         716  +
    /* ServerOperationErrorGenerator.kt:71 */
  351    717   
    MasterBallUnsuccessful(crate::error::MasterBallUnsuccessful),
         718  +
    /* ServerOperationErrorGenerator.kt:66 */
  352    719   
}
         720  +
/* ServerOperationErrorGenerator.kt:75 */
  353    721   
impl ::std::fmt::Display for AttemptCapturingPokemonEventError {
         722  +
    /* ServerOperationErrorGenerator.kt:76 */
  354    723   
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         724  +
        /* ServerOperationErrorGenerator.kt:139 */
  355    725   
        match &self {
  356         -
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) => _inner.fmt(f),
         726  +
            /* ServerOperationErrorGenerator.kt:142 */
         727  +
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) =>
         728  +
            /* ServerOperationErrorGenerator.kt:78 */
         729  +
            {
         730  +
                _inner.fmt(f)
  357    731   
            }
         732  +
            /* ServerOperationErrorGenerator.kt:139 */
  358    733   
        }
         734  +
        /* ServerOperationErrorGenerator.kt:76 */
         735  +
    }
         736  +
    /* ServerOperationErrorGenerator.kt:75 */
  359    737   
}
         738  +
/* ServerOperationErrorGenerator.kt:83 */
  360    739   
impl AttemptCapturingPokemonEventError {
         740  +
    /* ServerOperationErrorGenerator.kt:87 */
  361    741   
    /// Returns `true` if the error kind is `AttemptCapturingPokemonEventError::MasterBallUnsuccessful`.
         742  +
    /* ServerOperationErrorGenerator.kt:88 */
  362    743   
    pub fn is_master_ball_unsuccessful(&self) -> bool {
         744  +
        /* ServerOperationErrorGenerator.kt:89 */
  363    745   
        matches!(
  364    746   
            &self,
  365    747   
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_)
  366    748   
        )
         749  +
        /* ServerOperationErrorGenerator.kt:88 */
  367    750   
    }
         751  +
    /* ServerOperationErrorGenerator.kt:92 */
  368    752   
    /// Returns the error name string by matching the correct variant.
         753  +
    /* ServerOperationErrorGenerator.kt:93 */
  369    754   
    pub fn name(&self) -> &'static str {
         755  +
        /* ServerOperationErrorGenerator.kt:139 */
  370    756   
        match &self {
  371         -
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) => _inner.name(),
         757  +
            /* ServerOperationErrorGenerator.kt:142 */
         758  +
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) =>
         759  +
            /* ServerOperationErrorGenerator.kt:95 */
         760  +
            {
         761  +
                _inner.name()
  372    762   
            }
         763  +
            /* ServerOperationErrorGenerator.kt:139 */
  373    764   
        }
         765  +
        /* ServerOperationErrorGenerator.kt:93 */
         766  +
    }
         767  +
    /* ServerOperationErrorGenerator.kt:83 */
  374    768   
}
         769  +
/* ServerOperationErrorGenerator.kt:100 */
  375    770   
impl ::std::error::Error for AttemptCapturingPokemonEventError {
         771  +
    /* ServerOperationErrorGenerator.kt:101 */
  376    772   
    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
         773  +
        /* ServerOperationErrorGenerator.kt:139 */
  377    774   
        match &self {
  378         -
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) => Some(_inner),
         775  +
            /* ServerOperationErrorGenerator.kt:142 */
         776  +
            AttemptCapturingPokemonEventError::MasterBallUnsuccessful(_inner) =>
         777  +
            /* ServerOperationErrorGenerator.kt:103 */
         778  +
            {
         779  +
                Some(_inner)
  379    780   
            }
         781  +
            /* ServerOperationErrorGenerator.kt:139 */
  380    782   
        }
         783  +
        /* ServerOperationErrorGenerator.kt:101 */
         784  +
    }
         785  +
    /* ServerOperationErrorGenerator.kt:100 */
  381    786   
}
         787  +
/* ServerOperationErrorGenerator.kt:110 */
  382    788   
impl ::std::convert::From<crate::error::MasterBallUnsuccessful>
  383    789   
    for crate::error::AttemptCapturingPokemonEventError
  384    790   
{
         791  +
    /* ServerOperationErrorGenerator.kt:111 */
  385    792   
    fn from(
  386    793   
        variant: crate::error::MasterBallUnsuccessful,
  387    794   
    ) -> crate::error::AttemptCapturingPokemonEventError {
         795  +
        /* ServerOperationErrorGenerator.kt:112 */
  388    796   
        Self::MasterBallUnsuccessful(variant)
         797  +
        /* ServerOperationErrorGenerator.kt:111 */
  389    798   
    }
         799  +
    /* ServerOperationErrorGenerator.kt:110 */
  390    800   
}
  391    801   
  392         -
/// See [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
         802  +
/// /* ServerBuilderGenerator.kt:171 */See [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
  393    803   
pub mod unsupported_region_error {
  394    804   
         805  +
    /* RustType.kt:516 */
  395    806   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  396         -
    /// Holds one variant for each of the ways the builder can fail.
         807  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         808  +
    /* RustType.kt:516 */
  397    809   
    #[non_exhaustive]
         810  +
    /* ServerBuilderConstraintViolations.kt:75 */
  398    811   
    #[allow(clippy::enum_variant_names)]
  399    812   
    pub enum ConstraintViolation {
  400         -
        /// `region` was not provided but it is required when building `UnsupportedRegionError`.
         813  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`region` was not provided but it is required when building `UnsupportedRegionError`.
         814  +
        /* ServerBuilderConstraintViolations.kt:143 */
  401    815   
        MissingRegion,
         816  +
        /* ServerBuilderConstraintViolations.kt:75 */
  402    817   
    }
         818  +
    /* ServerBuilderConstraintViolations.kt:117 */
  403    819   
    impl ::std::fmt::Display for ConstraintViolation {
         820  +
        /* ServerBuilderConstraintViolations.kt:118 */
  404    821   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         822  +
            /* ServerBuilderConstraintViolations.kt:119 */
  405    823   
            match self {
  406         -
                ConstraintViolation::MissingRegion => write!(f, "`region` was not provided but it is required when building `UnsupportedRegionError`"),
  407         -
            }
         824  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingRegion => write!(f, "`region` was not provided but it is required when building `UnsupportedRegionError`"),
         825  +
            /* ServerBuilderConstraintViolations.kt:119 */}
         826  +
            /* ServerBuilderConstraintViolations.kt:118 */
  408    827   
        }
         828  +
        /* ServerBuilderConstraintViolations.kt:117 */
  409    829   
    }
         830  +
    /* ServerBuilderConstraintViolations.kt:84 */
  410    831   
    impl ::std::error::Error for ConstraintViolation {}
         832  +
    /* ServerBuilderGenerator.kt:446 */
  411    833   
    impl ::std::convert::TryFrom<Builder> for crate::error::UnsupportedRegionError {
  412    834   
        type Error = ConstraintViolation;
  413    835   
  414    836   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  415    837   
            builder.build()
  416    838   
        }
  417    839   
    }
  418         -
    /// A builder for [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
         840  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
         841  +
    /* RustType.kt:516 */
  419    842   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         843  +
    /* ServerBuilderGenerator.kt:211 */
  420    844   
    pub struct Builder {
         845  +
        /* ServerBuilderGenerator.kt:308 */
  421    846   
        pub(crate) region: ::std::option::Option<::std::string::String>,
         847  +
        /* ServerBuilderGenerator.kt:211 */
  422    848   
    }
         849  +
    /* ServerBuilderGenerator.kt:215 */
  423    850   
    impl Builder {
         851  +
        /* ServerBuilderGenerator.kt:331 */
  424    852   
        #[allow(missing_docs)] // documentation missing in model
         853  +
                               /* ServerBuilderGenerator.kt:343 */
  425    854   
        pub fn region(mut self, input: ::std::string::String) -> Self {
  426         -
            self.region = Some(input);
         855  +
            /* ServerBuilderGenerator.kt:344 */
         856  +
            self.region =
         857  +
                /* ServerBuilderGenerator.kt:345 */Some(
         858  +
                    /* ServerBuilderGenerator.kt:376 */input
         859  +
                /* ServerBuilderGenerator.kt:345 */)
         860  +
            /* ServerBuilderGenerator.kt:344 */;
  427    861   
            self
         862  +
            /* ServerBuilderGenerator.kt:343 */
  428    863   
        }
  429         -
        /// Consumes the builder and constructs a [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
  430         -
        ///
         864  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`UnsupportedRegionError`](crate::error::UnsupportedRegionError).
         865  +
        /// /* ServerBuilderGenerator.kt:260 */
  431    866   
        /// The builder fails to construct a [`UnsupportedRegionError`](crate::error::UnsupportedRegionError) if a [`ConstraintViolation`] occurs.
  432    867   
        ///
         868  +
        /* ServerBuilderGenerator.kt:271 */
  433    869   
        pub fn build(self) -> Result<crate::error::UnsupportedRegionError, ConstraintViolation> {
  434    870   
            self.build_enforcing_all_constraints()
  435    871   
        }
         872  +
        /* ServerBuilderGenerator.kt:283 */
  436    873   
        fn build_enforcing_all_constraints(
  437    874   
            self,
  438    875   
        ) -> Result<crate::error::UnsupportedRegionError, ConstraintViolation> {
  439         -
            Ok(crate::error::UnsupportedRegionError {
  440         -
                region: self.region.ok_or(ConstraintViolation::MissingRegion)?,
  441         -
            })
         876  +
            /* ServerBuilderGenerator.kt:287 */
         877  +
            Ok(
         878  +
                /* ServerBuilderGenerator.kt:542 */
         879  +
                crate::error::UnsupportedRegionError {
         880  +
                    /* ServerBuilderGenerator.kt:546 */
         881  +
                    region: self
         882  +
                        .region
         883  +
                        /* ServerBuilderGenerator.kt:569 */
         884  +
                        .ok_or(ConstraintViolation::MissingRegion)?,
         885  +
                    /* ServerBuilderGenerator.kt:542 */
         886  +
                }, /* ServerBuilderGenerator.kt:287 */
         887  +
            )
         888  +
            /* ServerBuilderGenerator.kt:283 */
  442    889   
        }
         890  +
        /* ServerBuilderGenerator.kt:215 */
  443    891   
    }
         892  +
         893  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  444    894   
}
  445         -
/// See [`ThrottlingError`](crate::error::ThrottlingError).
         895  +
/// /* ServerBuilderGenerator.kt:171 */See [`ThrottlingError`](crate::error::ThrottlingError).
  446    896   
pub mod throttling_error {
  447    897   
         898  +
    /* ServerBuilderGenerator.kt:461 */
  448    899   
    impl ::std::convert::From<Builder> for crate::error::ThrottlingError {
  449    900   
        fn from(builder: Builder) -> Self {
  450    901   
            builder.build()
  451    902   
        }
  452    903   
    }
  453         -
    /// A builder for [`ThrottlingError`](crate::error::ThrottlingError).
         904  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ThrottlingError`](crate::error::ThrottlingError).
         905  +
    /* RustType.kt:516 */
  454    906   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  455         -
    pub struct Builder {}
         907  +
    /* ServerBuilderGenerator.kt:211 */
         908  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         909  +
    /* ServerBuilderGenerator.kt:215 */
  456    910   
    impl Builder {
  457         -
        /// Consumes the builder and constructs a [`ThrottlingError`](crate::error::ThrottlingError).
         911  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ThrottlingError`](crate::error::ThrottlingError).
         912  +
        /* ServerBuilderGenerator.kt:271 */
  458    913   
        pub fn build(self) -> crate::error::ThrottlingError {
  459    914   
            self.build_enforcing_all_constraints()
  460    915   
        }
         916  +
        /* ServerBuilderGenerator.kt:283 */
  461    917   
        fn build_enforcing_all_constraints(self) -> crate::error::ThrottlingError {
  462         -
            crate::error::ThrottlingError {}
         918  +
            /* ServerBuilderGenerator.kt:542 */
         919  +
            crate::error::ThrottlingError {
         920  +
            /* ServerBuilderGenerator.kt:542 */}
         921  +
            /* ServerBuilderGenerator.kt:283 */
  463    922   
        }
         923  +
        /* ServerBuilderGenerator.kt:215 */
  464    924   
    }
         925  +
         926  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  465    927   
}
  466         -
/// See [`InvalidPokeballError`](crate::error::InvalidPokeballError).
         928  +
/// /* ServerBuilderGenerator.kt:171 */See [`InvalidPokeballError`](crate::error::InvalidPokeballError).
  467    929   
pub mod invalid_pokeball_error {
  468    930   
         931  +
    /* RustType.kt:516 */
  469    932   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  470         -
    /// Holds one variant for each of the ways the builder can fail.
         933  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         934  +
    /* RustType.kt:516 */
  471    935   
    #[non_exhaustive]
         936  +
    /* ServerBuilderConstraintViolations.kt:75 */
  472    937   
    #[allow(clippy::enum_variant_names)]
  473    938   
    pub enum ConstraintViolation {
  474         -
        /// `pokeball` was not provided but it is required when building `InvalidPokeballError`.
         939  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`pokeball` was not provided but it is required when building `InvalidPokeballError`.
         940  +
        /* ServerBuilderConstraintViolations.kt:143 */
  475    941   
        MissingPokeball,
         942  +
        /* ServerBuilderConstraintViolations.kt:75 */
  476    943   
    }
         944  +
    /* ServerBuilderConstraintViolations.kt:117 */
  477    945   
    impl ::std::fmt::Display for ConstraintViolation {
         946  +
        /* ServerBuilderConstraintViolations.kt:118 */
  478    947   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         948  +
            /* ServerBuilderConstraintViolations.kt:119 */
  479    949   
            match self {
  480         -
                ConstraintViolation::MissingPokeball => write!(f, "`pokeball` was not provided but it is required when building `InvalidPokeballError`"),
  481         -
            }
         950  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingPokeball => write!(f, "`pokeball` was not provided but it is required when building `InvalidPokeballError`"),
         951  +
            /* ServerBuilderConstraintViolations.kt:119 */}
         952  +
            /* ServerBuilderConstraintViolations.kt:118 */
  482    953   
        }
         954  +
        /* ServerBuilderConstraintViolations.kt:117 */
  483    955   
    }
         956  +
    /* ServerBuilderConstraintViolations.kt:84 */
  484    957   
    impl ::std::error::Error for ConstraintViolation {}
         958  +
    /* ServerBuilderGenerator.kt:446 */
  485    959   
    impl ::std::convert::TryFrom<Builder> for crate::error::InvalidPokeballError {
  486    960   
        type Error = ConstraintViolation;
  487    961   
  488    962   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  489    963   
            builder.build()
  490    964   
        }
  491    965   
    }
  492         -
    /// A builder for [`InvalidPokeballError`](crate::error::InvalidPokeballError).
         966  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`InvalidPokeballError`](crate::error::InvalidPokeballError).
         967  +
    /* RustType.kt:516 */
  493    968   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         969  +
    /* ServerBuilderGenerator.kt:211 */
  494    970   
    pub struct Builder {
         971  +
        /* ServerBuilderGenerator.kt:308 */
  495    972   
        pub(crate) pokeball: ::std::option::Option<::std::string::String>,
         973  +
        /* ServerBuilderGenerator.kt:211 */
  496    974   
    }
         975  +
    /* ServerBuilderGenerator.kt:215 */
  497    976   
    impl Builder {
         977  +
        /* ServerBuilderGenerator.kt:331 */
  498    978   
        #[allow(missing_docs)] // documentation missing in model
         979  +
                               /* ServerBuilderGenerator.kt:343 */
  499    980   
        pub fn pokeball(mut self, input: ::std::string::String) -> Self {
  500         -
            self.pokeball = Some(input);
         981  +
            /* ServerBuilderGenerator.kt:344 */
         982  +
            self.pokeball =
         983  +
                /* ServerBuilderGenerator.kt:345 */Some(
         984  +
                    /* ServerBuilderGenerator.kt:376 */input
         985  +
                /* ServerBuilderGenerator.kt:345 */)
         986  +
            /* ServerBuilderGenerator.kt:344 */;
  501    987   
            self
         988  +
            /* ServerBuilderGenerator.kt:343 */
  502    989   
        }
  503         -
        /// Consumes the builder and constructs a [`InvalidPokeballError`](crate::error::InvalidPokeballError).
  504         -
        ///
         990  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`InvalidPokeballError`](crate::error::InvalidPokeballError).
         991  +
        /// /* ServerBuilderGenerator.kt:260 */
  505    992   
        /// The builder fails to construct a [`InvalidPokeballError`](crate::error::InvalidPokeballError) if a [`ConstraintViolation`] occurs.
  506    993   
        ///
         994  +
        /* ServerBuilderGenerator.kt:271 */
  507    995   
        pub fn build(self) -> Result<crate::error::InvalidPokeballError, ConstraintViolation> {
  508    996   
            self.build_enforcing_all_constraints()
  509    997   
        }
         998  +
        /* ServerBuilderGenerator.kt:283 */
  510    999   
        fn build_enforcing_all_constraints(
  511   1000   
            self,
  512   1001   
        ) -> Result<crate::error::InvalidPokeballError, ConstraintViolation> {
  513         -
            Ok(crate::error::InvalidPokeballError {
  514         -
                pokeball: self.pokeball.ok_or(ConstraintViolation::MissingPokeball)?,
  515         -
            })
        1002  +
            /* ServerBuilderGenerator.kt:287 */
        1003  +
            Ok(
        1004  +
                /* ServerBuilderGenerator.kt:542 */
        1005  +
                crate::error::InvalidPokeballError {
        1006  +
                    /* ServerBuilderGenerator.kt:546 */
        1007  +
                    pokeball: self
        1008  +
                        .pokeball
        1009  +
                        /* ServerBuilderGenerator.kt:569 */
        1010  +
                        .ok_or(ConstraintViolation::MissingPokeball)?,
        1011  +
                    /* ServerBuilderGenerator.kt:542 */
        1012  +
                }, /* ServerBuilderGenerator.kt:287 */
        1013  +
            )
        1014  +
            /* ServerBuilderGenerator.kt:283 */
  516   1015   
        }
        1016  +
        /* ServerBuilderGenerator.kt:215 */
  517   1017   
    }
        1018  +
        1019  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  518   1020   
}
  519         -
/// See [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
        1021  +
/// /* ServerBuilderGenerator.kt:171 */See [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
  520   1022   
pub mod master_ball_unsuccessful {
  521   1023   
        1024  +
    /* ServerBuilderGenerator.kt:461 */
  522   1025   
    impl ::std::convert::From<Builder> for crate::error::MasterBallUnsuccessful {
  523   1026   
        fn from(builder: Builder) -> Self {
  524   1027   
            builder.build()
  525   1028   
        }
  526   1029   
    }
  527         -
    /// A builder for [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
        1030  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
        1031  +
    /* RustType.kt:516 */
  528   1032   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1033  +
    /* ServerBuilderGenerator.kt:211 */
  529   1034   
    pub struct Builder {
        1035  +
        /* ServerBuilderGenerator.kt:308 */
  530   1036   
        pub(crate) message: ::std::option::Option<::std::string::String>,
        1037  +
        /* ServerBuilderGenerator.kt:211 */
  531   1038   
    }
        1039  +
    /* ServerBuilderGenerator.kt:215 */
  532   1040   
    impl Builder {
        1041  +
        /* ServerBuilderGenerator.kt:331 */
  533   1042   
        #[allow(missing_docs)] // documentation missing in model
        1043  +
                               /* ServerBuilderGenerator.kt:343 */
  534   1044   
        pub fn message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  535         -
            self.message = input;
        1045  +
            /* ServerBuilderGenerator.kt:344 */
        1046  +
            self.message =
        1047  +
                /* ServerBuilderGenerator.kt:376 */input
        1048  +
            /* ServerBuilderGenerator.kt:344 */;
  536   1049   
            self
        1050  +
            /* ServerBuilderGenerator.kt:343 */
  537   1051   
        }
        1052  +
        /* ServerBuilderGenerator.kt:426 */
  538   1053   
        #[allow(missing_docs)] // documentation missing in model
        1054  +
                               /* ServerBuilderGenerator.kt:428 */
  539   1055   
        pub(crate) fn set_message(
  540   1056   
            mut self,
  541   1057   
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  542   1058   
        ) -> Self {
        1059  +
            /* ServerBuilderGenerator.kt:429 */
  543   1060   
            self.message = input.map(|v| v.into());
  544   1061   
            self
        1062  +
            /* ServerBuilderGenerator.kt:428 */
  545   1063   
        }
  546         -
        /// Consumes the builder and constructs a [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
        1064  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MasterBallUnsuccessful`](crate::error::MasterBallUnsuccessful).
        1065  +
        /* ServerBuilderGenerator.kt:271 */
  547   1066   
        pub fn build(self) -> crate::error::MasterBallUnsuccessful {
  548   1067   
            self.build_enforcing_all_constraints()
  549   1068   
        }
        1069  +
        /* ServerBuilderGenerator.kt:283 */
  550   1070   
        fn build_enforcing_all_constraints(self) -> crate::error::MasterBallUnsuccessful {
        1071  +
            /* ServerBuilderGenerator.kt:542 */
  551   1072   
            crate::error::MasterBallUnsuccessful {
        1073  +
                /* ServerBuilderGenerator.kt:546 */
  552   1074   
                message: self.message,
        1075  +
                /* ServerBuilderGenerator.kt:542 */
  553   1076   
            }
        1077  +
            /* ServerBuilderGenerator.kt:283 */
  554   1078   
        }
        1079  +
        /* ServerBuilderGenerator.kt:215 */
  555   1080   
    }
        1081  +
        1082  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  556   1083   
}
  557         -
/// See [`ValidationException`](crate::error::ValidationException).
        1084  +
/// /* ServerBuilderGenerator.kt:171 */See [`ValidationException`](crate::error::ValidationException).
  558   1085   
pub mod validation_exception {
  559   1086   
        1087  +
    /* RustType.kt:516 */
  560   1088   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  561         -
    /// Holds one variant for each of the ways the builder can fail.
        1089  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
        1090  +
    /* RustType.kt:516 */
  562   1091   
    #[non_exhaustive]
        1092  +
    /* ServerBuilderConstraintViolations.kt:75 */
  563   1093   
    #[allow(clippy::enum_variant_names)]
  564   1094   
    pub enum ConstraintViolation {
  565         -
        /// `message` was not provided but it is required when building `ValidationException`.
        1095  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`message` was not provided but it is required when building `ValidationException`.
        1096  +
        /* ServerBuilderConstraintViolations.kt:143 */
  566   1097   
        MissingMessage,
        1098  +
        /* ServerBuilderConstraintViolations.kt:75 */
  567   1099   
    }
        1100  +
    /* ServerBuilderConstraintViolations.kt:117 */
  568   1101   
    impl ::std::fmt::Display for ConstraintViolation {
        1102  +
        /* ServerBuilderConstraintViolations.kt:118 */
  569   1103   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        1104  +
            /* ServerBuilderConstraintViolations.kt:119 */
  570   1105   
            match self {
  571         -
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
  572         -
            }
        1106  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
        1107  +
            /* ServerBuilderConstraintViolations.kt:119 */}
        1108  +
            /* ServerBuilderConstraintViolations.kt:118 */
  573   1109   
        }
        1110  +
        /* ServerBuilderConstraintViolations.kt:117 */
  574   1111   
    }
        1112  +
    /* ServerBuilderConstraintViolations.kt:84 */
  575   1113   
    impl ::std::error::Error for ConstraintViolation {}
        1114  +
    /* ServerBuilderGenerator.kt:446 */
  576   1115   
    impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
  577   1116   
        type Error = ConstraintViolation;
  578   1117   
  579   1118   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  580   1119   
            builder.build()
  581   1120   
        }
  582   1121   
    }
  583         -
    /// A builder for [`ValidationException`](crate::error::ValidationException).
        1122  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ValidationException`](crate::error::ValidationException).
        1123  +
    /* RustType.kt:516 */
  584   1124   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
        1125  +
    /* ServerBuilderGenerator.kt:211 */
  585   1126   
    pub struct Builder {
        1127  +
        /* ServerBuilderGenerator.kt:308 */
  586   1128   
        pub(crate) message: ::std::option::Option<::std::string::String>,
        1129  +
        /* ServerBuilderGenerator.kt:308 */
  587   1130   
        pub(crate) field_list:
  588   1131   
            ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
        1132  +
        /* ServerBuilderGenerator.kt:211 */
  589   1133   
    }
        1134  +
    /* ServerBuilderGenerator.kt:215 */
  590   1135   
    impl Builder {
  591         -
        /// A summary of the validation failure.
        1136  +
        /// /* ServerBuilderGenerator.kt:331 */A summary of the validation failure.
        1137  +
        /* ServerBuilderGenerator.kt:343 */
  592   1138   
        pub fn message(mut self, input: ::std::string::String) -> Self {
  593         -
            self.message = Some(input);
        1139  +
            /* ServerBuilderGenerator.kt:344 */
        1140  +
            self.message =
        1141  +
                /* ServerBuilderGenerator.kt:345 */Some(
        1142  +
                    /* ServerBuilderGenerator.kt:376 */input
        1143  +
                /* ServerBuilderGenerator.kt:345 */)
        1144  +
            /* ServerBuilderGenerator.kt:344 */;
  594   1145   
            self
        1146  +
            /* ServerBuilderGenerator.kt:343 */
  595   1147   
        }
  596         -
        /// 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.
        1148  +
        /// /* 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.
        1149  +
        /* ServerBuilderGenerator.kt:343 */
  597   1150   
        pub fn field_list(
  598   1151   
            mut self,
  599   1152   
            input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
  600   1153   
        ) -> Self {
  601         -
            self.field_list = input;
        1154  +
            /* ServerBuilderGenerator.kt:344 */
        1155  +
            self.field_list =
        1156  +
                /* ServerBuilderGenerator.kt:376 */input
        1157  +
            /* ServerBuilderGenerator.kt:344 */;
  602   1158   
            self
        1159  +
            /* ServerBuilderGenerator.kt:343 */
  603   1160   
        }
  604         -
        /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
  605         -
        ///
        1161  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
        1162  +
        /// /* ServerBuilderGenerator.kt:260 */
  606   1163   
        /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if a [`ConstraintViolation`] occurs.
  607   1164   
        ///
        1165  +
        /* ServerBuilderGenerator.kt:271 */
  608   1166   
        pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
  609   1167   
            self.build_enforcing_all_constraints()
  610   1168   
        }
        1169  +
        /* ServerBuilderGenerator.kt:283 */
  611   1170   
        fn build_enforcing_all_constraints(
  612   1171   
            self,
  613   1172   
        ) -> Result<crate::error::ValidationException, ConstraintViolation> {
  614         -
            Ok(crate::error::ValidationException {
  615         -
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
        1173  +
            /* ServerBuilderGenerator.kt:287 */
        1174  +
            Ok(
        1175  +
                /* ServerBuilderGenerator.kt:542 */
        1176  +
                crate::error::ValidationException {
        1177  +
                    /* ServerBuilderGenerator.kt:546 */
        1178  +
                    message: self
        1179  +
                        .message
        1180  +
                        /* ServerBuilderGenerator.kt:569 */
        1181  +
                        .ok_or(ConstraintViolation::MissingMessage)?,
        1182  +
                    /* ServerBuilderGenerator.kt:546 */
  616   1183   
                    field_list: self.field_list,
  617         -
            })
        1184  +
                    /* ServerBuilderGenerator.kt:542 */
        1185  +
                }, /* ServerBuilderGenerator.kt:287 */
        1186  +
            )
        1187  +
            /* ServerBuilderGenerator.kt:283 */
  618   1188   
        }
        1189  +
        /* ServerBuilderGenerator.kt:215 */
  619   1190   
    }
        1191  +
        1192  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  620   1193   
}