Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

@@ -1,1 +202,227 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* EventStreamErrorMarshallerGenerator.kt:79 */
    2      3   
#[non_exhaustive]
    3      4   
#[derive(Debug)]
    4      5   
pub struct CapturePokemonEventsErrorMarshaller;
    5      6   
    6      7   
impl CapturePokemonEventsErrorMarshaller {
    7      8   
    pub fn new() -> Self {
    8      9   
        CapturePokemonEventsErrorMarshaller
    9     10   
    }
   10     11   
}
          12  +
/* EventStreamErrorMarshallerGenerator.kt:93 */
   11     13   
impl ::aws_smithy_eventstream::frame::MarshallMessage for CapturePokemonEventsErrorMarshaller {
          14  +
    /* EventStreamErrorMarshallerGenerator.kt:97 */
   12     15   
    type Input = crate::error::CapturePokemonEventsError;
          16  +
    /* EventStreamErrorMarshallerGenerator.kt:99 */
   13     17   
    fn marshall(
   14     18   
        &self,
   15     19   
        _input: Self::Input,
   16     20   
    ) -> std::result::Result<
   17     21   
        ::aws_smithy_types::event_stream::Message,
   18     22   
        ::aws_smithy_eventstream::error::Error,
   19     23   
    > {
          24  +
        /* EventStreamErrorMarshallerGenerator.kt:103 */
   20     25   
        let mut headers = Vec::new();
          26  +
        /* EventStreamMarshallerGenerator.kt:322 */
   21     27   
        headers.push(::aws_smithy_types::event_stream::Header::new(
   22     28   
            ":message-type",
   23     29   
            ::aws_smithy_types::event_stream::HeaderValue::String("exception".into()),
   24     30   
        ));
          31  +
        /* EventStreamErrorMarshallerGenerator.kt:108 */
   25     32   
        let payload = match _input {
   26         -
            crate::error::CapturePokemonEventsError::InvalidPokeballError(inner) => {
   27         -
                headers.push(::aws_smithy_types::event_stream::Header::new(
   28         -
                    ":exception-type",
   29         -
                    ::aws_smithy_types::event_stream::HeaderValue::String(
   30         -
                        "invalid_pokeball".into(),
   31         -
                    ),
   32         -
                ));
   33         -
                headers.push(::aws_smithy_types::event_stream::Header::new(
   34         -
                    ":content-type",
   35         -
                    ::aws_smithy_types::event_stream::HeaderValue::String(
   36         -
                        "application/json".into(),
   37         -
                    ),
   38         -
                ));
   39         -
                crate::protocol_serde::shape_invalid_pokeball_error::ser_invalid_pokeball_error_error(&inner)
          33  +
            /* EventStreamErrorMarshallerGenerator.kt:113 */crate::error::CapturePokemonEventsError::InvalidPokeballError(inner) =>  {
          34  +
                /* EventStreamMarshallerGenerator.kt:322 */headers.push(::aws_smithy_types::event_stream::Header::new(":exception-type", ::aws_smithy_types::event_stream::HeaderValue::String("invalid_pokeball".into())));
          35  +
                /* EventStreamMarshallerGenerator.kt:322 */headers.push(::aws_smithy_types::event_stream::Header::new(":content-type", ::aws_smithy_types::event_stream::HeaderValue::String("application/json".into())));
          36  +
                /* EventStreamMarshallerGenerator.kt:283 */crate::protocol_serde::shape_invalid_pokeball_error::ser_invalid_pokeball_error_error(&inner)
   40     37   
                                            .map_err(|err| ::aws_smithy_eventstream::error::Error::marshalling(format!("{}", err)))?
   41         -
            }
   42         -
            crate::error::CapturePokemonEventsError::ThrottlingError(inner) => {
   43         -
                headers.push(::aws_smithy_types::event_stream::Header::new(
   44         -
                    ":exception-type",
   45         -
                    ::aws_smithy_types::event_stream::HeaderValue::String("throttlingError".into()),
   46         -
                ));
   47         -
                headers.push(::aws_smithy_types::event_stream::Header::new(
   48         -
                    ":content-type",
   49         -
                    ::aws_smithy_types::event_stream::HeaderValue::String(
   50         -
                        "application/json".into(),
   51         -
                    ),
   52         -
                ));
   53         -
                crate::protocol_serde::shape_throttling_error::ser_throttling_error_error(&inner)
   54         -
                    .map_err(|err| {
   55         -
                        ::aws_smithy_eventstream::error::Error::marshalling(format!("{}", err))
   56         -
                    })?
   57         -
            }
   58         -
        };
          38  +
            /* EventStreamErrorMarshallerGenerator.kt:113 */}
          39  +
            /* EventStreamErrorMarshallerGenerator.kt:113 */crate::error::CapturePokemonEventsError::ThrottlingError(inner) =>  {
          40  +
                /* EventStreamMarshallerGenerator.kt:322 */headers.push(::aws_smithy_types::event_stream::Header::new(":exception-type", ::aws_smithy_types::event_stream::HeaderValue::String("throttlingError".into())));
          41  +
                /* EventStreamMarshallerGenerator.kt:322 */headers.push(::aws_smithy_types::event_stream::Header::new(":content-type", ::aws_smithy_types::event_stream::HeaderValue::String("application/json".into())));
          42  +
                /* EventStreamMarshallerGenerator.kt:283 */crate::protocol_serde::shape_throttling_error::ser_throttling_error_error(&inner)
          43  +
                                            .map_err(|err| ::aws_smithy_eventstream::error::Error::marshalling(format!("{}", err)))?
          44  +
            /* EventStreamErrorMarshallerGenerator.kt:113 */}
          45  +
        /* EventStreamErrorMarshallerGenerator.kt:108 */}
          46  +
        /* EventStreamErrorMarshallerGenerator.kt:131 */;
   59     47   
        Ok(::aws_smithy_types::event_stream::Message::new_from_parts(
   60     48   
            headers, payload,
   61     49   
        ))
          50  +
        /* EventStreamErrorMarshallerGenerator.kt:99 */
   62     51   
    }
          52  +
    /* EventStreamErrorMarshallerGenerator.kt:93 */
   63     53   
}
   64     54   
          55  +
/* EventStreamMarshallerGenerator.kt:115 */
   65     56   
#[non_exhaustive]
   66     57   
#[derive(Debug)]
   67     58   
pub struct CapturePokemonEventsMarshaller;
   68     59   
   69     60   
impl CapturePokemonEventsMarshaller {
   70     61   
    pub fn new() -> Self {
   71     62   
        CapturePokemonEventsMarshaller
   72     63   
    }
   73     64   
}
          65  +
/* EventStreamMarshallerGenerator.kt:129 */
   74     66   
impl ::aws_smithy_eventstream::frame::MarshallMessage for CapturePokemonEventsMarshaller {
          67  +
    /* EventStreamMarshallerGenerator.kt:133 */
   75     68   
    type Input = crate::model::CapturePokemonEvents;
          69  +
    /* EventStreamMarshallerGenerator.kt:135 */
   76     70   
    fn marshall(
   77     71   
        &self,
   78     72   
        input: Self::Input,
   79     73   
    ) -> std::result::Result<
   80     74   
        ::aws_smithy_types::event_stream::Message,
   81     75   
        ::aws_smithy_eventstream::error::Error,
   82     76   
    > {
          77  +
        /* EventStreamMarshallerGenerator.kt:139 */
   83     78   
        let mut headers = Vec::new();
          79  +
        /* EventStreamMarshallerGenerator.kt:322 */
   84     80   
        headers.push(::aws_smithy_types::event_stream::Header::new(
   85     81   
            ":message-type",
   86     82   
            ::aws_smithy_types::event_stream::HeaderValue::String("event".into()),
   87     83   
        ));
          84  +
        /* EventStreamMarshallerGenerator.kt:141 */
   88     85   
        let payload = match input {
   89         -
            Self::Input::Event(inner) => {
   90         -
                headers.push(::aws_smithy_types::event_stream::Header::new(
   91         -
                    ":event-type",
   92         -
                    ::aws_smithy_types::event_stream::HeaderValue::String("event".into()),
   93         -
                ));
   94         -
                if let Some(value) = inner.name {
   95         -
                    headers.push(::aws_smithy_types::event_stream::Header::new(
   96         -
                        "name",
   97         -
                        ::aws_smithy_types::event_stream::HeaderValue::String(value.into()),
   98         -
                    ));
   99         -
                }
  100         -
                if let Some(value) = inner.captured {
  101         -
                    headers.push(::aws_smithy_types::event_stream::Header::new(
  102         -
                        "captured",
  103         -
                        ::aws_smithy_types::event_stream::HeaderValue::Bool(value),
  104         -
                    ));
  105         -
                }
  106         -
                if let Some(value) = inner.shiny {
  107         -
                    headers.push(::aws_smithy_types::event_stream::Header::new(
  108         -
                        "shiny",
  109         -
                        ::aws_smithy_types::event_stream::HeaderValue::Bool(value),
  110         -
                    ));
  111         -
                }
  112         -
                headers.push(::aws_smithy_types::event_stream::Header::new(
  113         -
                    ":content-type",
  114         -
                    ::aws_smithy_types::event_stream::HeaderValue::String(
  115         -
                        "application/octet-stream".into(),
  116         -
                    ),
  117         -
                ));
  118         -
                if let Some(inner_payload) = inner.pokedex_update {
  119         -
                    inner_payload.into_inner()
  120         -
                } else {
  121         -
                    Vec::new()
  122         -
                }
  123         -
            }
  124         -
        };
          86  +
            /* EventStreamMarshallerGenerator.kt:152 */Self::Input::Event(inner) =>  {
          87  +
                /* EventStreamMarshallerGenerator.kt:322 */headers.push(::aws_smithy_types::event_stream::Header::new(":event-type", ::aws_smithy_types::event_stream::HeaderValue::String("event".into())));
          88  +
                /* EventStreamMarshallerGenerator.kt:305 */if let Some(value) = inner.name {
          89  +
                    /* EventStreamMarshallerGenerator.kt:225 */headers.push(
          90  +
                        /* EventStreamMarshallerGenerator.kt:226 */::aws_smithy_types::event_stream::Header::new("name", ::aws_smithy_types::event_stream::HeaderValue::String(value.into()))
          91  +
                    /* EventStreamMarshallerGenerator.kt:225 */);
          92  +
                /* EventStreamMarshallerGenerator.kt:305 */}
          93  +
                /* EventStreamMarshallerGenerator.kt:305 */if let Some(value) = inner.captured {
          94  +
                    /* EventStreamMarshallerGenerator.kt:225 */headers.push(
          95  +
                        /* EventStreamMarshallerGenerator.kt:226 */::aws_smithy_types::event_stream::Header::new("captured", ::aws_smithy_types::event_stream::HeaderValue::Bool(value))
          96  +
                    /* EventStreamMarshallerGenerator.kt:225 */);
          97  +
                /* EventStreamMarshallerGenerator.kt:305 */}
          98  +
                /* EventStreamMarshallerGenerator.kt:305 */if let Some(value) = inner.shiny {
          99  +
                    /* EventStreamMarshallerGenerator.kt:225 */headers.push(
         100  +
                        /* EventStreamMarshallerGenerator.kt:226 */::aws_smithy_types::event_stream::Header::new("shiny", ::aws_smithy_types::event_stream::HeaderValue::Bool(value))
         101  +
                    /* EventStreamMarshallerGenerator.kt:225 */);
         102  +
                /* EventStreamMarshallerGenerator.kt:305 */}
         103  +
                /* EventStreamMarshallerGenerator.kt:322 */headers.push(::aws_smithy_types::event_stream::Header::new(":content-type", ::aws_smithy_types::event_stream::HeaderValue::String("application/octet-stream".into())));
         104  +
                /* EventStreamMarshallerGenerator.kt:305 */if let Some(inner_payload) = inner.pokedex_update {
         105  +
                    /* EventStreamMarshallerGenerator.kt:272 */inner_payload.into_inner()
         106  +
                /* EventStreamMarshallerGenerator.kt:305 */}
         107  +
                /* EventStreamMarshallerGenerator.kt:309 */ else  {
         108  +
                    /* EventStreamMarshallerGenerator.kt:273 */Vec::new()
         109  +
                /* EventStreamMarshallerGenerator.kt:309 */}
         110  +
            /* EventStreamMarshallerGenerator.kt:152 */}
         111  +
        /* EventStreamMarshallerGenerator.kt:141 */}
         112  +
        /* EventStreamMarshallerGenerator.kt:169 */;
  125    113   
        Ok(::aws_smithy_types::event_stream::Message::new_from_parts(
  126    114   
            headers, payload,
  127    115   
        ))
         116  +
        /* EventStreamMarshallerGenerator.kt:135 */
  128    117   
    }
         118  +
    /* EventStreamMarshallerGenerator.kt:129 */
  129    119   
}
  130    120   
         121  +
/* EventStreamUnmarshallerGenerator.kt:98 */
  131    122   
#[non_exhaustive]
  132    123   
#[derive(Debug)]
  133    124   
pub struct AttemptCapturingPokemonEventUnmarshaller;
  134    125   
  135    126   
impl AttemptCapturingPokemonEventUnmarshaller {
  136    127   
    pub fn new() -> Self {
  137    128   
        AttemptCapturingPokemonEventUnmarshaller
  138    129   
    }
  139    130   
}
         131  +
/* EventStreamUnmarshallerGenerator.kt:112 */
  140    132   
