Server Test Python

Server Test Python

rev. 1661690c47759989ca94986fb8d3e5132fc72dc5

Files changed:

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

@@ -6159,6159 +6219,6218 @@
 6179   6179   
    /// Creates a new builder-style object to manufacture [`NoInputAndNoOutputOutput`](crate::output::NoInputAndNoOutputOutput).
 6180   6180   
    pub fn builder() -> crate::output::no_input_and_no_output_output::Builder {
 6181   6181   
        crate::output::no_input_and_no_output_output::Builder::default()
 6182   6182   
    }
 6183   6183   
}
 6184   6184   
/// See [`OperationWithNestedStructureOutput`](crate::output::OperationWithNestedStructureOutput).
 6185   6185   
pub mod operation_with_nested_structure_output {
 6186   6186   
 6187   6187   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 6188   6188   
    /// Holds one variant for each of the ways the builder can fail.
 6189         -
 6190   6189   
    #[allow(clippy::enum_variant_names)]
 6191   6190   
    pub enum ConstraintViolation {
 6192   6191   
        /// `dialog` was not provided but it is required when building `OperationWithNestedStructureOutput`.
 6193   6192   
        MissingDialog,
 6194   6193   
    }
 6195   6194   
    impl ::std::fmt::Display for ConstraintViolation {
 6196   6195   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 6197   6196   
            match self {
 6198   6197   
                ConstraintViolation::MissingDialog => write!(f, "`dialog` was not provided but it is required when building `OperationWithNestedStructureOutput`"),
 6199   6198   
            }
@@ -7739,7738 +7854,7851 @@
 7759   7758   
        ) -> crate::output::EndpointOperationOutput {
 7760   7759   
            crate::output::EndpointOperationOutput {}
 7761   7760   
        }
 7762   7761   
    }
 7763   7762   
}
 7764   7763   
/// See [`PostUnionWithJsonNameOutput`](crate::output::PostUnionWithJsonNameOutput).
 7765   7764   
pub mod post_union_with_json_name_output {
 7766   7765   
 7767   7766   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 7768   7767   
    /// Holds one variant for each of the ways the builder can fail.
 7769         -
 7770   7768   
    #[allow(clippy::enum_variant_names)]
 7771   7769   
    pub enum ConstraintViolation {
 7772   7770   
        /// `value` was not provided but it is required when building `PostUnionWithJsonNameOutput`.
 7773   7771   
        MissingValue,
 7774   7772   
    }
 7775   7773   
    impl ::std::fmt::Display for ConstraintViolation {
 7776   7774   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 7777   7775   
            match self {
 7778   7776   
                ConstraintViolation::MissingValue => write!(f, "`value` was not provided but it is required when building `PostUnionWithJsonNameOutput`"),
 7779   7777   
            }
 7780   7778   
        }
 7781   7779   
    }
 7782   7780   
    impl ::std::error::Error for ConstraintViolation {}
 7783   7781   
    impl ::std::convert::TryFrom<Builder> for crate::output::PostUnionWithJsonNameOutput {
 7784   7782   
        type Error = ConstraintViolation;
 7785   7783   
 7786   7784   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
 7787   7785   
            builder.build()
 7788   7786   
        }
 7789   7787   
    }
 7790   7788   
    /// A builder for [`PostUnionWithJsonNameOutput`](crate::output::PostUnionWithJsonNameOutput).
 7791   7789   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
 7792   7790   
    pub struct Builder {
 7793   7791   
        pub(crate) value: ::std::option::Option<crate::model::UnionWithJsonName>,
 7794   7792   
    }
 7795   7793   
    impl Builder {
 7796   7794   
        #[allow(missing_docs)] // documentation missing in model
 7797   7795   
        pub fn value(mut self, input: crate::model::UnionWithJsonName) -> Self {
 7798   7796   
            self.value = Some(input);
 7799   7797   
            self
 7800   7798   
        }
 7801   7799   
        /// Consumes the builder and constructs a [`PostUnionWithJsonNameOutput`](crate::output::PostUnionWithJsonNameOutput).
 7802   7800   
        ///
 7803   7801   
        /// The builder fails to construct a [`PostUnionWithJsonNameOutput`](crate::output::PostUnionWithJsonNameOutput) if you do not provide a value for all non-`Option`al members.
 7804   7802   
        ///
 7805   7803   
        pub fn build(
 7806   7804   
            self,
 7807   7805   
        ) -> Result<crate::output::PostUnionWithJsonNameOutput, ConstraintViolation> {
 7808   7806   
            self.build_enforcing_required_and_enum_traits()
 7809   7807   
        }
 7810   7808   
        fn build_enforcing_required_and_enum_traits(
 7811   7809   
            self,
 7812   7810   
        ) -> Result<crate::output::PostUnionWithJsonNameOutput, ConstraintViolation> {
 7813   7811   
            Ok(crate::output::PostUnionWithJsonNameOutput {
 7814   7812   
                value: self.value.ok_or(ConstraintViolation::MissingValue)?,
 7815   7813   
            })
 7816   7814   
        }
 7817   7815   
    }
 7818   7816   
}
 7819   7817   
