Server Test

Server Test

rev. 3c756f73b1f83a0eed4275d9d1e22df0b10b66fb (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,235 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[derive(
           4  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
           5  +
)]
           6  +
pub struct CheckHealthOutput {}
           7  +
impl CheckHealthOutput {
           8  +
    /// Creates a new builder-style object to manufacture [`CheckHealthOutput`](crate::output::CheckHealthOutput).
           9  +
    pub fn builder() -> crate::output::check_health_output::Builder {
          10  +
        crate::output::check_health_output::Builder::default()
          11  +
    }
          12  +
}
          13  +
          14  +
#[allow(missing_docs)] // documentation missing in model
          15  +
#[derive(::std::fmt::Debug)]
          16  +
pub struct CapturePokemonOutput {
          17  +
    #[allow(missing_docs)] // documentation missing in model
          18  +
    pub events: ::aws_smithy_legacy_http::event_stream::EventStreamSender<
          19  +
        crate::model::CapturePokemonEvents,
          20  +
        crate::error::CapturePokemonEventsError,
          21  +
    >,
          22  +
}
          23  +
impl CapturePokemonOutput {
          24  +
    #[allow(missing_docs)] // documentation missing in model
          25  +
    pub fn events(
          26  +
        &self,
          27  +
    ) -> &::aws_smithy_legacy_http::event_stream::EventStreamSender<
          28  +
        crate::model::CapturePokemonEvents,
          29  +
        crate::error::CapturePokemonEventsError,
          30  +
    > {
          31  +
        &self.events
          32  +
    }
          33  +
}
          34  +
impl CapturePokemonOutput {
          35  +
    /// Creates a new builder-style object to manufacture [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
          36  +
    pub fn builder() -> crate::output::capture_pokemon_output::Builder {
          37  +
        crate::output::capture_pokemon_output::Builder::default()
          38  +
    }
          39  +
}
          40  +
          41  +
#[allow(missing_docs)] // documentation missing in model
          42  +
#[derive(
          43  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          44  +
)]
          45  +
pub struct DoNothingOutput {}
          46  +
impl DoNothingOutput {
          47  +
    /// Creates a new builder-style object to manufacture [`DoNothingOutput`](crate::output::DoNothingOutput).
          48  +
    pub fn builder() -> crate::output::do_nothing_output::Builder {
          49  +
        crate::output::do_nothing_output::Builder::default()
          50  +
    }
          51  +
}
          52  +
          53  +
#[allow(missing_docs)] // documentation missing in model
          54  +
#[derive(
          55  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          56  +
)]
          57  +
pub struct GetServerStatisticsOutput {
          58  +
    /// The number of calls executed by the server.
          59  +
    pub calls_count: i64,
          60  +
}
          61  +
impl GetServerStatisticsOutput {
          62  +
    /// The number of calls executed by the server.
          63  +
    pub fn calls_count(&self) -> i64 {
          64  +
        self.calls_count
          65  +
    }
          66  +
}
          67  +
impl GetServerStatisticsOutput {
          68  +
    /// Creates a new builder-style object to manufacture [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
          69  +
    pub fn builder() -> crate::output::get_server_statistics_output::Builder {
          70  +
        crate::output::get_server_statistics_output::Builder::default()
          71  +
    }
          72  +
}
          73  +
/// See [`CheckHealthOutput`](crate::output::CheckHealthOutput).
          74  +
pub mod check_health_output {
          75  +
          76  +
    impl ::std::convert::From<Builder> for crate::output::CheckHealthOutput {
          77  +
        fn from(builder: Builder) -> Self {
          78  +
            builder.build()
          79  +
        }
          80  +
    }
          81  +
    /// A builder for [`CheckHealthOutput`](crate::output::CheckHealthOutput).
          82  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
          83  +
    pub struct Builder {}
          84  +
    impl Builder {
          85  +
        /// Consumes the builder and constructs a [`CheckHealthOutput`](crate::output::CheckHealthOutput).
          86  +
        pub fn build(self) -> crate::output::CheckHealthOutput {
          87  +
            self.build_enforcing_all_constraints()
          88  +
        }
          89  +
        fn build_enforcing_all_constraints(self) -> crate::output::CheckHealthOutput {
          90  +
            crate::output::CheckHealthOutput {}
          91  +
        }
          92  +
    }
          93  +
}
          94  +
/// See [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
          95  +