impl ::aws_smithy_eventstream::frame::UnmarshallMessage
  141    133   
    for AttemptCapturingPokemonEventUnmarshaller
  142    134   
{
         135  +
    /* EventStreamUnmarshallerGenerator.kt:116 */
  143    136   
    type Output = crate::model::AttemptCapturingPokemonEvent;
         137  +
    /* EventStreamUnmarshallerGenerator.kt:117 */
  144    138   
    type Error = crate::error::AttemptCapturingPokemonEventError;
         139  +
    /* EventStreamUnmarshallerGenerator.kt:119 */
  145    140   
    fn unmarshall(
  146    141   
        &self,
  147    142   
        message: &::aws_smithy_types::event_stream::Message,
  148    143   
    ) -> std::result::Result<
  149    144   
        ::aws_smithy_eventstream::frame::UnmarshalledMessage<Self::Output, Self::Error>,
  150    145   
        ::aws_smithy_eventstream::error::Error,
  151    146   
    > {
         147  +
        /* EventStreamUnmarshallerGenerator.kt:128 */
  152    148   
        let response_headers = ::aws_smithy_eventstream::smithy::parse_response_headers(message)?;
         149  +
        /* EventStreamUnmarshallerGenerator.kt:129 */
  153    150   
        match response_headers.message_type.as_str() {
  154         -
            "event" => match response_headers.smithy_type.as_str() {
         151  +
            /* EventStreamUnmarshallerGenerator.kt:130 */
         152  +
            "event" => {
         153  +
                /* EventStreamUnmarshallerGenerator.kt:155 */
         154  +
                match response_headers.smithy_type.as_str() {
         155  +
                    /* EventStreamUnmarshallerGenerator.kt:158 */
  155    156   
                    "event" => {
         157  +
                        /* EventStreamUnmarshallerGenerator.kt:221 */
  156    158   
                        let mut builder = crate::model::capturing_event::Builder::default();
         159  +
                        /* EventStreamUnmarshallerGenerator.kt:288 */
  157    160   
                        builder = builder.set_payload(
  158         -
                            Some(
  159         -
                                crate::protocol_serde::shape_capturing_payload::de_capturing_payload_payload(&message.payload()[..])
         161  +
                            /* EventStreamUnmarshallerGenerator.kt:289 */Some(
         162  +
                                /* EventStreamUnmarshallerGenerator.kt:317 */crate::protocol_serde::shape_capturing_payload::de_capturing_payload_payload(&message.payload()[..])
  160    163   
                                                .map_err(|err| {
  161    164   
                                                    ::aws_smithy_eventstream::error::Error::unmarshalling(format!("failed to unmarshall payload: {}", err))
  162    165   
                                                })?
  163         -
                            )
  164         -
                        );
         166  +
                            /* EventStreamUnmarshallerGenerator.kt:289 */)
         167  +
                        /* EventStreamUnmarshallerGenerator.kt:288 */);
         168  +
                        /* EventStreamUnmarshallerGenerator.kt:245 */
  165    169   
                        Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
  166    170   
                            crate::model::AttemptCapturingPokemonEvent::Event(builder.build()),
  167    171   
                        ))
         172  +
                        /* EventStreamUnmarshallerGenerator.kt:158 */
  168    173   
                    }
         174  +
                    /* EventStreamUnmarshallerGenerator.kt:162 */
  169    175   
                    _unknown_variant => {
         176  +
                        /* EventStreamUnmarshallerGenerator.kt:172 */
  170    177   
                        return Err(::aws_smithy_eventstream::error::Error::unmarshalling(
  171    178   
                            format!("unrecognized :event-type: {}", _unknown_variant),
  172    179   
                        ));
         180  +
                        /* EventStreamUnmarshallerGenerator.kt:162 */
         181  +
                    } /* EventStreamUnmarshallerGenerator.kt:155 */
  173    182   
                }
  174         -
            },
         183  +
                /* EventStreamUnmarshallerGenerator.kt:130 */
         184  +
            }
         185  +
            /* EventStreamUnmarshallerGenerator.kt:133 */
  175    186   
            "exception" => {
  176         -
                if response_headers.smithy_type.as_str() == "masterball_unsuccessful" {
         187  +
                /* EventStreamUnmarshallerGenerator.kt:356 */
         188  +
                if response_headers.smithy_type.as_str() ==
         189  +
                /* EventStreamUnmarshallerGenerator.kt:358 */"masterball_unsuccessful"
         190  +
                {
         191  +
                    /* EventStreamUnmarshallerGenerator.kt:405 */
  177    192   
                    let mut builder = crate::error::master_ball_unsuccessful::Builder::default();
         193  +
                    /* EventStreamUnmarshallerGenerator.kt:407 */
  178    194   
                    builder = crate::protocol_serde::shape_master_ball_unsuccessful::de_master_ball_unsuccessful_json_err(&message.payload()[..], builder)
  179    195   
                                                            .map_err(|err| {
  180    196   
                                                                ::aws_smithy_eventstream::error::Error::unmarshalling(format!("failed to unmarshall masterball_unsuccessful: {}", err))
  181    197   
                                                            })?;
         198  +
                    /* EventStreamUnmarshallerGenerator.kt:418 */
  182    199   
                    return Ok(::aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
  183    200   
                        crate::error::AttemptCapturingPokemonEventError::MasterBallUnsuccessful(
  184    201   
                            builder.build(),
  185    202   
                        ),
  186    203   
                    ));
         204  +
                    /* EventStreamUnmarshallerGenerator.kt:358 */
  187    205   
                }
         206  +
                /* EventStreamUnmarshallerGenerator.kt:444 */
  188    207   
                return Err(aws_smithy_eventstream::error::Error::unmarshalling(
  189    208   
                    format!(
  190    209   
                        "unrecognized exception: {}",
  191    210   
                        response_headers.smithy_type.as_str()
  192    211   
                    ),
  193    212   
                ));
         213  +
                /* EventStreamUnmarshallerGenerator.kt:133 */
  194    214   
            }
         215  +
            /* EventStreamUnmarshallerGenerator.kt:136 */
  195    216   
            value => {
         217  +
                /* EventStreamUnmarshallerGenerator.kt:137 */
  196    218   
                return Err(::aws_smithy_eventstream::error::Error::unmarshalling(
  197    219   
                    format!("unrecognized :message-type: {}", value),
  198    220   
                ));
         221  +
                /* EventStreamUnmarshallerGenerator.kt:136 */
         222  +
            } /* EventStreamUnmarshallerGenerator.kt:129 */
  199    223   
        }
         224  +
        /* EventStreamUnmarshallerGenerator.kt:119 */
  200    225   
    }
  201         -
    }
         226  +
    /* EventStreamUnmarshallerGenerator.kt:112 */
  202    227   
}

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

@@ -1,1 +254,377 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(
    4      6   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5      7   
)]
    6         -
pub struct CheckHealthInput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct CheckHealthInput {/* StructureGenerator.kt:201 */}
           9  +
/* ServerCodegenVisitor.kt:345 */
    7     10   
impl CheckHealthInput {
    8         -
    /// Creates a new builder-style object to manufacture [`CheckHealthInput`](crate::input::CheckHealthInput).
          11  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`CheckHealthInput`](crate::input::CheckHealthInput).
          12  +
    /* ServerBuilderGenerator.kt:295 */
    9     13   
    pub fn builder() -> crate::input::check_health_input::Builder {
          14  +
        /* ServerBuilderGenerator.kt:296 */
   10     15   
        crate::input::check_health_input::Builder::default()
          16  +
        /* ServerBuilderGenerator.kt:295 */
   11     17   
    }
          18  +
    /* ServerCodegenVisitor.kt:345 */
   12     19   
}
          20  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
   13     21   
impl crate::constrained::Constrained for crate::input::CheckHealthInput {
   14     22   
    type Unconstrained = crate::input::check_health_input::Builder;
   15     23   
}
   16     24   
          25  +
/* StructureGenerator.kt:197 */
   17     26   
#[allow(missing_docs)] // documentation missing in model
          27  +
/* RustType.kt:516 */
   18     28   
#[derive(::std::fmt::Debug)]
   19         -
pub struct CapturePokemonInput {
          29  +
pub /* StructureGenerator.kt:201 */ struct CapturePokemonInput {
          30  +
    /* StructureGenerator.kt:231 */
   20     31   
    #[allow(missing_docs)] // documentation missing in model
   21     32   
    pub events: ::aws_smithy_http::event_stream::Receiver<
   22     33   
        crate::model::AttemptCapturingPokemonEvent,
   23     34   
        crate::error::AttemptCapturingPokemonEventError,
   24     35   
    >,
          36  +
    /* StructureGenerator.kt:201 */
   25     37   
}
          38  +
/* StructureGenerator.kt:135 */
   26     39   
impl CapturePokemonInput {
          40  +
    /* StructureGenerator.kt:231 */
   27     41   
    #[allow(missing_docs)] // documentation missing in model
          42  +
                           /* StructureGenerator.kt:166 */
   28     43   
    pub fn events(
   29     44   
        &self,
   30     45   
    ) -> &::aws_smithy_http::event_stream::Receiver<
   31     46   
        crate::model::AttemptCapturingPokemonEvent,
   32     47   
        crate::error::AttemptCapturingPokemonEventError,
   33     48   
    > {
          49  +
        /* StructureGenerator.kt:172 */
   34     50   
        &self.events
          51  +
        /* StructureGenerator.kt:166 */
   35     52   
    }
          53  +
    /* StructureGenerator.kt:135 */
   36     54   
}
          55  +
/* ServerCodegenVisitor.kt:345 */
   37     56   
impl CapturePokemonInput {
   38         -
    /// Creates a new builder-style object to manufacture [`CapturePokemonInput`](crate::input::CapturePokemonInput).
          57  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`CapturePokemonInput`](crate::input::CapturePokemonInput).
          58  +
    /* ServerBuilderGenerator.kt:295 */
   39     59   
    pub fn builder() -> crate::input::capture_pokemon_input::Builder {
          60  +
        /* ServerBuilderGenerator.kt:296 */
   40     61   
        crate::input::capture_pokemon_input::Builder::default()
          62  +
        /* ServerBuilderGenerator.kt:295 */
   41     63   
    }
          64  +
    /* ServerCodegenVisitor.kt:345 */
   42     65   
}
          66  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
   43     67   
impl crate::constrained::Constrained for crate::input::CapturePokemonInput {
   44     68   
    type Unconstrained = crate::input::capture_pokemon_input::Builder;
   45     69   
}
   46     70   
          71  +
/* StructureGenerator.kt:197 */
   47     72   
#[allow(missing_docs)] // documentation missing in model
          73  +
/* RustType.kt:516 */
   48     74   
#[derive(
   49     75   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   50     76   
)]
   51         -
pub struct DoNothingInput {}
          77  +
pub /* StructureGenerator.kt:201 */ struct DoNothingInput {/* StructureGenerator.kt:201 */}
          78  +
/* ServerCodegenVisitor.kt:345 */
   52     79   
impl DoNothingInput {
   53         -
    /// Creates a new builder-style object to manufacture [`DoNothingInput`](crate::input::DoNothingInput).
          80  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`DoNothingInput`](crate::input::DoNothingInput).
          81  +
    /* ServerBuilderGenerator.kt:295 */
   54     82   
    pub fn builder() -> crate::input::do_nothing_input::Builder {
          83  +
        /* ServerBuilderGenerator.kt:296 */
   55     84   
        crate::input::do_nothing_input::Builder::default()
          85  +
        /* ServerBuilderGenerator.kt:295 */
   56     86   
    }
          87  +
    /* ServerCodegenVisitor.kt:345 */
   57     88   
}
          89  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
   58     90   
impl crate::constrained::Constrained for crate::input::DoNothingInput {
   59     91   
    type Unconstrained = crate::input::do_nothing_input::Builder;
   60     92   
}
   61     93   
          94  +
/* StructureGenerator.kt:197 */
   62     95   
#[allow(missing_docs)] // documentation missing in model
          96  +
/* RustType.kt:516 */
   63     97   
#[derive(
   64     98   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   65     99   
)]
   66         -
pub struct GetServerStatisticsInput {}
         100  +
pub /* StructureGenerator.kt:201 */ struct GetServerStatisticsInput {/* StructureGenerator.kt:201 */}
         101  +
/* ServerCodegenVisitor.kt:345 */
   67    102   
impl GetServerStatisticsInput {
   68         -
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
         103  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
         104  +
    /* ServerBuilderGenerator.kt:295 */
   69    105   
    pub fn builder() -> crate::input::get_server_statistics_input::Builder {
         106  +
        /* ServerBuilderGenerator.kt:296 */
   70    107   
        crate::input::get_server_statistics_input::Builder::default()
         108  +
        /* ServerBuilderGenerator.kt:295 */
   71    109   
    }
         110  +
    /* ServerCodegenVisitor.kt:345 */
   72    111   
}
         112  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
   73    113   
impl crate::constrained::Constrained for crate::input::GetServerStatisticsInput {
   74    114   
    type Unconstrained = crate::input::get_server_statistics_input::Builder;
   75    115   
}
   76         -
/// See [`CheckHealthInput`](crate::input::CheckHealthInput).
         116  +
/// /* ServerBuilderGenerator.kt:171 */See [`CheckHealthInput`](crate::input::CheckHealthInput).
   77    117   
pub mod check_health_input {
   78    118   
         119  +
    /* ServerBuilderGenerator.kt:461 */
   79    120   
    impl ::std::convert::From<Builder> for crate::input::CheckHealthInput {
   80    121   
        fn from(builder: Builder) -> Self {
   81    122   
            builder.build()
   82    123   
        }
   83    124   
    }
   84         -
    /// A builder for [`CheckHealthInput`](crate::input::CheckHealthInput).
         125  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`CheckHealthInput`](crate::input::CheckHealthInput).
         126  +
    /* RustType.kt:516 */
   85    127   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
   86         -
    pub struct Builder {}
         128  +
    /* ServerBuilderGenerator.kt:211 */
         129  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         130  +
    /* ServerBuilderGenerator.kt:215 */
   87    131   
    impl Builder {
   88         -
        /// Consumes the builder and constructs a [`CheckHealthInput`](crate::input::CheckHealthInput).
         132  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`CheckHealthInput`](crate::input::CheckHealthInput).
         133  +
        /* ServerBuilderGenerator.kt:271 */
   89    134   
        pub fn build(self) -> crate::input::CheckHealthInput {
   90    135   
            self.build_enforcing_all_constraints()
   91    136   
        }
         137  +
        /* ServerBuilderGenerator.kt:283 */
   92    138   
        fn build_enforcing_all_constraints(self) -> crate::input::CheckHealthInput {
   93         -
            crate::input::CheckHealthInput {}
         139  +
            /* ServerBuilderGenerator.kt:542 */
         140  +
            crate::input::CheckHealthInput {
         141  +
            /* ServerBuilderGenerator.kt:542 */}
         142  +
            /* ServerBuilderGenerator.kt:283 */
   94    143   
        }
         144  +
        /* ServerBuilderGenerator.kt:215 */
   95    145   
    }
         146  +
         147  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   96    148   
}
   97         -
/// See [`CapturePokemonInput`](crate::input::CapturePokemonInput).
         149  +
/// /* ServerBuilderGenerator.kt:171 */See [`CapturePokemonInput`](crate::input::CapturePokemonInput).
   98    150   