/// See [`PostPlayerActionOutput`](crate::output::PostPlayerActionOutput).
 7820   7818   
pub mod post_player_action_output {
 7821   7819   
 7822   7820   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 7823   7821   
    /// Holds one variant for each of the ways the builder can fail.
 7824         -
 7825   7822   
    #[allow(clippy::enum_variant_names)]
 7826   7823   
    pub enum ConstraintViolation {
 7827   7824   
        /// `action` was not provided but it is required when building `PostPlayerActionOutput`.
 7828   7825   
        MissingAction,
 7829   7826   
    }
 7830   7827   
    impl ::std::fmt::Display for ConstraintViolation {
 7831   7828   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 7832   7829   
            match self {
 7833   7830   
                ConstraintViolation::MissingAction => write!(f, "`action` was not provided but it is required when building `PostPlayerActionOutput`"),
 7834   7831   
            }

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

@@ -53,53 +132,132 @@
   73     73   
                ::nom::sequence::preceded(
   74     74   
                    ::nom::bytes::complete::tag("/"),
   75     75   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   76     76   
                        ::nom::bytes::complete::take_until("/"),
   77     77   
                        ::nom::combinator::rest,
   78     78   
                    )),
   79     79   
                ),
   80     80   
            ))(input_string)?;
   81     81   
        debug_assert_eq!("", input_string);
   82     82   
        input = input.set_member_epoch_seconds(
   83         -
                                        crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_member_epoch_seconds(m1)?
   84         -
                                    );
          83  +
                                    crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_member_epoch_seconds(m1)?
          84  +
                                );
   85     85   
        input = input.set_member_http_date(
   86         -
                                        crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_member_http_date(m2)?
   87         -
                                    );
          86  +
                                    crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_member_http_date(m2)?
          87  +
                                );
   88     88   
        input = input.set_member_date_time(
   89         -
                                        crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_member_date_time(m3)?
   90         -
                                    );
          89  +
                                    crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_member_date_time(m3)?
          90  +
                                );
   91     91   
        input = input.set_default_format(
   92         -
                                        crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_default_format(m4)?
   93         -
                                    );
          92  +
                                    crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_default_format(m4)?
          93  +
                                );
   94     94   
        input = input.set_target_epoch_seconds(
   95         -
                                        crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_target_epoch_seconds(m5)?
   96         -
                                    );
          95  +
                                    crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_target_epoch_seconds(m5)?
          96  +
                                );
   97     97   
        input = input.set_target_http_date(
   98         -
                                        crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_target_http_date(m6)?
   99         -
                                    );
          98  +
                                    crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_target_http_date(m6)?
          99  +
                                );
  100    100   
        input = input.set_target_date_time(
  101         -
                                        crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_target_date_time(m7)?
  102         -
                                    );
         101  +
                                    crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_target_date_time(m7)?
         102  +
                                );
  103    103   
        input.build()?
  104    104   
    })
  105    105   
}
  106    106   
  107    107   