pub mod capture_pokemon_output {
          96  +
          97  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
          98  +
    /// Holds one variant for each of the ways the builder can fail.
          99  +
    #[non_exhaustive]
         100  +
    #[allow(clippy::enum_variant_names)]
         101  +
    pub enum ConstraintViolation {
         102  +
        /// `events` was not provided but it is required when building `CapturePokemonOutput`.
         103  +
        MissingEvents,
         104  +
    }
         105  +
    impl ::std::fmt::Display for ConstraintViolation {
         106  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         107  +
            match self {
         108  +
                ConstraintViolation::MissingEvents => write!(f, "`events` was not provided but it is required when building `CapturePokemonOutput`"),
         109  +
            }
         110  +
        }
         111  +
    }
         112  +
    impl ::std::error::Error for ConstraintViolation {}
         113  +
    impl ::std::convert::TryFrom<Builder> for crate::output::CapturePokemonOutput {
         114  +
        type Error = ConstraintViolation;
         115  +
         116  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         117  +
            builder.build()
         118  +
        }
         119  +
    }
         120  +
    /// A builder for [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
         121  +
    #[derive(::std::default::Default, ::std::fmt::Debug)]
         122  +
    pub struct Builder {
         123  +
        pub(crate) events: ::std::option::Option<
         124  +
            ::aws_smithy_legacy_http::event_stream::EventStreamSender<
         125  +
                crate::model::CapturePokemonEvents,
         126  +
                crate::error::CapturePokemonEventsError,
         127  +
            >,
         128  +
        >,
         129  +
    }
         130  +
    impl Builder {
         131  +
        #[allow(missing_docs)] // documentation missing in model
         132  +
        pub fn events(
         133  +
            mut self,
         134  +
            input: ::aws_smithy_legacy_http::event_stream::EventStreamSender<
         135  +
                crate::model::CapturePokemonEvents,
         136  +
                crate::error::CapturePokemonEventsError,
         137  +
            >,
         138  +
        ) -> Self {
         139  +
            self.events = Some(input);
         140  +
            self
         141  +
        }
         142  +
        /// Consumes the builder and constructs a [`CapturePokemonOutput`](crate::output::CapturePokemonOutput).
         143  +
        ///
         144  +
        /// The builder fails to construct a [`CapturePokemonOutput`](crate::output::CapturePokemonOutput) if a [`ConstraintViolation`] occurs.
         145  +
        ///
         146  +
        pub fn build(self) -> Result<crate::output::CapturePokemonOutput, ConstraintViolation> {
         147  +
            self.build_enforcing_all_constraints()
         148  +
        }
         149  +
        fn build_enforcing_all_constraints(
         150  +
            self,
         151  +
        ) -> Result<crate::output::CapturePokemonOutput, ConstraintViolation> {
         152  +
            Ok(crate::output::CapturePokemonOutput {
         153  +
                events: self.events.ok_or(ConstraintViolation::MissingEvents)?,
         154  +
            })
         155  +
        }
         156  +
    }
         157  +
}
         158  +
/// See [`DoNothingOutput`](crate::output::DoNothingOutput).
         159  +
pub mod do_nothing_output {
         160  +
         161  +
    impl ::std::convert::From<Builder> for crate::output::DoNothingOutput {
         162  +
        fn from(builder: Builder) -> Self {
         163  +
            builder.build()
         164  +
        }
         165  +
    }
         166  +
    /// A builder for [`DoNothingOutput`](crate::output::DoNothingOutput).
         167  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         168  +
    pub struct Builder {}
         169  +
    impl Builder {
         170  +
        /// Consumes the builder and constructs a [`DoNothingOutput`](crate::output::DoNothingOutput).
         171  +
        pub fn build(self) -> crate::output::DoNothingOutput {
         172  +
            self.build_enforcing_all_constraints()
         173  +
        }
         174  +
        fn build_enforcing_all_constraints(self) -> crate::output::DoNothingOutput {
         175  +
            crate::output::DoNothingOutput {}
         176  +
        }
         177  +
    }
         178  +
}
         179  +