pub mod capture_pokemon_input {
   99    151   
         152  +
    /* RustType.kt:516 */
  100    153   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  101         -
    /// Holds one variant for each of the ways the builder can fail.
         154  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         155  +
    /* RustType.kt:516 */
  102    156   
    #[non_exhaustive]
         157  +
    /* ServerBuilderConstraintViolations.kt:75 */
  103    158   
    #[allow(clippy::enum_variant_names)]
  104    159   
    pub enum ConstraintViolation {
  105         -
        /// `events` was not provided but it is required when building `CapturePokemonInput`.
         160  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`events` was not provided but it is required when building `CapturePokemonInput`.
         161  +
        /* ServerBuilderConstraintViolations.kt:143 */
  106    162   
        MissingEvents,
         163  +
        /* ServerBuilderConstraintViolations.kt:75 */
  107    164   
    }
         165  +
    /* ServerBuilderConstraintViolations.kt:117 */
  108    166   
    impl ::std::fmt::Display for ConstraintViolation {
         167  +
        /* ServerBuilderConstraintViolations.kt:118 */
  109    168   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         169  +
            /* ServerBuilderConstraintViolations.kt:119 */
  110    170   
            match self {
  111         -
                ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `CapturePokemonInput`"),
  112         -
            }
         171  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `CapturePokemonInput`"),
         172  +
            /* ServerBuilderConstraintViolations.kt:119 */}
         173  +
            /* ServerBuilderConstraintViolations.kt:118 */
  113    174   
        }
         175  +
        /* ServerBuilderConstraintViolations.kt:117 */
  114    176   
    }
         177  +
    /* ServerBuilderConstraintViolations.kt:84 */
  115    178   
    impl ::std::error::Error for ConstraintViolation {}
         179  +
    /* ServerBuilderConstraintViolations.kt:171 */
  116    180   
    impl ConstraintViolation {
  117    181   
        pub(crate) fn as_validation_exception_field(
  118    182   
            self,
  119    183   
            path: ::std::string::String,
  120    184   
        ) -> crate::model::ValidationExceptionField {
  121    185   
            match self {
  122    186   
            ConstraintViolation::MissingEvents => crate::model::ValidationExceptionField {
  123    187   
                                                message: format!("Value at '{}/events' failed to satisfy constraint: Member must not be null", path),
  124    188   
                                                path: path + "/events",
  125    189   
                                            },
  126    190   
        }
  127    191   
        }
  128    192   
    }
         193  +
    /* ServerBuilderGenerator.kt:234 */
  129    194   
    impl ::std::convert::From<ConstraintViolation>
  130    195   
        for ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection
  131    196   
    {
  132    197   
        fn from(constraint_violation: ConstraintViolation) -> Self {
  133    198   
            let first_validation_exception_field =
  134    199   
                constraint_violation.as_validation_exception_field("".to_owned());
  135    200   
            let validation_exception = crate::error::ValidationException {
  136    201   
                message: format!(
  137    202   
                    "1 validation error detected. {}",
  138    203   
                    &first_validation_exception_field.message
  139    204   
                ),
  140    205   
                field_list: Some(vec![first_validation_exception_field]),
  141    206   
            };
  142    207   
            Self::ConstraintViolation(
  143    208   
                                crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
  144    209   
                                    .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
  145    210   
                            )
  146    211   
        }
  147    212   
    }
         213  +
    /* ServerBuilderGenerator.kt:244 */
  148    214   
    impl ::std::convert::From<Builder>
  149    215   
        for crate::constrained::MaybeConstrained<crate::input::CapturePokemonInput>
  150    216   
    {
  151    217   
        fn from(builder: Builder) -> Self {
  152    218   
            Self::Unconstrained(builder)
  153    219   
        }
  154    220   
    }
         221  +
    /* ServerBuilderGenerator.kt:446 */
  155    222   
    impl ::std::convert::TryFrom<Builder> for crate::input::CapturePokemonInput {
  156    223   
        type Error = ConstraintViolation;
  157    224   
  158    225   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  159    226   
            builder.build()
  160    227   
        }
  161    228   
    }
  162         -
    /// A builder for [`CapturePokemonInput`](crate::input::CapturePokemonInput).
         229  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`CapturePokemonInput`](crate::input::CapturePokemonInput).
         230  +
    /* RustType.kt:516 */
  163    231   
    #[derive(::std::default::Default, ::std::fmt::Debug)]
         232  +
    /* ServerBuilderGenerator.kt:211 */
  164    233   
    pub struct Builder {
         234  +
        /* ServerBuilderGenerator.kt:308 */
  165    235   
        pub(crate) events: ::std::option::Option<
  166    236   
            ::aws_smithy_http::event_stream::Receiver<
  167    237   
                crate::model::AttemptCapturingPokemonEvent,
  168    238   
                crate::error::AttemptCapturingPokemonEventError,
  169    239   
            >,
  170    240   
        >,
         241  +
        /* ServerBuilderGenerator.kt:211 */
  171    242   
    }
         243  +
    /* ServerBuilderGenerator.kt:215 */
  172    244   
    impl Builder {
         245  +
        /* ServerBuilderGenerator.kt:331 */
  173    246   
        #[allow(missing_docs)] // documentation missing in model
         247  +
                               /* ServerBuilderGenerator.kt:343 */
  174    248   
        pub fn events(
  175    249   
            mut self,
  176    250   
            input: ::aws_smithy_http::event_stream::Receiver<
  177    251   
                crate::model::AttemptCapturingPokemonEvent,
  178    252   
                crate::error::AttemptCapturingPokemonEventError,
  179    253   
            >,
  180    254   
        ) -> Self {
  181         -
            self.events = Some(input);
         255  +
            /* ServerBuilderGenerator.kt:344 */
         256  +
            self.events =
         257  +
                /* ServerBuilderGenerator.kt:345 */Some(
         258  +
                    /* ServerBuilderGenerator.kt:376 */input
         259  +
                /* ServerBuilderGenerator.kt:345 */)
         260  +
            /* ServerBuilderGenerator.kt:344 */;
  182    261   
            self
         262  +
            /* ServerBuilderGenerator.kt:343 */
  183    263   
        }
         264  +
        /* ServerBuilderGenerator.kt:426 */
  184    265   
        #[allow(missing_docs)] // documentation missing in model
         266  +
                               /* ServerBuilderGenerator.kt:428 */
  185    267   
        pub(crate) fn set_events(
  186    268   
            mut self,
  187    269   
            input: impl ::std::convert::Into<
  188    270   
                ::aws_smithy_http::event_stream::Receiver<
  189    271   
                    crate::model::AttemptCapturingPokemonEvent,
  190    272   
                    crate::error::AttemptCapturingPokemonEventError,
  191    273   
                >,
  192    274   
            >,
  193    275   
        ) -> Self {
         276  +
            /* ServerBuilderGenerator.kt:429 */
  194    277   
            self.events = Some(input.into());
  195    278   
            self
         279  +
            /* ServerBuilderGenerator.kt:428 */
  196    280   
        }
  197         -
        /// Consumes the builder and constructs a [`CapturePokemonInput`](crate::input::CapturePokemonInput).
  198         -
        ///
         281  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`CapturePokemonInput`](crate::input::CapturePokemonInput).
         282  +
        /// /* ServerBuilderGenerator.kt:260 */
  199    283   
        /// The builder fails to construct a [`CapturePokemonInput`](crate::input::CapturePokemonInput) if a [`ConstraintViolation`] occurs.
  200    284   
        ///
         285  +
        /* ServerBuilderGenerator.kt:271 */
  201    286   
        pub fn build(self) -> Result<crate::input::CapturePokemonInput, ConstraintViolation> {
  202    287   
            self.build_enforcing_all_constraints()
  203    288   
        }
         289  +
        /* ServerBuilderGenerator.kt:283 */
  204    290   
        fn build_enforcing_all_constraints(
  205    291   
            self,
  206    292   
        ) -> Result<crate::input::CapturePokemonInput, ConstraintViolation> {
  207         -
            Ok(crate::input::CapturePokemonInput {
  208         -
                events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
  209         -
            })
         293  +
            /* ServerBuilderGenerator.kt:287 */
         294  +
            Ok(
         295  +
                /* ServerBuilderGenerator.kt:542 */
         296  +
                crate::input::CapturePokemonInput {
         297  +
                    /* ServerBuilderGenerator.kt:546 */
         298  +
                    events: self
         299  +
                        .events
         300  +
                        /* ServerBuilderGenerator.kt:569 */
         301  +
                        .ok_or(ConstraintViolation::MissingEvents)?,
         302  +
                    /* ServerBuilderGenerator.kt:542 */
         303  +
                }, /* ServerBuilderGenerator.kt:287 */
         304  +
            )
         305  +
            /* ServerBuilderGenerator.kt:283 */
  210    306   
        }
         307  +
        /* ServerBuilderGenerator.kt:215 */
  211    308   
    }
         309  +
         310  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  212    311   
}
  213         -
/// See [`DoNothingInput`](crate::input::DoNothingInput).
         312  +
/// /* ServerBuilderGenerator.kt:171 */See [`DoNothingInput`](crate::input::DoNothingInput).
  214    313   
pub mod do_nothing_input {
  215    314   
         315  +
    /* ServerBuilderGenerator.kt:461 */
  216    316   
    impl ::std::convert::From<Builder> for crate::input::DoNothingInput {
  217    317   
        fn from(builder: Builder) -> Self {
  218    318   
            builder.build()
  219    319   
        }
  220    320   
    }
  221         -
    /// A builder for [`DoNothingInput`](crate::input::DoNothingInput).
         321  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`DoNothingInput`](crate::input::DoNothingInput).
         322  +
    /* RustType.kt:516 */
  222    323   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  223         -
    pub struct Builder {}
         324  +
    /* ServerBuilderGenerator.kt:211 */
         325  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         326  +
    /* ServerBuilderGenerator.kt:215 */
  224    327   
    impl Builder {
  225         -
        /// Consumes the builder and constructs a [`DoNothingInput`](crate::input::DoNothingInput).
         328  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`DoNothingInput`](crate::input::DoNothingInput).
         329  +
        /* ServerBuilderGenerator.kt:271 */
  226    330   
        pub fn build(self) -> crate::input::DoNothingInput {
  227    331   
            self.build_enforcing_all_constraints()
  228    332   
        }
         333  +
        /* ServerBuilderGenerator.kt:283 */
  229    334   
        fn build_enforcing_all_constraints(self) -> crate::input::DoNothingInput {
  230         -
            crate::input::DoNothingInput {}
         335  +
            /* ServerBuilderGenerator.kt:542 */
         336  +
            crate::input::DoNothingInput {
         337  +
            /* ServerBuilderGenerator.kt:542 */}
         338  +
            /* ServerBuilderGenerator.kt:283 */
  231    339   
        }
         340  +
        /* ServerBuilderGenerator.kt:215 */
  232    341   
    }
         342  +
         343  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  233    344   
}
  234         -
/// See [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
         345  +
/// /* ServerBuilderGenerator.kt:171 */See [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
  235    346   
pub mod get_server_statistics_input {
  236    347   
         348  +
    /* ServerBuilderGenerator.kt:461 */
  237    349   
    impl ::std::convert::From<Builder> for crate::input::GetServerStatisticsInput {
  238    350   
        fn from(builder: Builder) -> Self {
  239    351   
            builder.build()
  240    352   
        }
  241    353   
    }
  242         -
    /// A builder for [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
         354  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
         355  +
    /* RustType.kt:516 */
  243    356   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  244         -
    pub struct Builder {}
         357  +
    /* ServerBuilderGenerator.kt:211 */
         358  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         359  +
    /* ServerBuilderGenerator.kt:215 */
  245    360   
    impl Builder {
  246         -
        /// Consumes the builder and constructs a [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
         361  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput).
         362  +
        /* ServerBuilderGenerator.kt:271 */
  247    363   
        pub fn build(self) -> crate::input::GetServerStatisticsInput {
  248    364   
            self.build_enforcing_all_constraints()
  249    365   
        }
         366  +
        /* ServerBuilderGenerator.kt:283 */
  250    367   
        fn build_enforcing_all_constraints(self) -> crate::input::GetServerStatisticsInput {
  251         -
            crate::input::GetServerStatisticsInput {}
         368  +
            /* ServerBuilderGenerator.kt:542 */
         369  +
            crate::input::GetServerStatisticsInput {
         370  +
            /* ServerBuilderGenerator.kt:542 */}
         371  +
            /* ServerBuilderGenerator.kt:283 */
  252    372   
        }
         373  +
        /* ServerBuilderGenerator.kt:215 */
  253    374   
    }
         375  +
         376  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  254    377   
}

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

@@ -1,1 +52,53 @@
   13     13   
#![allow(clippy::result_large_err)]
   14     14   
#![allow(clippy::unnecessary_map_on_constructor)]
   15     15   
#![allow(rustdoc::bare_urls)]
   16     16   
#![allow(rustdoc::redundant_explicit_links)]
   17     17   
#![allow(rustdoc::invalid_html_tags)]
   18     18   
#![forbid(unsafe_code)]
   19     19   
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
   20     20   
//! The Pokémon Service allows you to retrieve information about Pokémon species.
   21     21   
   22     22   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
          23  +
/* ServerRootGenerator.kt:65 */
   23     24   
//! A fast and customizable Rust implementation of the PokemonService Smithy service.
   24     25   
//!
   25     26   
//! # Using PokemonService
   26     27   
//!
   27     28   
//! The primary entrypoint is [`PokemonService`]: it satisfies the [`Service<http::Request, Response = http::Response>`](::tower::Service)
   28     29   
//! trait and therefore can be handed to a [`hyper` server](https://github.com/hyperium/hyper) via [`PokemonService::into_make_service`]
   29     30   
//! or used in AWS Lambda
   30     31   
#![cfg_attr(
   31     32   
    feature = "aws-lambda",
   32     33   
    doc = " via [`LambdaHandler`](crate::server::routing::LambdaHandler)."
@@ -182,183 +260,269 @@
  202    203   
//! }
  203    204   
//!
  204    205   
//! ```
  205    206   
//!
  206    207   
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
  207    208   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  208    209   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  209    210   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  210    211   
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  211    212   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         213  +
/* ServerRootGenerator.kt:261 */
  212    214   
pub use crate::service::{
  213    215   
    MissingOperationsError, PokemonService, PokemonServiceBuilder, PokemonServiceConfig,
  214    216   
    PokemonServiceConfigBuilder,
  215    217   
};
  216    218   
  217         -
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
         219  +
/// /* ServerRustModule.kt:55 */Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  218    220   
pub mod server {
  219    221   
    // Re-export all types from the `aws-smithy-http-server` crate.
  220    222   
    pub use ::aws_smithy_http_server::*;
         223  +
         224  +
    /* CodegenDelegator.kt:200 */
  221    225   
}
  222    226   
         227  +
/* CrateVersionCustomization.kt:23 */
  223    228   
/// Crate version number.
  224    229   
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
  225    230   
  226         -
/// All error types that operations can return. Documentation on these types is copied from the model.
         231  +
/// /* ServerRustModule.kt:55 */All error types that operations can return. Documentation on these types is copied from the model.
  227    232   
pub mod error;
  228    233   
  229         -
/// Input structures for operations. Documentation on these types is copied from the model.
         234  +
/// /* ServerRustModule.kt:55 */Input structures for operations. Documentation on these types is copied from the model.
  230    235   