#[allow(clippy::unnecessary_wraps)]
  108    108   
pub fn ser_http_request_with_labels_and_timestamp_format_http_response(
  109    109   
    #[allow(unused_variables)] output: crate::output::HttpRequestWithLabelsAndTimestampFormatOutput,
  110    110   
) -> std::result::Result<
  111    111   
    ::aws_smithy_http_server::response::Response,
  112    112   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,

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

@@ -1103,1103 +1163,1162 @@
 1123   1123   
        fn build_enforcing_required_and_enum_traits(self) -> crate::error::ExtraError {
 1124   1124   
            crate::error::ExtraError {}
 1125   1125   
        }
 1126   1126   
    }
 1127   1127   
}
 1128   1128   
/// See [`InternalServerError`](crate::error::InternalServerError).
 1129   1129   
pub mod internal_server_error {
 1130   1130   
 1131   1131   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1132   1132   
    /// Holds one variant for each of the ways the builder can fail.
 1133         -
 1134   1133   
    #[allow(clippy::enum_variant_names)]
 1135   1134   
    pub enum ConstraintViolation {
 1136   1135   
        /// `message` was not provided but it is required when building `InternalServerError`.
 1137   1136   
        MissingMessage,
 1138   1137   
    }
 1139   1138   
    impl ::std::fmt::Display for ConstraintViolation {
 1140   1139   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1141   1140   
            match self {
 1142   1141   
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
 1143   1142   
            }
@@ -1186,1185 +1246,1244 @@
 1206   1205   
                message: self.message,
 1207   1206   
            }
 1208   1207   
        }
 1209   1208   
    }
 1210   1209   
}
 1211   1210   
/// See [`ValidationException`](crate::error::ValidationException).
 1212   1211   
pub mod validation_exception {
 1213   1212   
 1214   1213   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1215   1214   
    /// Holds one variant for each of the ways the builder can fail.
 1216         -
 1217   1215   
    #[allow(clippy::enum_variant_names)]
 1218   1216   
    pub enum ConstraintViolation {
 1219   1217   
        /// `message` was not provided but it is required when building `ValidationException`.
 1220   1218   
        MissingMessage,
 1221   1219   
    }
 1222   1220   
    impl ::std::fmt::Display for ConstraintViolation {
 1223   1221   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1224   1222   
            match self {
 1225   1223   
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
 1226   1224   
            }

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

@@ -1315,1315 +1375,1374 @@
 1335   1335   
                    .ok_or(ConstraintViolation::MissingEnum)?,
 1336   1336   
            })
 1337   1337   
        }
 1338   1338   
    }
 1339   1339   
}
 1340   1340   
/// See [`EnumQueryInput`](crate::input::EnumQueryInput).
 1341   1341   