/// See [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         180  +
pub mod get_server_statistics_output {
         181  +
         182  +
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
         183  +
    /// Holds one variant for each of the ways the builder can fail.
         184  +
    #[non_exhaustive]
         185  +
    #[allow(clippy::enum_variant_names)]
         186  +
    pub enum ConstraintViolation {
         187  +
        /// `calls_count` was not provided but it is required when building `GetServerStatisticsOutput`.
         188  +
        MissingCallsCount,
         189  +
    }
         190  +
    impl ::std::fmt::Display for ConstraintViolation {
         191  +
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         192  +
            match self {
         193  +
                ConstraintViolation::MissingCallsCount => write!(f, "`calls_count` was not provided but it is required when building `GetServerStatisticsOutput`"),
         194  +
            }
         195  +
        }
         196  +
    }
         197  +
    impl ::std::error::Error for ConstraintViolation {}
         198  +
    impl ::std::convert::TryFrom<Builder> for crate::output::GetServerStatisticsOutput {
         199  +
        type Error = ConstraintViolation;
         200  +
         201  +
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
         202  +
            builder.build()
         203  +
        }
         204  +
    }
         205  +
    /// A builder for [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         206  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         207  +
    pub struct Builder {
         208  +
        pub(crate) calls_count: ::std::option::Option<i64>,
         209  +
    }
         210  +
    impl Builder {
         211  +
        /// The number of calls executed by the server.
         212  +
        pub fn calls_count(mut self, input: i64) -> Self {
         213  +
            self.calls_count = Some(input);
         214  +
            self
         215  +
        }
         216  +
        /// Consumes the builder and constructs a [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput).
         217  +
        ///
         218  +
        /// The builder fails to construct a [`GetServerStatisticsOutput`](crate::output::GetServerStatisticsOutput) if a [`ConstraintViolation`] occurs.
         219  +
        ///
         220  +
        pub fn build(
         221  +
            self,
         222  +
        ) -> Result<crate::output::GetServerStatisticsOutput, ConstraintViolation> {
         223  +
            self.build_enforcing_all_constraints()
         224  +
        }
         225  +
        fn build_enforcing_all_constraints(
         226  +
            self,
         227  +
        ) -> Result<crate::output::GetServerStatisticsOutput, ConstraintViolation> {
         228  +
            Ok(crate::output::GetServerStatisticsOutput {
         229  +
                calls_count: self
         230  +
                    .calls_count
         231  +
                    .ok_or(ConstraintViolation::MissingCallsCount)?,
         232  +
            })
         233  +
        }
         234  +
    }
         235  +
}

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

@@ -0,1 +0,36 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) mod shape_capture_pokemon;
           3  +
           4  +
pub(crate) mod shape_check_health;
           5  +
           6  +
pub(crate) mod shape_do_nothing;
           7  +
           8  +
pub(crate) mod shape_get_server_statistics;
           9  +
          10  +
pub(crate) mod shape_capture_pokemon_input;
          11  +
          12  +
pub(crate) mod shape_do_nothing_output;
          13  +
          14  +
pub(crate) mod shape_get_server_statistics_output;
          15  +
          16  +
pub(crate) mod shape_invalid_pokeball_error;
          17  +
          18  +
pub(crate) mod shape_master_ball_unsuccessful;
          19  +
          20  +
pub(crate) mod shape_throttling_error;
          21  +
          22  +
pub(crate) mod shape_unsupported_region_error;
          23  +
          24  +
pub(crate) mod shape_validation_exception;
          25  +
          26  +
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
          27  +
    if data.is_empty() {
          28  +
        b"{}"
          29  +
    } else {
          30  +
        data
          31  +
    }
          32  +
}
          33  +
          34  +
pub(crate) mod shape_capturing_payload;
          35  +
          36  +
pub(crate) mod shape_validation_exception_field;

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_capture_pokemon.rs

@@ -0,1 +0,188 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_capture_pokemon_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::CapturePokemonInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
          12  +
    B::Data: Send,
          13  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
          14  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          15  +
{
          16  +
    Ok({
          17  +
        #[allow(unused_mut)]
          18  +
        let mut input = crate::input::capture_pokemon_input::Builder::default();
          19  +
        #[allow(unused_variables)]
          20  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          21  +
            uri, headers, body, ..
          22  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          23  +
        if let Some(value) = {
          24  +
            let mut receiver =
          25  +
                crate::protocol_serde::shape_capture_pokemon_input::de_events_payload(
          26  +
                    &mut body.into().into_inner(),
          27  +
                )?;
          28  +
            if let Some(_initial_event) = receiver
          29  +
                                                .try_recv_initial(::aws_smithy_legacy_http::event_stream::InitialMessageType::Request)
          30  +
                                                .await
          31  +
                                                .map_err(
          32  +
                                                    |ev_error| ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection::ConstraintViolation(
          33  +
                                                        #[allow(clippy::useless_conversion)]
          34  +
                                                        format!("{ev_error}").into()
          35  +
                                                    )
          36  +
                                                )? {
          37  +
                                                
          38  +
                                            }
          39  +
            Some(receiver)
          40  +
        } {
          41  +
            input = input.set_events(value)
          42  +
        }
          43  +
        input.build()?
          44  +
    })
          45  +
}
          46  +
          47  +