pub mod input;
  231    236   
  232         -
/// Data structures used by operation inputs/outputs. Documentation on these types is copied from the model.
         237  +
/// /* ServerRustModule.kt:55 */Data structures used by operation inputs/outputs. Documentation on these types is copied from the model.
  233    238   
pub mod model;
  234    239   
  235         -
/// All operations that this crate can perform.
         240  +
/// /* ServerRustModule.kt:55 */All operations that this crate can perform.
  236    241   
pub mod operation;
  237    242   
         243  +
/* ServerRustModule.kt:79 */
  238    244   
/// A collection of types representing each operation defined in the service closure.
  239    245   
///
  240    246   
/// The [plugin system](::aws_smithy_http_server::plugin) makes use of these
  241    247   
/// [zero-sized types](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) (ZSTs) to
  242    248   
/// parameterize [`Plugin`](::aws_smithy_http_server::plugin::Plugin) implementations. Their traits, such as
  243    249   
/// [`OperationShape`](::aws_smithy_http_server::operation::OperationShape), can be used to provide
  244    250   
/// operation specific information to the [`Layer`](::tower::Layer) being applied.
  245    251   
pub mod operation_shape;
  246    252   
  247         -
/// Output structures for operations. Documentation on these types is copied from the model.
         253  +
/// /* ServerRustModule.kt:55 */Output structures for operations. Documentation on these types is copied from the model.
  248    254   
pub mod output;
  249    255   
         256  +
/* RustModule.kt:172 */
  250    257   
mod service;
  251    258   
  252         -
/// Data primitives referenced by other data types.
         259  +
/// /* ServerRustModule.kt:55 */Data primitives referenced by other data types.
  253    260   
pub mod types;
  254    261   
  255         -
/// Constrained types for constrained shapes.
         262  +
/// /* ServerRustModule.kt:55 */Constrained types for constrained shapes.
         263  +
/* RustModule.kt:172 */
  256    264   
mod constrained;
  257    265   
         266  +
/* RustModule.kt:172 */
  258    267   
mod event_stream_serde;
  259    268   
  260    269   
pub(crate) mod protocol_serde;

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

@@ -1,1 +381,654 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Describes one specific validation failure for an input member.
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */Describes one specific validation failure for an input member.
           4  +
/* RustType.kt:516 */
    4      5   
#[derive(
    5      6   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    6      7   
)]
    7         -
pub struct ValidationExceptionField {
    8         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
           8  +
pub /* StructureGenerator.kt:201 */ struct ValidationExceptionField {
           9  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
    9     10   
    pub path: ::std::string::String,
   10         -
    /// A detailed description of the validation failure.
          11  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
   11     12   
    pub message: ::std::string::String,
          13  +
    /* StructureGenerator.kt:201 */
   12     14   
}
          15  +
/* StructureGenerator.kt:135 */
   13     16   
impl ValidationExceptionField {
   14         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          17  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          18  +
    /* StructureGenerator.kt:166 */
   15     19   
    pub fn path(&self) -> &str {
          20  +
        /* StructureGenerator.kt:171 */
   16     21   
        use std::ops::Deref;
   17     22   
        self.path.deref()
          23  +
        /* StructureGenerator.kt:166 */
   18     24   
    }
   19         -
    /// A detailed description of the validation failure.
          25  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
          26  +
    /* StructureGenerator.kt:166 */
   20     27   
    pub fn message(&self) -> &str {
          28  +
        /* StructureGenerator.kt:171 */
   21     29   
        use std::ops::Deref;
   22     30   
        self.message.deref()
          31  +
        /* StructureGenerator.kt:166 */
   23     32   
    }
          33  +
    /* StructureGenerator.kt:135 */
   24     34   
}
          35  +
/* ServerCodegenVisitor.kt:345 */
   25     36   
impl ValidationExceptionField {
   26         -
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
          37  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
          38  +
    /* ServerBuilderGenerator.kt:295 */
   27     39   
    pub fn builder() -> crate::model::validation_exception_field::Builder {
          40  +
        /* ServerBuilderGenerator.kt:296 */
   28     41   
        crate::model::validation_exception_field::Builder::default()
          42  +
        /* ServerBuilderGenerator.kt:295 */
   29     43   
    }
          44  +
    /* ServerCodegenVisitor.kt:345 */
   30     45   
}
   31     46   
          47  +
/* UnionGenerator.kt:67 */
   32     48   
#[allow(missing_docs)] // documentation missing in model
          49  +
/* RustType.kt:516 */
   33     50   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   34         -
pub enum CapturePokemonEvents {
          51  +
pub /* UnionGenerator.kt:85 */ enum CapturePokemonEvents {
          52  +
    /* UnionGenerator.kt:90 */
   35     53   
    #[allow(missing_docs)] // documentation missing in model
          54  +
    /* UnionGenerator.kt:190 */
   36     55   
    Event(crate::model::CaptureEvent),
          56  +
    /* UnionGenerator.kt:85 */
   37     57   
}
          58  +
/* UnionGenerator.kt:111 */
   38     59   
impl CapturePokemonEvents {
          60  +
    /* RustType.kt:516 */
   39     61   
    #[allow(irrefutable_let_patterns)]
          62  +
    /* UnionGenerator.kt:217 */
   40     63   
    /// Tries to convert the enum instance into [`Event`](crate::model::CapturePokemonEvents::Event), extracting the inner [`CaptureEvent`](crate::model::CaptureEvent).
          64  +
    /* UnionGenerator.kt:222 */
   41     65   
    /// Returns `Err(&Self)` if it can't be converted.
          66  +
    /* UnionGenerator.kt:223 */
   42     67   
    pub fn as_event(&self) -> ::std::result::Result<&crate::model::CaptureEvent, &Self> {
          68  +
        /* UnionGenerator.kt:227 */
   43     69   
        if let CapturePokemonEvents::Event(val) = &self {
   44     70   
            ::std::result::Result::Ok(val)
   45     71   
        } else {
   46     72   
            ::std::result::Result::Err(self)
   47     73   
        }
          74  +
        /* UnionGenerator.kt:223 */
   48     75   
    }
          76  +
    /* UnionGenerator.kt:121 */
   49     77   
    /// Returns true if this is a [`Event`](crate::model::CapturePokemonEvents::Event).
          78  +
    /* UnionGenerator.kt:122 */
   50     79   
    pub fn is_event(&self) -> bool {
          80  +
        /* UnionGenerator.kt:123 */
   51     81   
        self.as_event().is_ok()
          82  +
        /* UnionGenerator.kt:122 */
   52     83   
    }
          84  +
    /* UnionGenerator.kt:111 */
   53     85   
}
   54     86   
          87  +
/* StructureGenerator.kt:197 */
   55     88   
#[allow(missing_docs)] // documentation missing in model
          89  +
/* RustType.kt:516 */
   56     90   
#[derive(
   57     91   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   58     92   
)]
   59         -
pub struct CaptureEvent {
          93  +
pub /* StructureGenerator.kt:201 */ struct CaptureEvent {
          94  +
    /* StructureGenerator.kt:231 */
   60     95   
    #[allow(missing_docs)] // documentation missing in model
   61     96   
    pub name: ::std::option::Option<::std::string::String>,
          97  +
    /* StructureGenerator.kt:231 */
   62     98   
    #[allow(missing_docs)] // documentation missing in model
   63     99   
    pub captured: ::std::option::Option<bool>,
         100  +
    /* StructureGenerator.kt:231 */
   64    101   
    #[allow(missing_docs)] // documentation missing in model
   65    102   
    pub shiny: ::std::option::Option<bool>,
         103  +
    /* StructureGenerator.kt:231 */
   66    104   
    #[allow(missing_docs)] // documentation missing in model
   67    105   
    pub pokedex_update: ::std::option::Option<::aws_smithy_types::Blob>,
         106  +
    /* StructureGenerator.kt:201 */
   68    107   
}
         108  +
/* StructureGenerator.kt:135 */
   69    109   
impl CaptureEvent {
         110  +
    /* StructureGenerator.kt:231 */
   70    111   
    #[allow(missing_docs)] // documentation missing in model
         112  +
                           /* StructureGenerator.kt:166 */
   71    113   
    pub fn name(&self) -> ::std::option::Option<&str> {
         114  +
        /* StructureGenerator.kt:169 */
   72    115   
        self.name.as_deref()
         116  +
        /* StructureGenerator.kt:166 */
   73    117   
    }
         118  +
    /* StructureGenerator.kt:231 */
   74    119   
    #[allow(missing_docs)] // documentation missing in model
         120  +
                           /* StructureGenerator.kt:166 */
   75    121   
    pub fn captured(&self) -> ::std::option::Option<bool> {
         122  +
        /* StructureGenerator.kt:168 */
   76    123   
        self.captured
         124  +
        /* StructureGenerator.kt:166 */
   77    125   
    }
         126  +
    /* StructureGenerator.kt:231 */
   78    127   
    #[allow(missing_docs)] // documentation missing in model
         128  +
                           /* StructureGenerator.kt:166 */
   79    129   
    pub fn shiny(&self) -> ::std::option::Option<bool> {
         130  +
        /* StructureGenerator.kt:168 */
   80    131   
        self.shiny
         132  +
        /* StructureGenerator.kt:166 */
   81    133   
    }
         134  +
    /* StructureGenerator.kt:231 */
   82    135   
    #[allow(missing_docs)] // documentation missing in model
         136  +
                           /* StructureGenerator.kt:166 */
   83    137   
    pub fn pokedex_update(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
         138  +
        /* StructureGenerator.kt:170 */
   84    139   
        self.pokedex_update.as_ref()
         140  +
        /* StructureGenerator.kt:166 */
   85    141   
    }
         142  +
    /* StructureGenerator.kt:135 */
   86    143   
}
         144  +
/* ServerCodegenVisitor.kt:345 */
   87    145   
impl CaptureEvent {
   88         -
    /// Creates a new builder-style object to manufacture [`CaptureEvent`](crate::model::CaptureEvent).
         146  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`CaptureEvent`](crate::model::CaptureEvent).
         147  +
    /* ServerBuilderGenerator.kt:295 */
   89    148   
    pub fn builder() -> crate::model::capture_event::Builder {
         149  +
        /* ServerBuilderGenerator.kt:296 */
   90    150   
        crate::model::capture_event::Builder::default()
         151  +
        /* ServerBuilderGenerator.kt:295 */
   91    152   
    }
         153  +
    /* ServerCodegenVisitor.kt:345 */
   92    154   
}
   93    155   
         156  +
/* UnionGenerator.kt:67 */
   94    157   
#[allow(missing_docs)] // documentation missing in model
         158  +
/* RustType.kt:516 */
   95    159   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
   96         -
pub enum AttemptCapturingPokemonEvent {
         160  +
pub /* UnionGenerator.kt:85 */ enum AttemptCapturingPokemonEvent {
         161  +
    /* UnionGenerator.kt:90 */
   97    162   
    #[allow(missing_docs)] // documentation missing in model
         163  +
    /* UnionGenerator.kt:190 */
   98    164   
    Event(crate::model::CapturingEvent),
         165  +
    /* UnionGenerator.kt:85 */
   99    166   
}
         167  +
/* UnionGenerator.kt:111 */
  100    168   
impl AttemptCapturingPokemonEvent {
         169  +
    /* RustType.kt:516 */
  101    170   
    #[allow(irrefutable_let_patterns)]
         171  +
    /* UnionGenerator.kt:217 */
  102    172   
    /// Tries to convert the enum instance into [`Event`](crate::model::AttemptCapturingPokemonEvent::Event), extracting the inner [`CapturingEvent`](crate::model::CapturingEvent).
         173  +
    /* UnionGenerator.kt:222 */
  103    174   
    /// Returns `Err(&Self)` if it can't be converted.
         175  +
    /* UnionGenerator.kt:223 */
  104    176   
    pub fn as_event(&self) -> ::std::result::Result<&crate::model::CapturingEvent, &Self> {
         177  +
        /* UnionGenerator.kt:227 */
  105    178   
        if let AttemptCapturingPokemonEvent::Event(val) = &self {
  106    179   
            ::std::result::Result::Ok(val)
  107    180   
        } else {
  108    181   
            ::std::result::Result::Err(self)
  109    182   
        }
         183  +
        /* UnionGenerator.kt:223 */
  110    184   
    }
         185  +
    /* UnionGenerator.kt:121 */
  111    186   
    /// Returns true if this is a [`Event`](crate::model::AttemptCapturingPokemonEvent::Event).
         187  +
    /* UnionGenerator.kt:122 */
  112    188   
    pub fn is_event(&self) -> bool {
         189  +
        /* UnionGenerator.kt:123 */
  113    190   
        self.as_event().is_ok()
         191  +
        /* UnionGenerator.kt:122 */
  114    192   
    }
         193  +
    /* UnionGenerator.kt:111 */
  115    194   
}
  116    195   
         196  +
/* StructureGenerator.kt:197 */
  117    197   
#[allow(missing_docs)] // documentation missing in model
         198  +
/* RustType.kt:516 */
  118    199   
#[derive(
  119    200   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  120    201   
)]
  121         -
pub struct CapturingEvent {
         202  +
pub /* StructureGenerator.kt:201 */ struct CapturingEvent {
         203  +
    /* StructureGenerator.kt:231 */
  122    204   
    #[allow(missing_docs)] // documentation missing in model
  123    205   
    pub payload: ::std::option::Option<crate::model::CapturingPayload>,
         206  +
    /* StructureGenerator.kt:201 */
  124    207   
}
         208  +
/* StructureGenerator.kt:135 */
  125    209   
impl CapturingEvent {
         210  +
    /* StructureGenerator.kt:231 */
  126    211   
    #[allow(missing_docs)] // documentation missing in model
         212  +
                           /* StructureGenerator.kt:166 */
  127    213   
    pub fn payload(&self) -> ::std::option::Option<&crate::model::CapturingPayload> {
         214  +
        /* StructureGenerator.kt:170 */
  128    215   
        self.payload.as_ref()
         216  +
        /* StructureGenerator.kt:166 */
  129    217   
    }
         218  +
    /* StructureGenerator.kt:135 */
  130    219   
}
         220  +
/* ServerCodegenVisitor.kt:345 */
  131    221   
impl CapturingEvent {
  132         -
    /// Creates a new builder-style object to manufacture [`CapturingEvent`](crate::model::CapturingEvent).
         222  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`CapturingEvent`](crate::model::CapturingEvent).
         223  +
    /* ServerBuilderGenerator.kt:295 */
  133    224   
    pub fn builder() -> crate::model::capturing_event::Builder {
         225  +
        /* ServerBuilderGenerator.kt:296 */
  134    226   
        crate::model::capturing_event::Builder::default()
         227  +
        /* ServerBuilderGenerator.kt:295 */
  135    228   
    }
         229  +
    /* ServerCodegenVisitor.kt:345 */
  136    230   
}
         231  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
  137    232   