pub mod enum_query_input {
 1342   1342   
 1343   1343   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1344   1344   
    /// Holds one variant for each of the ways the builder can fail.
 1345         -
 1346   1345   
    #[allow(clippy::enum_variant_names)]
 1347   1346   
    pub enum ConstraintViolation {
 1348   1347   
        /// `r#enum` was not provided but it is required when building `EnumQueryInput`.
 1349   1348   
        MissingEnum,
 1350   1349   
    }
 1351   1350   
    impl ::std::fmt::Display for ConstraintViolation {
 1352   1351   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1353   1352   
            match self {
 1354   1353   
                ConstraintViolation::MissingEnum => write!(
 1355   1354   
                    f,

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

@@ -412,412 +472,471 @@
  432    432   
        fn build_enforcing_required_and_enum_traits(self) -> crate::model::EmptyStruct {
  433    433   
            crate::model::EmptyStruct {}
  434    434   
        }
  435    435   
    }
  436    436   
}
  437    437   
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  438    438   
pub mod validation_exception_field {
  439    439   
  440    440   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  441    441   
    /// Holds one variant for each of the ways the builder can fail.
  442         -
  443    442   
    #[allow(clippy::enum_variant_names)]
  444    443   
    pub enum ConstraintViolation {
  445    444   
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
  446    445   
        MissingPath,
  447    446   
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
  448    447   
        MissingMessage,
  449    448   
    }
  450    449   
    impl ::std::fmt::Display for ConstraintViolation {
  451    450   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  452    451   
            match self {

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

@@ -22,22 +82,81 @@
   42     42   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
   43     43   
        let fut = async move {
   44     44   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
   45     45   
                request.headers(),
   46     46   
                &CONTENT_TYPE_QUERYPRECEDENCE,
   47     47   
            ) {
   48     48   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
   49     49   
            }
   50     50   
            crate::protocol_serde::shape_query_precedence::de_query_precedence_http_request(request)
   51     51   
                .await
   52         -
                .map_err(Into::into)
   53     52   
        };
   54     53   
        use ::futures_util::future::TryFutureExt;
   55     54   
        let fut = fut.map_err(
   56     55   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
   57     56   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   58     57   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
   59     58   
                    e,
   60     59   
                )
   61     60   
            },
   62     61   
        );
@@ -127,126 +187,185 @@
  147    146   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  148    147   
        let fut = async move {
  149    148   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  150    149   
                request.headers(),
  151    150   
                &CONTENT_TYPE_EMPTYSTRUCTWITHCONTENTONWIREOP,
  152    151   
            ) {
  153    152   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  154    153   
            }
  155    154   
            crate::protocol_serde::shape_empty_struct_with_content_on_wire_op::de_empty_struct_with_content_on_wire_op_http_request(request)
  156    155   
                            .await
  157         -
                            .map_err(Into::into)
  158    156   
        };
  159    157   
        use ::futures_util::future::TryFutureExt;
  160    158   
        let fut = fut.map_err(
  161    159   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  162    160   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  163    161   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  164    162   
                    e,
  165    163   
                )
  166    164   
            },
  167    165   
        );
@@ -227,225 +287,284 @@
  247    245   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  248    246   
        let fut = async move {
  249    247   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  250    248   
                request.headers(),
  251    249   
                &CONTENT_TYPE_CASEINSENSITIVEERROROPERATION,
  252    250   
            ) {
  253    251   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  254    252   
            }
  255    253   
            crate::protocol_serde::shape_case_insensitive_error_operation::de_case_insensitive_error_operation_http_request(request)
  256    254   
                            .await
  257         -
                            .map_err(Into::into)
  258    255   
        };
  259    256   
        use ::futures_util::future::TryFutureExt;
  260    257   
        let fut = fut.map_err(
  261    258   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  262    259   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  263    260   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  264    261   
                    e,
  265    262   
                )
  266    263   
            },
  267    264   
        );
@@ -329,326 +389,385 @@
  349    346   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  350    347   
                request.headers(),
  351    348   
                &CONTENT_TYPE_NULLINNONSPARSE,
  352    349   
            ) {
  353    350   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  354    351   
            }
  355    352   
            crate::protocol_serde::shape_null_in_non_sparse::de_null_in_non_sparse_http_request(
  356    353   
                request,
  357    354   
            )
  358    355   
            .await
  359         -
            .map_err(Into::into)
  360    356   
        };
  361    357   
        use ::futures_util::future::TryFutureExt;
  362    358   
        let fut = fut.map_err(
  363    359   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  364    360   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  365    361   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  366    362   
                    e,
  367    363   
                )
  368    364   
            },
  369    365   
        );