#[allow(clippy::unnecessary_wraps)]
          48  +
pub fn ser_capture_pokemon_http_response(
          49  +
    #[allow(unused_variables)] output: crate::output::CapturePokemonOutput,
          50  +
) -> std::result::Result<
          51  +
    ::aws_smithy_legacy_http_server::response::Response,
          52  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::ResponseRejection,
          53  +
> {
          54  +
    Ok({
          55  +
        #[allow(unused_mut)]
          56  +
        let mut builder = ::http::Response::builder();
          57  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          58  +
            builder,
          59  +
            ::http::header::CONTENT_TYPE,
          60  +
            "application/x-amz-json-1.0",
          61  +
        );
          62  +
        let http_status: u16 = 200;
          63  +
        builder = builder.status(http_status);
          64  +
        let body = ::aws_smithy_legacy_http_server::body::boxed(
          65  +
            ::aws_smithy_legacy_http_server::body::Body::wrap_stream({
          66  +
                let error_marshaller =
          67  +
                    crate::event_stream_serde::CapturePokemonEventsErrorMarshaller::new();
          68  +
                let marshaller = crate::event_stream_serde::CapturePokemonEventsMarshaller::new();
          69  +
                let signer = ::aws_smithy_eventstream::frame::NoOpSigner {};
          70  +
                output
          71  +
                    .events
          72  +
                    .into_body_stream(marshaller, error_marshaller, signer)
          73  +
            }),
          74  +
        );
          75  +
        builder.body(body)?
          76  +
    })
          77  +
}
          78  +
          79  +
#[allow(clippy::unnecessary_wraps)]
          80  +
pub fn ser_capture_pokemon_http_error(
          81  +
    error: &crate::error::CapturePokemonError,
          82  +
) -> std::result::Result<
          83  +
    ::aws_smithy_legacy_http_server::response::Response,
          84  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::ResponseRejection,
          85  +
> {
          86  +
    Ok({
          87  +
        match error {
          88  +
            crate::error::CapturePokemonError::UnsupportedRegionError(output) => {
          89  +
                let payload = crate::protocol_serde::shape_unsupported_region_error::ser_unsupported_region_error_error(output)?;
          90  +
                #[allow(unused_mut)]
          91  +
                let mut builder = ::http::Response::builder();
          92  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          93  +
                    builder,
          94  +
                    ::http::header::CONTENT_TYPE,
          95  +
                    "application/x-amz-json-1.0",
          96  +
                );
          97  +
                let content_length = payload.len();
          98  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          99  +
                    builder,
         100  +
                    ::http::header::CONTENT_LENGTH,
         101  +
                    content_length,
         102  +
                );
         103  +
                builder
         104  +
                    .status(500)
         105  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         106  +
            }
         107  +
            crate::error::CapturePokemonError::ThrottlingError(output) => {
         108  +
                let payload =
         109  +
                    crate::protocol_serde::shape_throttling_error::ser_throttling_error_error(
         110  +
                        output,
         111  +
                    )?;
         112  +
                #[allow(unused_mut)]
         113  +
                let mut builder = ::http::Response::builder();
         114  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         115  +
                    builder,
         116  +
                    ::http::header::CONTENT_TYPE,
         117  +
                    "application/x-amz-json-1.0",
         118  +
                );
         119  +
                let content_length = payload.len();
         120  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         121  +
                    builder,
         122  +
                    ::http::header::CONTENT_LENGTH,
         123  +
                    content_length,
         124  +
                );
         125  +
                builder
         126  +
                    .status(400)
         127  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         128  +
            }
         129  +
            crate::error::CapturePokemonError::ValidationException(output) => {
         130  +
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         131  +
                #[allow(unused_mut)]
         132  +
                let mut builder = ::http::Response::builder();
         133  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         134  +
                    builder,
         135  +
                    ::http::header::CONTENT_TYPE,
         136  +
                    "application/x-amz-json-1.0",
         137  +
                );
         138  +
                let content_length = payload.len();
         139  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         140  +
                    builder,
         141  +
                    ::http::header::CONTENT_LENGTH,
         142  +
                    content_length,
         143  +
                );
         144  +
                builder
         145  +
                    .status(400)
         146  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         147  +
            }
         148  +
            crate::error::CapturePokemonError::MasterBallUnsuccessful(output) => {
         149  +
                let payload = crate::protocol_serde::shape_master_ball_unsuccessful::ser_master_ball_unsuccessful_error(output)?;
         150  +
                #[allow(unused_mut)]
         151  +
                let mut builder = ::http::Response::builder();
         152  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         153  +
                    builder,
         154  +
                    ::http::header::CONTENT_TYPE,
         155  +
                    "application/x-amz-json-1.0",
         156  +
                );
         157  +
                let content_length = payload.len();
         158  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         159  +
                    builder,
         160  +
                    ::http::header::CONTENT_LENGTH,
         161  +
                    content_length,
         162  +
                );
         163  +
                builder
         164  +
                    .status(500)
         165  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         166  +
            }
         167  +
            crate::error::CapturePokemonError::InvalidPokeballError(output) => {
         168  +
                let payload = crate::protocol_serde::shape_invalid_pokeball_error::ser_invalid_pokeball_error_error(output)?;
         169  +
                #[allow(unused_mut)]
         170  +
                let mut builder = ::http::Response::builder();
         171  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         172  +
                    builder,
         173  +
                    ::http::header::CONTENT_TYPE,
         174  +
                    "application/x-amz-json-1.0",
         175  +
                );
         176  +
                let content_length = payload.len();
         177  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         178  +
                    builder,
         179  +
                    ::http::header::CONTENT_LENGTH,
         180  +
                    content_length,
         181  +
                );
         182  +
                builder
         183  +
                    .status(400)
         184  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         185  +
            }
         186  +
        }
         187  +
    })
         188  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_capture_pokemon_input.rs