impl crate::constrained::Constrained for crate::model::CapturingEvent {
  138    233   
    type Unconstrained = crate::model::capturing_event::Builder;
  139    234   
}
  140    235   
         236  +
/* StructureGenerator.kt:197 */
  141    237   
#[allow(missing_docs)] // documentation missing in model
         238  +
/* RustType.kt:516 */
  142    239   
#[derive(
  143    240   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  144    241   
)]
  145         -
pub struct CapturingPayload {
         242  +
pub /* StructureGenerator.kt:201 */ struct CapturingPayload {
         243  +
    /* StructureGenerator.kt:231 */
  146    244   
    #[allow(missing_docs)] // documentation missing in model
  147    245   
    pub name: ::std::option::Option<::std::string::String>,
         246  +
    /* StructureGenerator.kt:231 */
  148    247   
    #[allow(missing_docs)] // documentation missing in model
  149    248   
    pub pokeball: ::std::option::Option<::std::string::String>,
         249  +
    /* StructureGenerator.kt:201 */
  150    250   
}
         251  +
/* StructureGenerator.kt:135 */
  151    252   
impl CapturingPayload {
         253  +
    /* StructureGenerator.kt:231 */
  152    254   
    #[allow(missing_docs)] // documentation missing in model
         255  +
                           /* StructureGenerator.kt:166 */
  153    256   
    pub fn name(&self) -> ::std::option::Option<&str> {
         257  +
        /* StructureGenerator.kt:169 */
  154    258   
        self.name.as_deref()
         259  +
        /* StructureGenerator.kt:166 */
  155    260   
    }
         261  +
    /* StructureGenerator.kt:231 */
  156    262   
    #[allow(missing_docs)] // documentation missing in model
         263  +
                           /* StructureGenerator.kt:166 */
  157    264   
    pub fn pokeball(&self) -> ::std::option::Option<&str> {
         265  +
        /* StructureGenerator.kt:169 */
  158    266   
        self.pokeball.as_deref()
         267  +
        /* StructureGenerator.kt:166 */
  159    268   
    }
         269  +
    /* StructureGenerator.kt:135 */
  160    270   
}
         271  +
/* ServerCodegenVisitor.kt:345 */
  161    272   
impl CapturingPayload {
  162         -
    /// Creates a new builder-style object to manufacture [`CapturingPayload`](crate::model::CapturingPayload).
         273  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`CapturingPayload`](crate::model::CapturingPayload).
         274  +
    /* ServerBuilderGenerator.kt:295 */
  163    275   
    pub fn builder() -> crate::model::capturing_payload::Builder {
         276  +
        /* ServerBuilderGenerator.kt:296 */
  164    277   
        crate::model::capturing_payload::Builder::default()
         278  +
        /* ServerBuilderGenerator.kt:295 */
  165    279   
    }
         280  +
    /* ServerCodegenVisitor.kt:345 */
  166    281   
}
         282  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
  167    283   
impl crate::constrained::Constrained for crate::model::CapturingPayload {
  168    284   
    type Unconstrained = crate::model::capturing_payload::Builder;
  169    285   
}
  170         -
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         286  +
/// /* ServerBuilderGenerator.kt:171 */See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  171    287   
pub mod validation_exception_field {
  172    288   
         289  +
    /* RustType.kt:516 */
  173    290   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  174         -
    /// Holds one variant for each of the ways the builder can fail.
         291  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         292  +
    /* RustType.kt:516 */
  175    293   
    #[non_exhaustive]
         294  +
    /* ServerBuilderConstraintViolations.kt:75 */
  176    295   
    #[allow(clippy::enum_variant_names)]
  177    296   
    pub enum ConstraintViolation {
  178         -
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
         297  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`path` was not provided but it is required when building `ValidationExceptionField`.
         298  +
        /* ServerBuilderConstraintViolations.kt:143 */
  179    299   
        MissingPath,
  180         -
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
         300  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`message` was not provided but it is required when building `ValidationExceptionField`.
         301  +
        /* ServerBuilderConstraintViolations.kt:143 */
  181    302   
        MissingMessage,
         303  +
        /* ServerBuilderConstraintViolations.kt:75 */
  182    304   
    }
         305  +
    /* ServerBuilderConstraintViolations.kt:117 */
  183    306   
    impl ::std::fmt::Display for ConstraintViolation {
         307  +
        /* ServerBuilderConstraintViolations.kt:118 */
  184    308   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         309  +
            /* ServerBuilderConstraintViolations.kt:119 */
  185    310   
            match self {
  186         -
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
  187         -
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
  188         -
            }
         311  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
         312  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
         313  +
            /* ServerBuilderConstraintViolations.kt:119 */}
         314  +
            /* ServerBuilderConstraintViolations.kt:118 */
  189    315   
        }
         316  +
        /* ServerBuilderConstraintViolations.kt:117 */
  190    317   
    }
         318  +
    /* ServerBuilderConstraintViolations.kt:84 */
  191    319   
    impl ::std::error::Error for ConstraintViolation {}
         320  +
    /* ServerBuilderGenerator.kt:446 */
  192    321   
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
  193    322   
        type Error = ConstraintViolation;
  194    323   
  195    324   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  196    325   
            builder.build()
  197    326   
        }
  198    327   
    }
  199         -
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         328  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         329  +
    /* RustType.kt:516 */
  200    330   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         331  +
    /* ServerBuilderGenerator.kt:211 */
  201    332   
    pub struct Builder {
         333  +
        /* ServerBuilderGenerator.kt:308 */
  202    334   
        pub(crate) path: ::std::option::Option<::std::string::String>,
         335  +
        /* ServerBuilderGenerator.kt:308 */
  203    336   
        pub(crate) message: ::std::option::Option<::std::string::String>,
         337  +
        /* ServerBuilderGenerator.kt:211 */
  204    338   
    }
         339  +
    /* ServerBuilderGenerator.kt:215 */
  205    340   
    impl Builder {
  206         -
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         341  +
        /// /* ServerBuilderGenerator.kt:331 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         342  +
        /* ServerBuilderGenerator.kt:343 */
  207    343   
        pub fn path(mut self, input: ::std::string::String) -> Self {
  208         -
            self.path = Some(input);
         344  +
            /* ServerBuilderGenerator.kt:344 */
         345  +
            self.path =
         346  +
                /* ServerBuilderGenerator.kt:345 */Some(
         347  +
                    /* ServerBuilderGenerator.kt:376 */input
         348  +
                /* ServerBuilderGenerator.kt:345 */)
         349  +
            /* ServerBuilderGenerator.kt:344 */;
  209    350   
            self
         351  +
            /* ServerBuilderGenerator.kt:343 */
  210    352   
        }
  211         -
        /// A detailed description of the validation failure.
         353  +
        /// /* ServerBuilderGenerator.kt:331 */A detailed description of the validation failure.
         354  +
        /* ServerBuilderGenerator.kt:343 */
  212    355   
        pub fn message(mut self, input: ::std::string::String) -> Self {
  213         -
            self.message = Some(input);
         356  +
            /* ServerBuilderGenerator.kt:344 */
         357  +
            self.message =
         358  +
                /* ServerBuilderGenerator.kt:345 */Some(
         359  +
                    /* ServerBuilderGenerator.kt:376 */input
         360  +
                /* ServerBuilderGenerator.kt:345 */)
         361  +
            /* ServerBuilderGenerator.kt:344 */;
  214    362   
            self
         363  +
            /* ServerBuilderGenerator.kt:343 */
  215    364   
        }
  216         -
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  217         -
        ///
         365  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         366  +
        /// /* ServerBuilderGenerator.kt:260 */
  218    367   
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
  219    368   
        ///
  220         -
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         369  +
        /// /* ServerBuilderGenerator.kt:268 */If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         370  +
        /* ServerBuilderGenerator.kt:271 */
  221    371   
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  222    372   
            self.build_enforcing_all_constraints()
  223    373   
        }
         374  +
        /* ServerBuilderGenerator.kt:283 */
  224    375   
        fn build_enforcing_all_constraints(
  225    376   
            self,
  226    377   
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  227         -
            Ok(crate::model::ValidationExceptionField {
  228         -
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
  229         -
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  230         -
            })
  231         -
        }
         378  +
            /* ServerBuilderGenerator.kt:287 */
         379  +
            Ok(
         380  +
                /* ServerBuilderGenerator.kt:542 */
         381  +
                crate::model::ValidationExceptionField {
         382  +
                    /* ServerBuilderGenerator.kt:546 */
         383  +
                    path: self
         384  +
                        .path
         385  +
                        /* ServerBuilderGenerator.kt:569 */
         386  +
                        .ok_or(ConstraintViolation::MissingPath)?,
         387  +
                    /* ServerBuilderGenerator.kt:546 */
         388  +
                    message: self
         389  +
                        .message
         390  +
                        /* ServerBuilderGenerator.kt:569 */
         391  +
                        .ok_or(ConstraintViolation::MissingMessage)?,
         392  +
                    /* ServerBuilderGenerator.kt:542 */
         393  +
                }, /* ServerBuilderGenerator.kt:287 */
         394  +
            )
         395  +
            /* ServerBuilderGenerator.kt:283 */
         396  +
        }
         397  +
        /* ServerBuilderGenerator.kt:215 */
  232    398   
    }
         399  +
         400  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  233    401   
}
  234         -
/// See [`CaptureEvent`](crate::model::CaptureEvent).
         402  +
/// /* ServerBuilderGenerator.kt:171 */See [`CaptureEvent`](crate::model::CaptureEvent).
  235    403   
pub mod capture_event {
  236    404   
         405  +
    /* ServerBuilderGenerator.kt:461 */
  237    406   
    impl ::std::convert::From<Builder> for crate::model::CaptureEvent {
  238    407   
        fn from(builder: Builder) -> Self {
  239    408   
            builder.build()
  240    409   
        }
  241    410   
    }
  242         -
    /// A builder for [`CaptureEvent`](crate::model::CaptureEvent).
         411  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`CaptureEvent`](crate::model::CaptureEvent).
         412  +
    /* RustType.kt:516 */
  243    413   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         414  +
    /* ServerBuilderGenerator.kt:211 */
  244    415   
    pub struct Builder {
         416  +
        /* ServerBuilderGenerator.kt:308 */
  245    417   
        pub(crate) name: ::std::option::Option<::std::string::String>,
  246         -
        pub(crate) captured: ::std::option::Option<bool>,
  247         -
        pub(crate) shiny: ::std::option::Option<bool>,
         418  +
        /* ServerBuilderGenerator.kt:308 */ pub(crate) captured: ::std::option::Option<bool>,
         419  +
        /* ServerBuilderGenerator.kt:308 */ pub(crate) shiny: ::std::option::Option<bool>,
         420  +
        /* ServerBuilderGenerator.kt:308 */
  248    421   
        pub(crate) pokedex_update: ::std::option::Option<::aws_smithy_types::Blob>,
         422  +
        /* ServerBuilderGenerator.kt:211 */
  249    423   
    }
         424  +
    /* ServerBuilderGenerator.kt:215 */
  250    425   
    impl Builder {
         426  +
        /* ServerBuilderGenerator.kt:331 */
  251    427   
        #[allow(missing_docs)] // documentation missing in model
         428  +
                               /* ServerBuilderGenerator.kt:343 */
  252    429   
        pub fn name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  253         -
            self.name = input;
         430  +
            /* ServerBuilderGenerator.kt:344 */
         431  +
            self.name =
         432  +
                /* ServerBuilderGenerator.kt:376 */input
         433  +
            /* ServerBuilderGenerator.kt:344 */;
  254    434   
            self
         435  +
            /* ServerBuilderGenerator.kt:343 */
  255    436   
        }
         437  +
        /* ServerBuilderGenerator.kt:331 */
  256    438   
        #[allow(missing_docs)] // documentation missing in model
         439  +
                               /* ServerBuilderGenerator.kt:343 */
  257    440   
        pub fn captured(mut self, input: ::std::option::Option<bool>) -> Self {
  258         -
            self.captured = input;
         441  +
            /* ServerBuilderGenerator.kt:344 */
         442  +
            self.captured =
         443  +
                /* ServerBuilderGenerator.kt:376 */input
         444  +
            /* ServerBuilderGenerator.kt:344 */;
  259    445   
            self
         446  +
            /* ServerBuilderGenerator.kt:343 */
  260    447   
        }
         448  +
        /* ServerBuilderGenerator.kt:331 */
  261    449   
        #[allow(missing_docs)] // documentation missing in model
         450  +
                               /* ServerBuilderGenerator.kt:343 */
  262    451   
        pub fn shiny(mut self, input: ::std::option::Option<bool>) -> Self {
  263         -
            self.shiny = input;
         452  +
            /* ServerBuilderGenerator.kt:344 */
         453  +
            self.shiny =
         454  +
                /* ServerBuilderGenerator.kt:376 */input
         455  +
            /* ServerBuilderGenerator.kt:344 */;
  264    456   
            self
         457  +
            /* ServerBuilderGenerator.kt:343 */
  265    458   
        }
         459  +
        /* ServerBuilderGenerator.kt:331 */
  266    460   
        #[allow(missing_docs)] // documentation missing in model
         461  +
                               /* ServerBuilderGenerator.kt:343 */
  267    462   
        pub fn pokedex_update(
  268    463   
            mut self,
  269    464   
            input: ::std::option::Option<::aws_smithy_types::Blob>,
  270    465   
        ) -> Self {
  271         -
            self.pokedex_update = input;
         466  +
            /* ServerBuilderGenerator.kt:344 */
         467  +
            self.pokedex_update =
         468  +
                /* ServerBuilderGenerator.kt:376 */input
         469  +
            /* ServerBuilderGenerator.kt:344 */;
  272    470   
            self
         471  +
            /* ServerBuilderGenerator.kt:343 */
  273    472   
        }
  274         -
        /// Consumes the builder and constructs a [`CaptureEvent`](crate::model::CaptureEvent).
         473  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`CaptureEvent`](crate::model::CaptureEvent).
         474  +
        /* ServerBuilderGenerator.kt:271 */
  275    475   
        pub fn build(self) -> crate::model::CaptureEvent {
  276    476   
            self.build_enforcing_all_constraints()
  277    477   
        }
         478  +
        /* ServerBuilderGenerator.kt:283 */
  278    479   
        fn build_enforcing_all_constraints(self) -> crate::model::CaptureEvent {
         480  +
            /* ServerBuilderGenerator.kt:542 */
  279    481   
            crate::model::CaptureEvent {
         482  +
                /* ServerBuilderGenerator.kt:546 */
  280    483   
                name: self.name,
         484  +
                /* ServerBuilderGenerator.kt:546 */
  281    485   
                captured: self.captured,
         486  +
                /* ServerBuilderGenerator.kt:546 */
  282    487   
                shiny: self.shiny,
         488  +
                /* ServerBuilderGenerator.kt:546 */
  283    489   
                pokedex_update: self.pokedex_update,
         490  +
                /* ServerBuilderGenerator.kt:542 */
  284    491   
            }
         492  +
            /* ServerBuilderGenerator.kt:283 */
  285    493   
        }
         494  +
        /* ServerBuilderGenerator.kt:215 */
  286    495   
    }
         496  +
         497  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  287    498   
}
  288         -