@@ -435,431 +495,490 @@
  455    451   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  456    452   
        let fut = async move {
  457    453   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  458    454   
                request.headers(),
  459    455   
                &CONTENT_TYPE_ESCAPEDSTRINGVALUES,
  460    456   
            ) {
  461    457   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  462    458   
            }
  463    459   
            crate::protocol_serde::shape_escaped_string_values::de_escaped_string_values_http_request(request)
  464    460   
                            .await
  465         -
                            .map_err(Into::into)
  466    461   
        };
  467    462   
        use ::futures_util::future::TryFutureExt;
  468    463   
        let fut = fut.map_err(
  469    464   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  470    465   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  471    466   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  472    467   
                    e,
  473    468   
                )
  474    469   
            },
  475    470   
        );
@@ -535,530 +595,589 @@
  555    550   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  556    551   
        let fut = async move {
  557    552   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  558    553   
                request.headers(),
  559    554   
                &CONTENT_TYPE_PRIMITIVEINTOP,
  560    555   
            ) {
  561    556   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  562    557   
            }
  563    558   
            crate::protocol_serde::shape_primitive_int_op::de_primitive_int_op_http_request(request)
  564    559   
                .await
  565         -
                .map_err(Into::into)
  566    560   
        };
  567    561   
        use ::futures_util::future::TryFutureExt;
  568    562   
        let fut = fut.map_err(
  569    563   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  570    564   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  571    565   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  572    566   
                    e,
  573    567   
                )
  574    568   
            },
  575    569   
        );
@@ -642,636 +702,695 @@
  662    656   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  663    657   
                request.headers(),
  664    658   
                &CONTENT_TYPE_MAPWITHENUMKEYOP,
  665    659   
            ) {
  666    660   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  667    661   
            }
  668    662   
            crate::protocol_serde::shape_map_with_enum_key_op::de_map_with_enum_key_op_http_request(
  669    663   
                request,
  670    664   
            )
  671    665   
            .await
  672         -
            .map_err(Into::into)
  673    666   
        };
  674    667   
        use ::futures_util::future::TryFutureExt;
  675    668   
        let fut = fut.map_err(
  676    669   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  677    670   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  678    671   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  679    672   
                    e,
  680    673   
                )
  681    674   
            },
  682    675   
        );
@@ -746,739 +806,798 @@
  766    759   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  767    760   
        let fut = async move {
  768    761   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  769    762   
                request.headers(),
  770    763   
                &CONTENT_TYPE_STATUSRESPONSE,
  771    764   
            ) {
  772    765   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  773    766   
            }
  774    767   
            crate::protocol_serde::shape_status_response::de_status_response_http_request(request)
  775    768   
                .await
  776         -
                .map_err(Into::into)
  777    769   
        };
  778    770   
        use ::futures_util::future::TryFutureExt;
  779    771   
        let fut = fut.map_err(
  780    772   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  781    773   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  782    774   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  783    775   
                    e,
  784    776   
                )
  785    777   
            },
  786    778   
        );
@@ -847,839 +909,899 @@
  867    859   
    type Future = EnumQueryInputFuture;
  868    860   
  869    861   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  870    862   
        let fut = async move {
  871    863   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  872    864   
                request.headers(),
  873    865   
                &CONTENT_TYPE_ENUMQUERY,
  874    866   
            ) {
  875    867   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  876    868   
            }
  877         -
            crate::protocol_serde::shape_enum_query::de_enum_query_http_request(request)
  878         -
                .await
  879         -
                .map_err(Into::into)
         869  +
            crate::protocol_serde::shape_enum_query::de_enum_query_http_request(request).await
  880    870   
        };
  881    871   
        use ::futures_util::future::TryFutureExt;
  882    872   
        let fut = fut.map_err(
  883    873   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  884    874   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  885    875   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  886    876   
                    e,
  887    877   
                )
  888    878   
            },
  889    879   
        );