@@ -0,1 +0,15 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn de_events_payload(
           3  +
    body: &mut ::aws_smithy_types::body::SdkBody,
           4  +
) -> std::result::Result<
           5  +
    ::aws_smithy_legacy_http::event_stream::Receiver<
           6  +
        crate::model::AttemptCapturingPokemonEvent,
           7  +
        crate::error::AttemptCapturingPokemonEventError,
           8  +
    >,
           9  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
          10  +
> {
          11  +
    let unmarshaller = crate::event_stream_serde::AttemptCapturingPokemonEventUnmarshaller::new();
          12  +
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
          13  +
    let receiver = ::aws_smithy_legacy_http::event_stream::Receiver::new(unmarshaller, body);
          14  +
    Ok(receiver)
          15  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_capturing_payload.rs

@@ -0,1 +0,90 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_capturing_payload_payload(
           3  +
    input: &[u8],
           4  +
) -> ::std::result::Result<
           5  +
    crate::model::CapturingPayload,
           6  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
           7  +
> {
           8  +
    let mut tokens_owned =
           9  +
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(input))
          10  +
            .peekable();
          11  +
    let tokens = &mut tokens_owned;
          12  +
    let result = crate::protocol_serde::shape_capturing_payload::de_capturing_payload(tokens)?
          13  +
        .ok_or_else(|| {
          14  +
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          15  +
                "expected payload member value",
          16  +
            )
          17  +
        });
          18  +
    if tokens.next().is_some() {
          19  +
        return Err(
          20  +
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          21  +
                "found more JSON tokens after completing parsing",
          22  +
            ),
          23  +
        );
          24  +
    }
          25  +
    result
          26  +
}
          27  +
          28  +
pub(crate) fn de_capturing_payload<'a, I>(
          29  +
    tokens: &mut ::std::iter::Peekable<I>,
          30  +
) -> ::std::result::Result<
          31  +
    Option<crate::model::CapturingPayload>,
          32  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
          33  +
>
          34  +