/// See [`CapturingEvent`](crate::model::CapturingEvent).
         499  +
/// /* ServerBuilderGenerator.kt:171 */See [`CapturingEvent`](crate::model::CapturingEvent).
  289    500   
pub mod capturing_event {
  290    501   
         502  +
    /* ServerBuilderGenerator.kt:461 */
  291    503   
    impl ::std::convert::From<Builder> for crate::model::CapturingEvent {
  292    504   
        fn from(builder: Builder) -> Self {
  293    505   
            builder.build()
  294    506   
        }
  295    507   
    }
  296         -
    /// A builder for [`CapturingEvent`](crate::model::CapturingEvent).
         508  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`CapturingEvent`](crate::model::CapturingEvent).
         509  +
    /* RustType.kt:516 */
  297    510   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         511  +
    /* ServerBuilderGenerator.kt:211 */
  298    512   
    pub struct Builder {
         513  +
        /* ServerBuilderGenerator.kt:308 */
  299    514   
        pub(crate) payload: ::std::option::Option<crate::model::CapturingPayload>,
         515  +
        /* ServerBuilderGenerator.kt:211 */
  300    516   
    }
         517  +
    /* ServerBuilderGenerator.kt:215 */
  301    518   
    impl Builder {
         519  +
        /* ServerBuilderGenerator.kt:331 */
  302    520   
        #[allow(missing_docs)] // documentation missing in model
         521  +
                               /* ServerBuilderGenerator.kt:343 */
  303    522   
        pub fn payload(
  304    523   
            mut self,
  305    524   
            input: ::std::option::Option<crate::model::CapturingPayload>,
  306    525   
        ) -> Self {
  307         -
            self.payload = input;
         526  +
            /* ServerBuilderGenerator.kt:344 */
         527  +
            self.payload =
         528  +
                /* ServerBuilderGenerator.kt:376 */input
         529  +
            /* ServerBuilderGenerator.kt:344 */;
  308    530   
            self
         531  +
            /* ServerBuilderGenerator.kt:343 */
  309    532   
        }
         533  +
        /* ServerBuilderGenerator.kt:426 */
  310    534   
        #[allow(missing_docs)] // documentation missing in model
         535  +
                               /* ServerBuilderGenerator.kt:428 */
  311    536   
        pub(crate) fn set_payload(
  312    537   
            mut self,
  313    538   
            input: Option<impl ::std::convert::Into<crate::model::CapturingPayload>>,
  314    539   
        ) -> Self {
         540  +
            /* ServerBuilderGenerator.kt:429 */
  315    541   
            self.payload = input.map(|v| v.into());
  316    542   
            self
         543  +
            /* ServerBuilderGenerator.kt:428 */
  317    544   
        }
  318         -
        /// Consumes the builder and constructs a [`CapturingEvent`](crate::model::CapturingEvent).
         545  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`CapturingEvent`](crate::model::CapturingEvent).
         546  +
        /* ServerBuilderGenerator.kt:271 */
  319    547   
        pub fn build(self) -> crate::model::CapturingEvent {
  320    548   
            self.build_enforcing_all_constraints()
  321    549   
        }
         550  +
        /* ServerBuilderGenerator.kt:283 */
  322    551   
        fn build_enforcing_all_constraints(self) -> crate::model::CapturingEvent {
         552  +
            /* ServerBuilderGenerator.kt:542 */
  323    553   
            crate::model::CapturingEvent {
         554  +
                /* ServerBuilderGenerator.kt:546 */
  324    555   
                payload: self.payload,
         556  +
                /* ServerBuilderGenerator.kt:542 */
  325    557   
            }
         558  +
            /* ServerBuilderGenerator.kt:283 */
  326    559   
        }
         560  +
        /* ServerBuilderGenerator.kt:215 */
  327    561   
    }
         562  +
         563  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  328    564   
}
  329         -
/// See [`CapturingPayload`](crate::model::CapturingPayload).
         565  +
/// /* ServerBuilderGenerator.kt:171 */See [`CapturingPayload`](crate::model::CapturingPayload).
  330    566   
pub mod capturing_payload {
  331    567   
         568  +
    /* ServerBuilderGenerator.kt:461 */
  332    569   
    impl ::std::convert::From<Builder> for crate::model::CapturingPayload {
  333    570   
        fn from(builder: Builder) -> Self {
  334    571   
            builder.build()
  335    572   
        }
  336    573   
    }
  337         -
    /// A builder for [`CapturingPayload`](crate::model::CapturingPayload).
         574  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`CapturingPayload`](crate::model::CapturingPayload).
         575  +
    /* RustType.kt:516 */
  338    576   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         577  +
    /* ServerBuilderGenerator.kt:211 */
  339    578   
    pub struct Builder {
         579  +
        /* ServerBuilderGenerator.kt:308 */
  340    580   
        pub(crate) name: ::std::option::Option<::std::string::String>,
         581  +
        /* ServerBuilderGenerator.kt:308 */
  341    582   
        pub(crate) pokeball: ::std::option::Option<::std::string::String>,
         583  +
        /* ServerBuilderGenerator.kt:211 */
  342    584   
    }
         585  +
    /* ServerBuilderGenerator.kt:215 */
  343    586   
    impl Builder {
         587  +
        /* ServerBuilderGenerator.kt:331 */
  344    588   
        #[allow(missing_docs)] // documentation missing in model
         589  +
                               /* ServerBuilderGenerator.kt:343 */
  345    590   
        pub fn name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  346         -
            self.name = input;
         591  +
            /* ServerBuilderGenerator.kt:344 */
         592  +
            self.name =
         593  +
                /* ServerBuilderGenerator.kt:376 */input
         594  +
            /* ServerBuilderGenerator.kt:344 */;
  347    595   
            self
         596  +
            /* ServerBuilderGenerator.kt:343 */
  348    597   
        }
         598  +
        /* ServerBuilderGenerator.kt:426 */
  349    599   
        #[allow(missing_docs)] // documentation missing in model
         600  +
                               /* ServerBuilderGenerator.kt:428 */
  350    601   
        pub(crate) fn set_name(
  351    602   
            mut self,
  352    603   
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  353    604   
        ) -> Self {
         605  +
            /* ServerBuilderGenerator.kt:429 */
  354    606   
            self.name = input.map(|v| v.into());
  355    607   
            self
         608  +
            /* ServerBuilderGenerator.kt:428 */
  356    609   
        }
         610  +
        /* ServerBuilderGenerator.kt:331 */
  357    611   
        #[allow(missing_docs)] // documentation missing in model
         612  +
                               /* ServerBuilderGenerator.kt:343 */
  358    613   
        pub fn pokeball(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
  359         -
            self.pokeball = input;
         614  +
            /* ServerBuilderGenerator.kt:344 */
         615  +
            self.pokeball =
         616  +
                /* ServerBuilderGenerator.kt:376 */input
         617  +
            /* ServerBuilderGenerator.kt:344 */;
  360    618   
            self
         619  +
            /* ServerBuilderGenerator.kt:343 */
  361    620   
        }
         621  +
        /* ServerBuilderGenerator.kt:426 */
  362    622   
        #[allow(missing_docs)] // documentation missing in model
         623  +
                               /* ServerBuilderGenerator.kt:428 */
  363    624   
        pub(crate) fn set_pokeball(
  364    625   
            mut self,
  365    626   
            input: Option<impl ::std::convert::Into<::std::string::String>>,
  366    627   
        ) -> Self {
         628  +
            /* ServerBuilderGenerator.kt:429 */
  367    629   
            self.pokeball = input.map(|v| v.into());
  368    630   
            self
         631  +
            /* ServerBuilderGenerator.kt:428 */
  369    632   
        }
  370         -
        /// Consumes the builder and constructs a [`CapturingPayload`](crate::model::CapturingPayload).
         633  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`CapturingPayload`](crate::model::CapturingPayload).
         634  +
        /* ServerBuilderGenerator.kt:271 */
  371    635   
        pub fn build(self) -> crate::model::CapturingPayload {
  372    636   
            self.build_enforcing_all_constraints()
  373    637   
        }
         638  +
        /* ServerBuilderGenerator.kt:283 */
  374    639   
        fn build_enforcing_all_constraints(self) -> crate::model::CapturingPayload {
         640  +
            /* ServerBuilderGenerator.kt:542 */
  375    641   
            crate::model::CapturingPayload {
         642  +
                /* ServerBuilderGenerator.kt:546 */
  376    643   
                name: self.name,
         644  +
                /* ServerBuilderGenerator.kt:546 */
  377    645   
                pokeball: self.pokeball,
         646  +
                /* ServerBuilderGenerator.kt:542 */
  378    647   
            }
         648  +
            /* ServerBuilderGenerator.kt:283 */
  379    649   
        }
         650  +
        /* ServerBuilderGenerator.kt:215 */
  380    651   
    }
         652  +
         653  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  381    654   
}

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

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
    2      3   
static CONTENT_TYPE_CHECKHEALTH: std::sync::LazyLock<::mime::Mime> =
    3      4   
    std::sync::LazyLock::new(|| {
    4      5   
        "application/x-amz-json-1.0"
    5      6   
            .parse::<::mime::Mime>()
    6      7   
            .expect("BUG: MIME parsing failed, content_type is not valid")
    7      8   
    });
    8      9   
::pin_project_lite::pin_project! {
    9     10   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
   10     11   
    /// [`CheckHealthInput`](crate::input::CheckHealthInput) using modelled bindings.
   11     12   
    pub struct CheckHealthInputFuture {
@@ -41,42 +122,125 @@
   61     62   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
   62     63   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   63     64   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
   64     65   
            },
   65     66   
        );
   66     67   
        CheckHealthInputFuture {
   67     68   
            inner: Box::pin(fut),
   68     69   
        }
   69     70   
    }
   70     71   
}
          72  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
   71     73   
impl
   72     74   
    ::aws_smithy_http_server::response::IntoResponse<
   73     75   
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
   74     76   
    > for crate::output::CheckHealthOutput
   75     77   
{
   76     78   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   77     79   
        match crate::protocol_serde::shape_check_health::ser_check_health_http_response(self) {
   78     80   
            Ok(response) => response,
   79     81   
            Err(e) => {
   80     82   
                ::tracing::error!(error = %e, "failed to serialize response");
   81     83   
                ::aws_smithy_http_server::response::IntoResponse::<
   82     84   
                    ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
   83     85   
                >::into_response(
   84     86   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
   85     87   
                        e,
   86     88   
                    ),
   87     89   
                )
   88     90   
            }
   89     91   
        }
   90     92   
    }
   91     93   
}
   92     94   
          95  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
   93     96   
static CONTENT_TYPE_CAPTUREPOKEMON: std::sync::LazyLock<::mime::Mime> =
   94     97   
    std::sync::LazyLock::new(|| {
   95     98   
        "application/x-amz-json-1.0"
   96     99   
            .parse::<::mime::Mime>()
   97    100   
            .expect("BUG: MIME parsing failed, content_type is not valid")
   98    101   
    });
   99    102   
::pin_project_lite::pin_project! {
  100    103   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  101    104   
    /// [`CapturePokemonInput`](crate::input::CapturePokemonInput) using modelled bindings.
  102    105   
    pub struct CapturePokemonInputFuture {
@@ -133,136 +241,247 @@
  153    156   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  154    157   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  155    158   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  156    159   
            },
  157    160   
        );
  158    161   
        CapturePokemonInputFuture {
  159    162   
            inner: Box::pin(fut),
  160    163   
        }
  161    164   
    }
  162    165   
}
         166  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  163    167   
impl
  164    168   
    ::aws_smithy_http_server::response::IntoResponse<
  165    169   
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
  166    170   
    > for crate::output::CapturePokemonOutput
  167    171   
{
  168    172   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  169    173   
        match crate::protocol_serde::shape_capture_pokemon::ser_capture_pokemon_http_response(self)
  170    174   
        {
  171    175   
            Ok(response) => response,
  172    176   
            Err(e) => {
  173    177   
                ::tracing::error!(error = %e, "failed to serialize response");
  174    178   
                ::aws_smithy_http_server::response::IntoResponse::<
  175    179   
                    ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
  176    180   
                >::into_response(
  177    181   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  178    182   
                        e,
  179    183   
                    ),
  180    184   
                )
  181    185   
            }
  182    186   
        }
  183    187   
    }
  184    188   
}
         189  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  185    190   
impl
  186    191   
    ::aws_smithy_http_server::response::IntoResponse<
  187    192   
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
  188    193   
    > for crate::error::CapturePokemonError
  189    194   
{
  190    195   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  191    196   
        match crate::protocol_serde::shape_capture_pokemon::ser_capture_pokemon_http_error(&self) {
  192    197   
            Ok(mut response) => {
  193    198   
                response.extensions_mut().insert(
  194    199   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  195    200   
                );
  196    201   
                response
  197    202   
            }
  198    203   
            Err(e) => {
  199    204   
                ::tracing::error!(error = %e, "failed to serialize response");
  200    205   
                ::aws_smithy_http_server::response::IntoResponse::<
  201    206   
                    ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
  202    207   
                >::into_response(
  203    208   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  204    209   
                        e,
  205    210   
                    ),
  206    211   
                )
  207    212   
            }
  208    213   
        }
  209    214   
    }
  210    215   
}
  211    216   
         217  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  212    218   
static CONTENT_TYPE_DONOTHING: std::sync::LazyLock<::mime::Mime> = std::sync::LazyLock::new(|| {
  213    219   
    "application/x-amz-json-1.0"
  214    220   
        .parse::<::mime::Mime>()
  215    221   
        .expect("BUG: MIME parsing failed, content_type is not valid")
  216    222   
});
  217    223   
::pin_project_lite::pin_project! {
  218    224   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  219    225   
    /// [`DoNothingInput`](crate::input::DoNothingInput) using modelled bindings.
  220    226   
    pub struct DoNothingInputFuture {
  221    227   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DoNothingInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
@@ -250,256 +331,339 @@
  270    276   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  271    277   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  272    278   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  273    279   
            },
  274    280   
        );
  275    281   
        DoNothingInputFuture {
  276    282   
            inner: Box::pin(fut),
  277    283   
        }
  278    284   
    }
  279    285   
}
         286  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  280    287   