@@ -953,943 +1013,1002 @@
  973    963   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  974    964   
                request.headers(),
  975    965   
                &CONTENT_TYPE_PRIMITIVEINTHEADER,
  976    966   
            ) {
  977    967   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  978    968   
            }
  979    969   
            crate::protocol_serde::shape_primitive_int_header::de_primitive_int_header_http_request(
  980    970   
                request,
  981    971   
            )
  982    972   
            .await
  983         -
            .map_err(Into::into)
  984    973   
        };
  985    974   
        use ::futures_util::future::TryFutureExt;
  986    975   
        let fut = fut.map_err(
  987    976   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  988    977   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  989    978   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  990    979   
                    e,
  991    980   
                )
  992    981   
            },
  993    982   
        );
@@ -1062,1051 +1122,1110 @@
 1082   1071   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1083   1072   
        let fut = async move {
 1084   1073   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1085   1074   
                request.headers(),
 1086   1075   
                &CONTENT_TYPE_STRINGPAYLOAD,
 1087   1076   
            ) {
 1088   1077   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1089   1078   
            }
 1090   1079   
            crate::protocol_serde::shape_string_payload::de_string_payload_http_request(request)
 1091   1080   
                .await
 1092         -
                .map_err(Into::into)
 1093   1081   
        };
 1094   1082   
        use ::futures_util::future::TryFutureExt;
 1095   1083   
        let fut = fut.map_err(
 1096   1084   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
 1097   1085   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1098   1086   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
 1099   1087   
                    e,
 1100   1088   
                )
 1101   1089   
            },
 1102   1090   
        );

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

@@ -84,84 +144,143 @@
  104    104   
    /// Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
  105    105   
    pub fn builder() -> crate::error::internal_server_error::Builder {
  106    106   
        crate::error::internal_server_error::Builder::default()
  107    107   
    }
  108    108   
}
  109    109   
/// See [`InternalServerError`](crate::error::InternalServerError).
  110    110   
pub mod internal_server_error {
  111    111   
  112    112   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  113    113   
    /// Holds one variant for each of the ways the builder can fail.
  114         -
  115    114   
    #[allow(clippy::enum_variant_names)]
  116    115   
    pub enum ConstraintViolation {
  117    116   
        /// `message` was not provided but it is required when building `InternalServerError`.
  118    117   
        MissingMessage,
  119    118   
    }
  120    119   
    impl ::std::fmt::Display for ConstraintViolation {
  121    120   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  122    121   
            match self {
  123    122   
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
  124    123   
            }

tmp-codegen-diff/codegen-server-test-python/simple/rust-server-codegen-python/src/operation.rs

@@ -20,20 +82,80 @@
   40     40   
    type Future = OperationInputFuture;
   41     41   
   42     42   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
   43     43   
        let fut = async move {
   44     44   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
   45     45   
                request.headers(),
   46     46   
                &CONTENT_TYPE_OPERATION,
   47     47   
            ) {
   48     48   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
   49     49   
            }
   50         -
            crate::protocol_serde::shape_operation::de_operation_http_request(request)
   51         -
                .await
   52         -
                .map_err(Into::into)
          50  +
            crate::protocol_serde::shape_operation::de_operation_http_request(request).await
   53     51   
        };
   54     52   
        use ::futures_util::future::TryFutureExt;
   55     53   
        let fut = fut.map_err(
   56     54   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
   57     55   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   58     56   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
   59     57   
                    e,
   60     58   
                )
   61     59   
            },
   62     60   
        );

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

@@ -177,177 +290,288 @@
  197    197   
    /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
  198    198   
    pub fn builder() -> crate::error::validation_exception::Builder {
  199    199   
        crate::error::validation_exception::Builder::default()
  200    200   
    }
  201    201   
}
  202    202   
/// See [`InternalServerError`](crate::error::InternalServerError).
  203    203   