where
          35  +
    I: Iterator<
          36  +
        Item = Result<
          37  +
            ::aws_smithy_json::deserialize::Token<'a>,
          38  +
            ::aws_smithy_json::deserialize::error::DeserializeError,
          39  +
        >,
          40  +
    >,
          41  +
{
          42  +
    match tokens.next().transpose()? {
          43  +
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
          44  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          45  +
            #[allow(unused_mut)]
          46  +
            let mut builder = crate::model::capturing_payload::Builder::default();
          47  +
            loop {
          48  +
                match tokens.next().transpose()? {
          49  +
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          50  +
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          51  +
                        match key.to_unescaped()?.as_ref() {
          52  +
                            "name" => {
          53  +
                                builder = builder.set_name(
          54  +
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
          55  +
                                        tokens.next(),
          56  +
                                    )?
          57  +
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          58  +
                                    .transpose()?,
          59  +
                                );
          60  +
                            }
          61  +
                            "pokeball" => {
          62  +
                                builder = builder.set_pokeball(
          63  +
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
          64  +
                                        tokens.next(),
          65  +
                                    )?
          66  +
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          67  +
                                    .transpose()?,
          68  +
                                );
          69  +
                            }
          70  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          71  +
                        }
          72  +
                    }
          73  +
                    other => {
          74  +
                        return Err(
          75  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          76  +
                                format!("expected object key or end object, found: {other:?}"),
          77  +
                            ),
          78  +
                        )
          79  +
                    }
          80  +
                }
          81  +
            }
          82  +
            Ok(Some(builder.build()))
          83  +
        }
          84  +
        _ => Err(
          85  +
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          86  +
                "expected start object or null",
          87  +
            ),
          88  +
        ),
          89  +
    }
          90  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_check_health.rs

@@ -0,1 +0,53 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_check_health_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::CheckHealthInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::check_health_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        input.build()
          23  +
    })
          24  +
}
          25  +
          26  +
#[allow(clippy::unnecessary_wraps)]
          27  +
pub fn ser_check_health_http_response(
          28  +
    #[allow(unused_variables)] output: crate::output::CheckHealthOutput,
          29  +
) -> std::result::Result<
          30  +
    ::aws_smithy_legacy_http_server::response::Response,
          31  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::ResponseRejection,
          32  +
> {
          33  +
    Ok({
          34  +
        #[allow(unused_mut)]
          35  +
        let mut builder = ::http::Response::builder();
          36  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          37  +
            builder,
          38  +
            ::http::header::CONTENT_TYPE,
          39  +
            "application/x-amz-json-1.0",
          40  +
        );
          41  +
        let http_status: u16 = 200;
          42  +
        builder = builder.status(http_status);
          43  +
        let payload = "";
          44  +
        let content_length = payload.len();
          45  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          46  +
            builder,
          47  +
            ::http::header::CONTENT_LENGTH,
          48  +
            content_length,
          49  +
        );
          50  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          51  +
        builder.body(body)?
          52  +
    })
          53  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_do_nothing.rs

@@ -0,1 +0,56 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_do_nothing_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::DoNothingInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::do_nothing_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        input.build()
          23  +
    })
          24  +
}
          25  +
          26  +
#[allow(clippy::unnecessary_wraps)]
          27  +
pub fn ser_do_nothing_http_response(
          28  +
    #[allow(unused_variables)] output: crate::output::DoNothingOutput,
          29  +
) -> std::result::Result<
          30  +
    ::aws_smithy_legacy_http_server::response::Response,
          31  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::ResponseRejection,
          32  +
> {
          33  +
    Ok({
          34  +
        #[allow(unused_mut)]
          35  +
        let mut builder = ::http::Response::builder();
          36  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          37  +
            builder,
          38  +
            ::http::header::CONTENT_TYPE,
          39  +
            "application/x-amz-json-1.0",
          40  +
        );
          41  +
        let http_status: u16 = 200;
          42  +
        builder = builder.status(http_status);
          43  +
        let payload =
          44  +
            crate::protocol_serde::shape_do_nothing_output::ser_do_nothing_output_output_output(
          45  +
                &output,
          46  +
            )?;
          47  +
        let content_length = payload.len();
          48  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          49  +
            builder,
          50  +
            ::http::header::CONTENT_LENGTH,
          51  +
            content_length,
          52  +
        );
          53  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          54  +
        builder.body(body)?
          55  +
    })
          56  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_do_nothing_output.rs

@@ -0,1 +0,20 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_do_nothing_output_output_output(
           3  +
    value: &crate::output::DoNothingOutput,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_do_nothing_output::ser_do_nothing_output_output(
           8  +
        &mut object,
           9  +
        value,
          10  +
    )?;
          11  +
    object.finish();
          12  +
    Ok(out)
          13  +
}
          14  +
          15  +
pub fn ser_do_nothing_output_output(
          16  +
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          17  +
    #[allow(unused_variables)] input: &crate::output::DoNothingOutput,
          18  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          19  +
    Ok(())
          20  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_get_server_statistics.rs

@@ -0,1 +0,55 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_get_server_statistics_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::GetServerStatisticsInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::get_server_statistics_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        input.build()
          23  +
    })
          24  +
}
          25  +
          26  +