impl
  281    288   
    ::aws_smithy_http_server::response::IntoResponse<
  282    289   
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
  283    290   
    > for crate::output::DoNothingOutput
  284    291   
{
  285    292   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  286    293   
        match crate::protocol_serde::shape_do_nothing::ser_do_nothing_http_response(self) {
  287    294   
            Ok(response) => response,
  288    295   
            Err(e) => {
  289    296   
                ::tracing::error!(error = %e, "failed to serialize response");
  290    297   
                ::aws_smithy_http_server::response::IntoResponse::<
  291    298   
                    ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
  292    299   
                >::into_response(
  293    300   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  294    301   
                        e,
  295    302   
                    ),
  296    303   
                )
  297    304   
            }
  298    305   
        }
  299    306   
    }
  300    307   
}
  301    308   
         309  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  302    310   
static CONTENT_TYPE_GETSERVERSTATISTICS: std::sync::LazyLock<::mime::Mime> =
  303    311   
    std::sync::LazyLock::new(|| {
  304    312   
        "application/x-amz-json-1.0"
  305    313   
            .parse::<::mime::Mime>()
  306    314   
            .expect("BUG: MIME parsing failed, content_type is not valid")
  307    315   
    });
  308    316   
::pin_project_lite::pin_project! {
  309    317   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  310    318   
    /// [`GetServerStatisticsInput`](crate::input::GetServerStatisticsInput) using modelled bindings.
  311    319   
    pub struct GetServerStatisticsInputFuture {
@@ -341,349 +385,394 @@
  361    369   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  362    370   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  363    371   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  364    372   
            },
  365    373   
        );
  366    374   
        GetServerStatisticsInputFuture {
  367    375   
            inner: Box::pin(fut),
  368    376   
        }
  369    377   
    }
  370    378   
}
         379  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  371    380   
impl
  372    381   
    ::aws_smithy_http_server::response::IntoResponse<
  373    382   
        ::aws_smithy_http_server::protocol::aws_json_10::AwsJson1_0,
  374    383   
    > for crate::output::GetServerStatisticsOutput
  375    384   
{
  376    385   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  377    386   
        match crate::protocol_serde::shape_get_server_statistics::ser_get_server_statistics_http_response(self) {
  378    387   
                        Ok(response) => response,
  379    388   
                        Err(e) => {
  380    389   
                            ::tracing::error!(error = %e, "failed to serialize response");

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

@@ -1,1 +0,152 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Health check operation, to check the service is up Not yet a deep check
           2  +
/* ServerOperationGenerator.kt:48 */
           3  +
/// /* ServerOperationGenerator.kt:48 */Health check operation, to check the service is up Not yet a deep check
           4  +
/* ServerOperationGenerator.kt:55 */
    4      5   
pub struct CheckHealth;
    5      6   
    6      7   
impl ::aws_smithy_http_server::operation::OperationShape for CheckHealth {
    7      8   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
    8      9   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
    9     10   
            "com.aws.example#CheckHealth",
   10     11   
            "com.aws.example",
   11     12   
            "CheckHealth",
   12     13   
        );
   13     14   
   14     15   
    type Input = crate::input::CheckHealthInput;
   15     16   
    type Output = crate::output::CheckHealthOutput;
   16     17   
    type Error = std::convert::Infallible;
   17     18   
}
   18     19   
   19     20   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for CheckHealth {
   20     21   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
   21     22   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   22     23   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
   23     24   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   24     25   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   25     26   
        >,
   26     27   
    >;
   27     28   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
   28     29   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   29     30   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   30     31   
    >;
   31     32   
   32     33   
    fn request_fmt() -> Self::RequestFmt {
   33     34   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   34     35   
    }
   35     36   
   36     37   
    fn response_fmt() -> Self::ResponseFmt {
   37     38   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   38     39   
    }
   39     40   
}
          41  +
/* ServerOperationGenerator.kt:88 */
   40     42   
   41         -
/// Capture Pokémons via event streams.
          43  +
/// /* ServerOperationGenerator.kt:48 */Capture Pokémons via event streams.
          44  +
/* ServerOperationGenerator.kt:55 */
   42     45   
pub struct CapturePokemon;
   43     46   
   44     47   
impl ::aws_smithy_http_server::operation::OperationShape for CapturePokemon {
   45     48   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   46     49   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
   47     50   
            "com.aws.example#CapturePokemon",
   48     51   
            "com.aws.example",
   49     52   
            "CapturePokemon",
   50     53   
        );
   51     54   
   52     55   
    type Input = crate::input::CapturePokemonInput;
   53     56   
    type Output = crate::output::CapturePokemonOutput;
   54     57   
    type Error = crate::error::CapturePokemonError;
   55     58   
}
   56     59   
   57     60   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for CapturePokemon {
   58     61   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   59     62   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   60     63   
   61     64   
    fn request_fmt() -> Self::RequestFmt {
   62     65   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   63     66   
    }
   64     67   
   65     68   
    fn response_fmt() -> Self::ResponseFmt {
   66     69   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   67     70   
    }
   68     71   
}
          72  +
/* ServerOperationGenerator.kt:88 */
   69     73   
   70         -
/// DoNothing operation, used to stress test the framework.
          74  +
/// /* ServerOperationGenerator.kt:48 */DoNothing operation, used to stress test the framework.
          75  +
/* ServerOperationGenerator.kt:55 */
   71     76   
pub struct DoNothing;
   72     77   
   73     78   
impl ::aws_smithy_http_server::operation::OperationShape for DoNothing {
   74     79   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   75     80   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
   76     81   
            "com.aws.example#DoNothing",
   77     82   
            "com.aws.example",
   78     83   
            "DoNothing",
   79     84   
        );
   80     85   
   81     86   
    type Input = crate::input::DoNothingInput;
   82     87   
    type Output = crate::output::DoNothingOutput;
   83     88   
    type Error = std::convert::Infallible;
   84     89   
}
   85     90   
   86     91   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for DoNothing {
   87     92   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
   88     93   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   89     94   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
   90     95   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   91     96   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   92     97   
        >,
   93     98   
    >;
   94     99   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
   95    100   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   96    101   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   97    102   
    >;
   98    103   
   99    104   
    fn request_fmt() -> Self::RequestFmt {
  100    105   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  101    106   
    }
  102    107   
  103    108   
    fn response_fmt() -> Self::ResponseFmt {
  104    109   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  105    110   
    }
  106    111   
}
         112  +
/* ServerOperationGenerator.kt:88 */
  107    113   
  108         -
/// Retrieve HTTP server statistiscs, such as calls count.
         114  +
/// /* ServerOperationGenerator.kt:48 */Retrieve HTTP server statistiscs, such as calls count.
         115  +
/* ServerOperationGenerator.kt:55 */
  109    116   
pub struct GetServerStatistics;
  110    117   
  111    118   
impl ::aws_smithy_http_server::operation::OperationShape for GetServerStatistics {
  112    119   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  113    120   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  114    121   
            "com.aws.example#GetServerStatistics",
  115    122   
            "com.aws.example",
  116    123   
            "GetServerStatistics",
  117    124   
        );
  118    125   
  119    126   
    type Input = crate::input::GetServerStatisticsInput;
  120    127   
    type Output = crate::output::GetServerStatisticsOutput;
  121    128   
    type Error = std::convert::Infallible;
  122    129   
}
  123    130   
  124    131   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for GetServerStatistics {
  125    132   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  126    133   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  127    134   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  128    135   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  129    136   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  130    137   
        >,
  131    138   
    >;
  132    139   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  133    140   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  134    141   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  135    142   
    >;
  136    143   
  137    144   
    fn request_fmt() -> Self::RequestFmt {
  138    145   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  139    146   
    }
  140    147   
  141    148   
    fn response_fmt() -> Self::ResponseFmt {
  142    149   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  143    150   
    }
  144    151   
}
         152  +
/* ServerOperationGenerator.kt:88 */

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

@@ -1,1 +235,378 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(
    4      6   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5      7   
)]
    6         -
pub struct CheckHealthOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct CheckHealthOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ServerCodegenVisitor.kt:345 */
    7     10   
impl CheckHealthOutput {
    8         -
    /// Creates a new builder-style object to manufacture [`CheckHealthOutput`](crate::output::CheckHealthOutput).
          11  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`CheckHealthOutput`](crate::output::CheckHealthOutput).
          12  +
    /* ServerBuilderGenerator.kt:295 */
    9     13   
    pub fn builder() -> crate::output::check_health_output::Builder {
          14  +
        /* ServerBuilderGenerator.kt:296 */
   10     15   
        crate::output::check_health_output::Builder::default()
          16  +
        /* ServerBuilderGenerator.kt:295 */
   11     17   
    }
          18  +
    /* ServerCodegenVisitor.kt:345 */
   12     19   
}
   13     20   
          21  +
/* StructureGenerator.kt:197 */
   14     22   
#[allow(missing_docs)] // documentation missing in model
          23  +
/* RustType.kt:516 */
   15     24   
#[derive(::std::fmt::Debug)]
   16         -
pub struct CapturePokemonOutput {
          25  +
pub /* StructureGenerator.kt:201 */ struct CapturePokemonOutput {
          26  +
    /* StructureGenerator.kt:231 */
   17     27   
    #[allow(missing_docs)] // documentation missing in model
   18     28   
    pub events: ::aws_smithy_http::event_stream::EventStreamSender<
   19     29   
        crate::model::CapturePokemonEvents,
   20     30   
        crate::error::CapturePokemonEventsError,
   21     31   
    >,
          32  +
    /* StructureGenerator.kt:201 */
   22     33   
}
          34  +
/* StructureGenerator.kt:135 */
   23     35   
impl CapturePokemonOutput {
          36  +
    /* StructureGenerator.kt:231 */
   24     37   
    #[allow(missing_docs)] // documentation missing in model
          38  +
                           /* StructureGenerator.kt:166 */
   25     39   
    pub fn events(
   26     40   
        &self,
   27     41   
    ) -> &::aws_smithy_http::event_stream::EventStreamSender<
   28     42   
        crate::model::CapturePokemonEvents,
   29     43   
        crate::error::CapturePokemonEventsError,
   30     44   
    > {
          45  +
        /* StructureGenerator.kt:172 */
   31     46   
        &self.events
          47  +
        /* StructureGenerator.kt:166 */
   32     48   
    }
          49  +
    /* StructureGenerator.kt:135 */
   33     50   
}
          51  +
/* ServerCodegenVisitor.kt:345 */
   34     52   
impl CapturePokemonOutput {
   35         -
    /// Creates a new builder-style object to manufacture [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
          53  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
          54  +
    /* ServerBuilderGenerator.kt:295 */
   36     55   
    pub fn builder() -> crate::output::capture_pokemon_output::Builder {
          56  +
        /* ServerBuilderGenerator.kt:296 */
   37     57   
        crate::output::capture_pokemon_output::Builder::default()
          58  +
        /* ServerBuilderGenerator.kt:295 */
   38     59   
    }
          60  +
    /* ServerCodegenVisitor.kt:345 */
   39     61   
}
   40     62   
          63  +
/* StructureGenerator.kt:197 */
   41     64   
#[allow(missing_docs)] // documentation missing in model
          65  +
/* RustType.kt:516 */
   42     66   
#[derive(
   43     67   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   44     68   
)]
   45         -
pub struct DoNothingOutput {}
          69  +
pub /* StructureGenerator.kt:201 */ struct DoNothingOutput {/* StructureGenerator.kt:201 */}
          70  +
/* ServerCodegenVisitor.kt:345 */
   46     71   
impl DoNothingOutput {
   47         -
    /// Creates a new builder-style object to manufacture [`DoNothingOutput`](crate::output::DoNothingOutput).
          72  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`DoNothingOutput`](crate::output::DoNothingOutput).
          73  +
    /* ServerBuilderGenerator.kt:295 */
   48     74   
    pub fn builder() -> crate::output::do_nothing_output::Builder {
          75  +
        /* ServerBuilderGenerator.kt:296 */
   49     76   
        crate::output::do_nothing_output::Builder::default()
          77  +
        /* ServerBuilderGenerator.kt:295 */
   50     78   
    }
          79  +
    /* ServerCodegenVisitor.kt:345 */
   51     80   
}
   52     81   
          82  +
/* StructureGenerator.kt:197 */
   53     83   
#[allow(missing_docs)] // documentation missing in model
          84  +
/* RustType.kt:516 */
   54     85   
#[derive(
   55     86   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   56     87   
)]
   57         -