pub mod internal_server_error {
  204    204   
  205    205   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  206    206   
    /// Holds one variant for each of the ways the builder can fail.
  207         -
  208    207   
    #[allow(clippy::enum_variant_names)]
  209    208   
    pub enum ConstraintViolation {
  210    209   
        /// `message` was not provided but it is required when building `InternalServerError`.
  211    210   
        MissingMessage,
  212    211   
    }
  213    212   
    impl ::std::fmt::Display for ConstraintViolation {
  214    213   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  215    214   
            match self {
  216    215   
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
  217    216   
            }
  218    217   
        }
  219    218   
    }
  220    219   
    impl ::std::error::Error for ConstraintViolation {}
  221    220   
    impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
  222    221   
        type Error = ConstraintViolation;
  223    222   
  224    223   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  225    224   
            builder.build()
  226    225   
        }
  227    226   
    }
  228    227   
    /// A builder for [`InternalServerError`](crate::error::InternalServerError).
  229    228   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  230    229   
    pub struct Builder {
  231    230   
        pub(crate) message: ::std::option::Option<::std::string::String>,
  232    231   
    }
  233    232   
    impl Builder {
  234    233   
        #[allow(missing_docs)] // documentation missing in model
  235    234   
        pub fn message(mut self, input: ::std::string::String) -> Self {
  236    235   
            self.message = Some(input);
  237    236   
            self
  238    237   
        }
  239    238   
        /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
  240    239   
        ///
  241    240   
        /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
  242    241   
        ///
  243    242   
        pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
  244    243   
            self.build_enforcing_required_and_enum_traits()
  245    244   
        }
  246    245   
        fn build_enforcing_required_and_enum_traits(
  247    246   
            self,
  248    247   
        ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
  249    248   
            Ok(crate::error::InternalServerError {
  250    249   
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  251    250   
            })
  252    251   
        }
  253    252   
    }
  254    253   
}
  255    254   
/// See [`ValidationException`](crate::error::ValidationException).
  256    255   
pub mod validation_exception {
  257    256   
  258    257   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  259    258   
    /// Holds one variant for each of the ways the builder can fail.
  260         -
  261    259   
    #[allow(clippy::enum_variant_names)]
  262    260   
    pub enum ConstraintViolation {
  263    261   
        /// `message` was not provided but it is required when building `ValidationException`.
  264    262   
        MissingMessage,
  265    263   
    }
  266    264   
    impl ::std::fmt::Display for ConstraintViolation {
  267    265   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  268    266   
            match self {
  269    267   
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
  270    268   
            }

tmp-codegen-diff/codegen-server-test-python/unique_items/rust-server-codegen-python/src/model.rs

@@ -255,255 +315,314 @@
  275    275   
}
  276    276   
impl crate::constrained::Constrained for SimpleSet {
  277    277   
    type Unconstrained = crate::unconstrained::simple_set_unconstrained::SimpleSetUnconstrained;
  278    278   
}
  279    279   
  280    280   
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  281    281   
pub mod validation_exception_field {
  282    282   
  283    283   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  284    284   
    /// Holds one variant for each of the ways the builder can fail.
  285         -
  286    285   
    #[allow(clippy::enum_variant_names)]
  287    286   
    pub enum ConstraintViolation {
  288    287   
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
  289    288   
        MissingPath,
  290    289   
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
  291    290   
        MissingMessage,
  292    291   
    }
  293    292   
    impl ::std::fmt::Display for ConstraintViolation {
  294    293   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  295    294   
            match self {

tmp-codegen-diff/codegen-server-test-python/unique_items/rust-server-codegen-python/src/operation.rs

@@ -22,22 +82,81 @@
   42     42   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
   43     43   
        let fut = async move {
   44     44   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
   45     45   
                request.headers(),
   46     46   
                &CONTENT_TYPE_MALFORMEDUNIQUEITEMS,
   47     47   
            ) {
   48     48   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
   49     49   
            }
   50     50   
            crate::protocol_serde::shape_malformed_unique_items::de_malformed_unique_items_http_request(request)
   51     51   
                            .await
   52         -
                            .map_err(Into::into)
   53     52   
        };
   54     53   
        use ::futures_util::future::TryFutureExt;
   55     54   
        let fut = fut.map_err(
   56     55   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
   57     56   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   58     57   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
   59     58   
                    e,
   60     59   
                )
   61     60   
            },
   62     61   
        );