#[allow(clippy::unnecessary_wraps)]
          27  +
pub fn ser_get_server_statistics_http_response(
          28  +
    #[allow(unused_variables)] output: crate::output::GetServerStatisticsOutput,
          29  +
) -> std::result::Result<
          30  +
    ::aws_smithy_legacy_http_server::response::Response,
          31  +
    ::aws_smithy_legacy_http_server::protocol::aws_json::rejection::ResponseRejection,
          32  +
> {
          33  +
    Ok({
          34  +
        #[allow(unused_mut)]
          35  +
        let mut builder = ::http::Response::builder();
          36  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          37  +
            builder,
          38  +
            ::http::header::CONTENT_TYPE,
          39  +
            "application/x-amz-json-1.0",
          40  +
        );
          41  +
        let http_status: u16 = 200;
          42  +
        builder = builder.status(http_status);
          43  +
        let payload =
          44  +
            crate::protocol_serde::shape_get_server_statistics_output::ser_get_server_statistics_output_output_output(&output)?
          45  +
        ;
          46  +
        let content_length = payload.len();
          47  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          48  +
            builder,
          49  +
            ::http::header::CONTENT_LENGTH,
          50  +
            content_length,
          51  +
        );
          52  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          53  +
        builder.body(body)?
          54  +
    })
          55  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_get_server_statistics_output.rs

@@ -0,1 +0,23 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_get_server_statistics_output_output_output(
           3  +
    value: &crate::output::GetServerStatisticsOutput,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_get_server_statistics_output::ser_get_server_statistics_output_output(&mut object, value)?;
           8  +
    object.finish();
           9  +
    Ok(out)
          10  +
}
          11  +
          12  +
pub fn ser_get_server_statistics_output_output(
          13  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          14  +
    input: &crate::output::GetServerStatisticsOutput,
          15  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          16  +
    {
          17  +
        object.key("calls_count").number(
          18  +
            #[allow(clippy::useless_conversion)]
          19  +
            ::aws_smithy_types::Number::NegInt((input.calls_count).into()),
          20  +
        );
          21  +
    }
          22  +
    Ok(())
          23  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_invalid_pokeball_error.rs

@@ -0,1 +0,26 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_invalid_pokeball_error_error(
           3  +
    value: &crate::error::InvalidPokeballError,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_invalid_pokeball_error::ser_invalid_pokeball_error(
           8  +
        &mut object,
           9  +
        value,
          10  +
    )?;
          11  +
    object
          12  +
        .key("__type")
          13  +
        .string("com.aws.example#InvalidPokeballError");
          14  +
    object.finish();
          15  +
    Ok(out)
          16  +
}
          17  +
          18  +
pub fn ser_invalid_pokeball_error(
          19  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          20  +
    input: &crate::error::InvalidPokeballError,
          21  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    {
          23  +
        object.key("pokeball").string(input.pokeball.as_str());
          24  +
    }
          25  +
    Ok(())
          26  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_master_ball_unsuccessful.rs

@@ -0,1 +0,74 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_master_ball_unsuccessful_error(
           3  +
    value: &crate::error::MasterBallUnsuccessful,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_master_ball_unsuccessful::ser_master_ball_unsuccessful(
           8  +
        &mut object,
           9  +
        value,
          10  +
    )?;
          11  +
    object
          12  +
        .key("__type")
          13  +
        .string("com.aws.example#MasterBallUnsuccessful");
          14  +
    object.finish();
          15  +
    Ok(out)
          16  +
}
          17  +
          18  +
pub fn ser_master_ball_unsuccessful(
          19  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          20  +
    input: &crate::error::MasterBallUnsuccessful,
          21  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    if let Some(var_1) = &input.message {
          23  +
        object.key("message").string(var_1.as_str());
          24  +
    }
          25  +
    Ok(())
          26  +
}
          27  +
          28  +
pub(crate) fn de_master_ball_unsuccessful_json_err(
          29  +
    value: &[u8],
          30  +
    mut builder: crate::error::master_ball_unsuccessful::Builder,
          31  +
) -> ::std::result::Result<
          32  +
    crate::error::master_ball_unsuccessful::Builder,
          33  +
    ::aws_smithy_json::deserialize::error::DeserializeError,
          34  +
> {
          35  +
    let mut tokens_owned =
          36  +
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
          37  +
            .peekable();
          38  +
    let tokens = &mut tokens_owned;
          39  +
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
          40  +
    loop {
          41  +
        match tokens.next().transpose()? {
          42  +
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
          43  +
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          44  +
                match key.to_unescaped()?.as_ref() {
          45  +
                    "message" => {
          46  +
                        builder = builder.set_message(
          47  +
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
          48  +
                                tokens.next(),
          49  +
                            )?
          50  +
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
          51  +
                            .transpose()?,
          52  +
                        );
          53  +
                    }
          54  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          55  +
                }
          56  +
            }
          57  +
            other => {
          58  +
                return Err(
          59  +
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
          60  +
                        "expected object key or end object, found: {other:?}"
          61  +
                    )),
          62  +
                )
          63  +
            }
          64  +
        }
          65  +
    }
          66  +
    if tokens.next().is_some() {
          67  +
        return Err(
          68  +
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          69  +
                "found more JSON tokens after completing parsing",
          70  +
            ),
          71  +
        );
          72  +
    }
          73  +
    Ok(builder)
          74  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_throttling_error.rs