pub struct GetServerStatisticsOutput {
   58         -
    /// The number of calls executed by the server.
          88  +
pub /* StructureGenerator.kt:201 */ struct GetServerStatisticsOutput {
          89  +
    /// /* StructureGenerator.kt:231 */The number of calls executed by the server.
   59     90   
    pub calls_count: i64,
          91  +
    /* StructureGenerator.kt:201 */
   60     92   
}
          93  +
/* StructureGenerator.kt:135 */
   61     94   
impl GetServerStatisticsOutput {
   62         -
    /// The number of calls executed by the server.
          95  +
    /// /* StructureGenerator.kt:231 */The number of calls executed by the server.
          96  +
    /* StructureGenerator.kt:166 */
   63     97   
    pub fn calls_count(&self) -> i64 {
          98  +
        /* StructureGenerator.kt:168 */
   64     99   
        self.calls_count
         100  +
        /* StructureGenerator.kt:166 */
   65    101   
    }
         102  +
    /* StructureGenerator.kt:135 */
   66    103   
}
         104  +
/* ServerCodegenVisitor.kt:345 */
   67    105   
impl GetServerStatisticsOutput {
   68         -
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         106  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         107  +
    /* ServerBuilderGenerator.kt:295 */
   69    108   
    pub fn builder() -> crate::output::get_server_statistics_output::Builder {
         109  +
        /* ServerBuilderGenerator.kt:296 */
   70    110   
        crate::output::get_server_statistics_output::Builder::default()
         111  +
        /* ServerBuilderGenerator.kt:295 */
   71    112   
    }
         113  +
    /* ServerCodegenVisitor.kt:345 */
   72    114   
}
   73         -
/// See [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         115  +
/// /* ServerBuilderGenerator.kt:171 */See [`CheckHealthOutput`](crate::output::CheckHealthOutput).
   74    116   
pub mod check_health_output {
   75    117   
         118  +
    /* ServerBuilderGenerator.kt:461 */
   76    119   
    impl ::std::convert::From<Builder> for crate::output::CheckHealthOutput {
   77    120   
        fn from(builder: Builder) -> Self {
   78    121   
            builder.build()
   79    122   
        }
   80    123   
    }
   81         -
    /// A builder for [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         124  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         125  +
    /* RustType.kt:516 */
   82    126   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
   83         -
    pub struct Builder {}
         127  +
    /* ServerBuilderGenerator.kt:211 */
         128  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         129  +
    /* ServerBuilderGenerator.kt:215 */
   84    130   
    impl Builder {
   85         -
        /// Consumes the builder and constructs a [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         131  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`CheckHealthOutput`](crate::output::CheckHealthOutput).
         132  +
        /* ServerBuilderGenerator.kt:271 */
   86    133   
        pub fn build(self) -> crate::output::CheckHealthOutput {
   87    134   
            self.build_enforcing_all_constraints()
   88    135   
        }
         136  +
        /* ServerBuilderGenerator.kt:283 */
   89    137   
        fn build_enforcing_all_constraints(self) -> crate::output::CheckHealthOutput {
   90         -
            crate::output::CheckHealthOutput {}
         138  +
            /* ServerBuilderGenerator.kt:542 */
         139  +
            crate::output::CheckHealthOutput {
         140  +
            /* ServerBuilderGenerator.kt:542 */}
         141  +
            /* ServerBuilderGenerator.kt:283 */
   91    142   
        }
         143  +
        /* ServerBuilderGenerator.kt:215 */
   92    144   
    }
         145  +
         146  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
   93    147   
}
   94         -
/// See [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
         148  +
/// /* ServerBuilderGenerator.kt:171 */See [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
   95    149   
pub mod capture_pokemon_output {
   96    150   
         151  +
    /* RustType.kt:516 */
   97    152   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
   98         -
    /// Holds one variant for each of the ways the builder can fail.
         153  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         154  +
    /* RustType.kt:516 */
   99    155   
    #[non_exhaustive]
         156  +
    /* ServerBuilderConstraintViolations.kt:75 */
  100    157   
    #[allow(clippy::enum_variant_names)]
  101    158   
    pub enum ConstraintViolation {
  102         -
        /// `events` was not provided but it is required when building `CapturePokemonOutput`.
         159  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`events` was not provided but it is required when building `CapturePokemonOutput`.
         160  +
        /* ServerBuilderConstraintViolations.kt:143 */
  103    161   
        MissingEvents,
         162  +
        /* ServerBuilderConstraintViolations.kt:75 */
  104    163   
    }
         164  +
    /* ServerBuilderConstraintViolations.kt:117 */
  105    165   
    impl ::std::fmt::Display for ConstraintViolation {
         166  +
        /* ServerBuilderConstraintViolations.kt:118 */
  106    167   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         168  +
            /* ServerBuilderConstraintViolations.kt:119 */
  107    169   
            match self {
  108         -
                ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `CapturePokemonOutput`"),
  109         -
            }
         170  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `CapturePokemonOutput`"),
         171  +
            /* ServerBuilderConstraintViolations.kt:119 */}
         172  +
            /* ServerBuilderConstraintViolations.kt:118 */
  110    173   
        }
         174  +
        /* ServerBuilderConstraintViolations.kt:117 */
  111    175   
    }
         176  +
    /* ServerBuilderConstraintViolations.kt:84 */
  112    177   
    impl ::std::error::Error for ConstraintViolation {}
         178  +
    /* ServerBuilderGenerator.kt:446 */
  113    179   
    impl ::std::convert::TryFrom<Builder> for crate::output::CapturePokemonOutput {
  114    180   
        type Error = ConstraintViolation;
  115    181   
  116    182   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  117    183   
            builder.build()
  118    184   
        }
  119    185   
    }
  120         -
    /// A builder for [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
         186  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
         187  +
    /* RustType.kt:516 */
  121    188   
    #[derive(::std::default::Default, ::std::fmt::Debug)]
         189  +
    /* ServerBuilderGenerator.kt:211 */
  122    190   
    pub struct Builder {
         191  +
        /* ServerBuilderGenerator.kt:308 */
  123    192   
        pub(crate) events: ::std::option::Option<
  124    193   
            ::aws_smithy_http::event_stream::EventStreamSender<
  125    194   
                crate::model::CapturePokemonEvents,
  126    195   
                crate::error::CapturePokemonEventsError,
  127    196   
            >,
  128    197   
        >,
         198  +
        /* ServerBuilderGenerator.kt:211 */
  129    199   
    }
         200  +
    /* ServerBuilderGenerator.kt:215 */
  130    201   
    impl Builder {
         202  +
        /* ServerBuilderGenerator.kt:331 */
  131    203   
        #[allow(missing_docs)] // documentation missing in model
         204  +
                               /* ServerBuilderGenerator.kt:343 */
  132    205   
        pub fn events(
  133    206   
            mut self,
  134    207   
            input: ::aws_smithy_http::event_stream::EventStreamSender<
  135    208   
                crate::model::CapturePokemonEvents,
  136    209   
                crate::error::CapturePokemonEventsError,
  137    210   
            >,
  138    211   
        ) -> Self {
  139         -
            self.events = Some(input);
         212  +
            /* ServerBuilderGenerator.kt:344 */
         213  +
            self.events =
         214  +
                /* ServerBuilderGenerator.kt:345 */Some(
         215  +
                    /* ServerBuilderGenerator.kt:376 */input
         216  +
                /* ServerBuilderGenerator.kt:345 */)
         217  +
            /* ServerBuilderGenerator.kt:344 */;
  140    218   
            self
         219  +
            /* ServerBuilderGenerator.kt:343 */
  141    220   
        }
  142         -
        /// Consumes the builder and constructs a [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
  143         -
        ///
         221  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
         222  +
        /// /* ServerBuilderGenerator.kt:260 */
  144    223   
        /// The builder fails to construct a [`CapturePokemonOutput`](crate::output::CapturePokemonOutput) if a [`ConstraintViolation`] occurs.
  145    224   
        ///
         225  +
        /* ServerBuilderGenerator.kt:271 */
  146    226   
        pub fn build(self) -> Result<crate::output::CapturePokemonOutput, ConstraintViolation> {
  147    227   
            self.build_enforcing_all_constraints()
  148    228   
        }
         229  +
        /* ServerBuilderGenerator.kt:283 */
  149    230   
        fn build_enforcing_all_constraints(
  150    231   
            self,
  151    232   
        ) -> Result<crate::output::CapturePokemonOutput, ConstraintViolation> {
  152         -
            Ok(crate::output::CapturePokemonOutput {
  153         -
                events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
  154         -
            })
  155         -
        }
         233  +
            /* ServerBuilderGenerator.kt:287 */
         234  +
            Ok(
         235  +
                /* ServerBuilderGenerator.kt:542 */
         236  +
                crate::output::CapturePokemonOutput {
         237  +
                    /* ServerBuilderGenerator.kt:546 */
         238  +
                    events: self
         239  +
                        .events
         240  +
                        /* ServerBuilderGenerator.kt:569 */
         241  +
                        .ok_or(ConstraintViolation::MissingEvents)?,
         242  +
                    /* ServerBuilderGenerator.kt:542 */
         243  +
                }, /* ServerBuilderGenerator.kt:287 */
         244  +
            )
         245  +
            /* ServerBuilderGenerator.kt:283 */
         246  +
        }
         247  +
        /* ServerBuilderGenerator.kt:215 */
  156    248   
    }
         249  +
         250  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  157    251   
}
  158         -
/// See [`DoNothingOutput`](crate::output::DoNothingOutput).
         252  +
/// /* ServerBuilderGenerator.kt:171 */See [`DoNothingOutput`](crate::output::DoNothingOutput).
  159    253   
pub mod do_nothing_output {
  160    254   
         255  +
    /* ServerBuilderGenerator.kt:461 */
  161    256   
    impl ::std::convert::From<Builder> for crate::output::DoNothingOutput {
  162    257   
        fn from(builder: Builder) -> Self {
  163    258   
            builder.build()
  164    259   
        }
  165    260   
    }
  166         -
    /// A builder for [`DoNothingOutput`](crate::output::DoNothingOutput).
         261  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`DoNothingOutput`](crate::output::DoNothingOutput).
         262  +
    /* RustType.kt:516 */
  167    263   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  168         -
    pub struct Builder {}
         264  +
    /* ServerBuilderGenerator.kt:211 */
         265  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         266  +
    /* ServerBuilderGenerator.kt:215 */
  169    267   
    impl Builder {
  170         -
        /// Consumes the builder and constructs a [`DoNothingOutput`](crate::output::DoNothingOutput).
         268  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`DoNothingOutput`](crate::output::DoNothingOutput).
         269  +
        /* ServerBuilderGenerator.kt:271 */
  171    270   
        pub fn build(self) -> crate::output::DoNothingOutput {
  172    271   
            self.build_enforcing_all_constraints()
  173    272   
        }
         273  +
        /* ServerBuilderGenerator.kt:283 */
  174    274   
        fn build_enforcing_all_constraints(self) -> crate::output::DoNothingOutput {
  175         -
            crate::output::DoNothingOutput {}
         275  +
            /* ServerBuilderGenerator.kt:542 */
         276  +
            crate::output::DoNothingOutput {
         277  +
            /* ServerBuilderGenerator.kt:542 */}
         278  +
            /* ServerBuilderGenerator.kt:283 */
  176    279   
        }
         280  +
        /* ServerBuilderGenerator.kt:215 */
  177    281   
    }
         282  +
         283  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  178    284   
}
  179         -
/// See [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         285  +
/// /* ServerBuilderGenerator.kt:171 */See [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
  180    286   
pub mod get_server_statistics_output {
  181    287   
         288  +
    /* RustType.kt:516 */
  182    289   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  183         -
    /// Holds one variant for each of the ways the builder can fail.
         290  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         291  +
    /* RustType.kt:516 */
  184    292   
    #[non_exhaustive]
         293  +
    /* ServerBuilderConstraintViolations.kt:75 */
  185    294   
    #[allow(clippy::enum_variant_names)]
  186    295   
    pub enum ConstraintViolation {
  187         -
        /// `calls_count` was not provided but it is required when building `GetServerStatisticsOutput`.
         296  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`calls_count` was not provided but it is required when building `GetServerStatisticsOutput`.
         297  +
        /* ServerBuilderConstraintViolations.kt:143 */
  188    298   
        MissingCallsCount,
         299  +
        /* ServerBuilderConstraintViolations.kt:75 */
  189    300   
    }
         301  +
    /* ServerBuilderConstraintViolations.kt:117 */
  190    302   
    impl ::std::fmt::Display for ConstraintViolation {
         303  +
        /* ServerBuilderConstraintViolations.kt:118 */
  191    304   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         305  +
            /* ServerBuilderConstraintViolations.kt:119 */
  192    306   
            match self {
  193         -
                ConstraintViolation::MissingCallsCount => write!(f, "`calls_count` was not provided but it is required when building `GetServerStatisticsOutput`"),
  194         -
            }
         307  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingCallsCount => write!(f, "`calls_count` was not provided but it is required when building `GetServerStatisticsOutput`"),
         308  +
            /* ServerBuilderConstraintViolations.kt:119 */}
         309  +
            /* ServerBuilderConstraintViolations.kt:118 */
  195    310   
        }
         311  +
        /* ServerBuilderConstraintViolations.kt:117 */
  196    312   
    }
         313  +
    /* ServerBuilderConstraintViolations.kt:84 */
  197    314   
    impl ::std::error::Error for ConstraintViolation {}
         315  +
    /* ServerBuilderGenerator.kt:446 */
  198    316   
    impl ::std::convert::TryFrom<Builder> for crate::output::GetServerStatisticsOutput {
  199    317   
        type Error = ConstraintViolation;
  200    318   
  201    319   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  202    320   
            builder.build()
  203    321   
        }
  204    322   
    }
  205         -
    /// A builder for [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         323  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         324  +
    /* RustType.kt:516 */
  206    325   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         326  +
    /* ServerBuilderGenerator.kt:211 */
  207    327   
    pub struct Builder {
         328  +
        /* ServerBuilderGenerator.kt:308 */
  208    329   
        pub(crate) calls_count: ::std::option::Option<i64>,
         330  +
        /* ServerBuilderGenerator.kt:211 */
  209    331   
    }
         332  +
    /* ServerBuilderGenerator.kt:215 */
  210    333   
    impl Builder {
  211         -
        /// The number of calls executed by the server.
         334  +
        /// /* ServerBuilderGenerator.kt:331 */The number of calls executed by the server.
         335  +
        /* ServerBuilderGenerator.kt:343 */
  212    336   
        pub fn calls_count(mut self, input: i64) -> Self {
  213         -
            self.calls_count = Some(input);
         337  +
            /* ServerBuilderGenerator.kt:344 */
         338  +
            self.calls_count =
         339  +
                /* ServerBuilderGenerator.kt:345 */Some(
         340  +
                    /* ServerBuilderGenerator.kt:376 */input
         341  +
                /* ServerBuilderGenerator.kt:345 */)
         342  +
            /* ServerBuilderGenerator.kt:344 */;
  214    343   
            self
         344  +
            /* ServerBuilderGenerator.kt:343 */
  215    345   
        }
  216         -
        /// Consumes the builder and constructs a [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
  217         -
        ///
         346  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         347  +
        /// /* ServerBuilderGenerator.kt:260 */
  218    348   
        /// The builder fails to construct a [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput) if a [`ConstraintViolation`] occurs.
  219    349   
        ///
         350  +
        /* ServerBuilderGenerator.kt:271 */
  220    351   
        pub fn build(
  221    352   
            self,
  222    353   
        ) -> Result<crate::output::GetServerStatisticsOutput, ConstraintViolation> {
  223    354   
            self.build_enforcing_all_constraints()
  224    355   
        }
         356  +
        /* ServerBuilderGenerator.kt:283 */
  225    357   
        fn build_enforcing_all_constraints(
  226    358   
            self,
  227    359   
        ) -> Result<crate::output::GetServerStatisticsOutput, ConstraintViolation> {
  228         -
            Ok(crate::output::GetServerStatisticsOutput {
         360  +
            /* ServerBuilderGenerator.kt:287 */
         361  +
            Ok(
         362  +
                /* ServerBuilderGenerator.kt:542 */
         363  +
                crate::output::GetServerStatisticsOutput {
         364  +
                    /* ServerBuilderGenerator.kt:546 */
  229    365   
                    calls_count: self
  230    366   
                        .calls_count
         367  +
                        /* ServerBuilderGenerator.kt:569 */
  231    368   
                        .ok_or(ConstraintViolation::MissingCallsCount)?,
  232         -
            })
         369  +
                    /* ServerBuilderGenerator.kt:542 */
         370  +
                }, /* ServerBuilderGenerator.kt:287 */
         371  +
            )
         372  +
            /* ServerBuilderGenerator.kt:283 */
  233    373   
        }
         374  +
        /* ServerBuilderGenerator.kt:215 */
  234    375   
    }
         376  +
         377  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  235    378   
}