@@ -0,1 +0,20 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_throttling_error_error(
           3  +
    value: &crate::error::ThrottlingError,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_throttling_error::ser_throttling_error(&mut object, value)?;
           8  +
    object
           9  +
        .key("__type")
          10  +
        .string("com.aws.example#ThrottlingError");
          11  +
    object.finish();
          12  +
    Ok(out)
          13  +
}
          14  +
          15  +
pub fn ser_throttling_error(
          16  +
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          17  +
    #[allow(unused_variables)] input: &crate::error::ThrottlingError,
          18  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          19  +
    Ok(())
          20  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_unsupported_region_error.rs

@@ -0,1 +0,26 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_unsupported_region_error_error(
           3  +
    value: &crate::error::UnsupportedRegionError,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_unsupported_region_error::ser_unsupported_region_error(
           8  +
        &mut object,
           9  +
        value,
          10  +
    )?;
          11  +
    object
          12  +
        .key("__type")
          13  +
        .string("com.aws.example#UnsupportedRegionError");
          14  +
    object.finish();
          15  +
    Ok(out)
          16  +
}
          17  +
          18  +
pub fn ser_unsupported_region_error(
          19  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          20  +
    input: &crate::error::UnsupportedRegionError,
          21  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    {
          23  +
        object.key("region").string(input.region.as_str());
          24  +
    }
          25  +
    Ok(())
          26  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_validation_exception.rs

@@ -0,1 +0,38 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_validation_exception_error(
           3  +
    value: &crate::error::ValidationException,
           4  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           5  +
    let mut out = ::std::string::String::new();
           6  +
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           7  +
    crate::protocol_serde::shape_validation_exception::ser_validation_exception(
           8  +
        &mut object,
           9  +
        value,
          10  +
    )?;
          11  +
    object
          12  +
        .key("__type")
          13  +
        .string("smithy.framework#ValidationException");
          14  +
    object.finish();
          15  +
    Ok(out)
          16  +
}
          17  +
          18  +
pub fn ser_validation_exception(
          19  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
          20  +
    input: &crate::error::ValidationException,
          21  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    {
          23  +
        object.key("message").string(input.message.as_str());
          24  +
    }
          25  +
    if let Some(var_1) = &input.field_list {
          26  +
        let mut array_2 = object.key("fieldList").start_array();
          27  +
        for item_3 in var_1 {
          28  +
            {
          29  +
                #[allow(unused_mut)]
          30  +
                let mut object_4 = array_2.value().start_object();
          31  +
                crate::protocol_serde::shape_validation_exception_field::ser_validation_exception_field(&mut object_4, item_3)?;
          32  +
                object_4.finish();
          33  +
            }
          34  +
        }
          35  +
        array_2.finish();
          36  +
    }
          37  +
    Ok(())
          38  +
}

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk-http0x/rust-server-codegen/src/protocol_serde/shape_validation_exception_field.rs

@@ -0,1 +0,13 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_validation_exception_field(
           3  +
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
           4  +
    input: &crate::model::ValidationExceptionField,
           5  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    {
           7  +
        object.key("path").string(input.path.as_str());
           8  +
    }
           9  +
    {
          10  +
        object.key("message").string(input.message.as_str());
          11  +
    }
          12  +
    Ok(())
          13  +
}