Server Test Python

Server Test Python

rev. 595a9dbeb2bcaa5eb380ce8a3ff81a559073e046

Files changed:

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

@@ -2669,2669 +2729,2728 @@
 2689   2689   
 2690   2690   
        Ok(Self(value))
 2691   2691   
    }
 2692   2692   
}
 2693   2693   
 2694   2694   
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
 2695   2695   
pub mod validation_exception_field {
 2696   2696   
 2697   2697   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 2698   2698   
    /// Holds one variant for each of the ways the builder can fail.
 2699         -
 2700   2699   
    #[allow(clippy::enum_variant_names)]
 2701   2700   
    pub enum ConstraintViolation {
 2702   2701   
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
 2703   2702   
        MissingPath,
 2704   2703   
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
 2705   2704   
        MissingMessage,
 2706   2705   
    }
 2707   2706   
    impl ::std::fmt::Display for ConstraintViolation {
 2708   2707   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 2709   2708   
            match self {

tmp-codegen-diff/codegen-server-test-python/ebs/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_STARTSNAPSHOT,
   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_start_snapshot::de_start_snapshot_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   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  148    147   
                request.headers(),
  149    148   
                &CONTENT_TYPE_PUTSNAPSHOTBLOCK,
  150    149   
            ) {
  151    150   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  152    151   
            }
  153    152   
            crate::protocol_serde::shape_put_snapshot_block::de_put_snapshot_block_http_request(
  154    153   
                request,
  155    154   
            )
  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   
        );
@@ -235,233 +295,292 @@
  255    253   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  256    254   
                request.headers(),
  257    255   
                &CONTENT_TYPE_LISTSNAPSHOTBLOCKS,
  258    256   
            ) {
  259    257   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  260    258   
            }
  261    259   
            crate::protocol_serde::shape_list_snapshot_blocks::de_list_snapshot_blocks_http_request(
  262    260   
                request,
  263    261   
            )
  264    262   
            .await
  265         -
            .map_err(Into::into)
  266    263   
        };
  267    264   
        use ::futures_util::future::TryFutureExt;
  268    265   
        let fut = fut.map_err(
  269    266   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  270    267   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  271    268   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  272    269   
                    e,
  273    270   
                )
  274    271   
            },
  275    272   
        );
@@ -341,338 +401,397 @@
  361    358   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  362    359   
                request.headers(),
  363    360   
                &CONTENT_TYPE_LISTCHANGEDBLOCKS,
  364    361   
            ) {
  365    362   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  366    363   
            }
  367    364   
            crate::protocol_serde::shape_list_changed_blocks::de_list_changed_blocks_http_request(
  368    365   
                request,
  369    366   
            )
  370    367   
            .await
  371         -
            .map_err(Into::into)
  372    368   
        };
  373    369   
        use ::futures_util::future::TryFutureExt;
  374    370   
        let fut = fut.map_err(
  375    371   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  376    372   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  377    373   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  378    374   
                    e,
  379    375   
                )
  380    376   
            },
  381    377   
        );
@@ -447,443 +507,502 @@
  467    463   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  468    464   
                request.headers(),
  469    465   
                &CONTENT_TYPE_GETSNAPSHOTBLOCK,
  470    466   
            ) {
  471    467   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  472    468   
            }
  473    469   
            crate::protocol_serde::shape_get_snapshot_block::de_get_snapshot_block_http_request(
  474    470   
                request,
  475    471   
            )
  476    472   
            .await
  477         -
            .map_err(Into::into)
  478    473   
        };
  479    474   
        use ::futures_util::future::TryFutureExt;
  480    475   
        let fut = fut.map_err(
  481    476   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  482    477   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  483    478   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  484    479   
                    e,
  485    480   
                )
  486    481   
            },
  487    482   
        );
@@ -555,550 +615,609 @@
  575    570   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  576    571   
                request.headers(),
  577    572   
                &CONTENT_TYPE_COMPLETESNAPSHOT,
  578    573   
            ) {
  579    574   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  580    575   
            }
  581    576   
            crate::protocol_serde::shape_complete_snapshot::de_complete_snapshot_http_request(
  582    577   
                request,
  583    578   
            )
  584    579   
            .await
  585         -
            .map_err(Into::into)
  586    580   
        };
  587    581   
        use ::futures_util::future::TryFutureExt;
  588    582   
        let fut = fut.map_err(
  589    583   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  590    584   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  591    585   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  592    586   
                    e,
  593    587   
                )
  594    588   
            },
  595    589   
        );

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

@@ -1186,1186 +1299,1297 @@
 1206   1206   
            }
 1207   1207   
            .into()
 1208   1208   
        })
 1209   1209   
    }
 1210   1210   
}
 1211   1211   
/// See [`InternalServerError`](crate::error::InternalServerError).
 1212   1212   
pub mod internal_server_error {
 1213   1213   
 1214   1214   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1215   1215   
    /// Holds one variant for each of the ways the builder can fail.
 1216         -
 1217   1216   
    #[allow(clippy::enum_variant_names)]
 1218   1217   
    pub enum ConstraintViolation {
 1219   1218   
        /// `message` was not provided but it is required when building `InternalServerError`.
 1220   1219   
        MissingMessage,
 1221   1220   
    }
 1222   1221   
    impl ::std::fmt::Display for ConstraintViolation {
 1223   1222   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1224   1223   
            match self {
 1225   1224   
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
 1226   1225   
            }
 1227   1226   
        }
 1228   1227   
    }
 1229   1228   
    impl ::std::error::Error for ConstraintViolation {}
 1230   1229   
    impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
 1231   1230   
        type Error = ConstraintViolation;
 1232   1231   
 1233   1232   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
 1234   1233   
            builder.build()
 1235   1234   
        }
 1236   1235   
    }
 1237   1236   
    /// A builder for [`InternalServerError`](crate::error::InternalServerError).
 1238   1237   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
 1239   1238   
    pub struct Builder {
 1240   1239   
        pub(crate) message: ::std::option::Option<::std::string::String>,
 1241   1240   
    }
 1242   1241   
    impl Builder {
 1243   1242   
        #[allow(missing_docs)] // documentation missing in model
 1244   1243   
        pub fn message(mut self, input: ::std::string::String) -> Self {
 1245   1244   
            self.message = Some(input);
 1246   1245   
            self
 1247   1246   
        }
 1248   1247   
        /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
 1249   1248   
        ///
 1250   1249   
        /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
 1251   1250   
        ///
 1252   1251   
        pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
 1253   1252   
            self.build_enforcing_required_and_enum_traits()
 1254   1253   
        }
 1255   1254   
        fn build_enforcing_required_and_enum_traits(
 1256   1255   
            self,
 1257   1256   
        ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
 1258   1257   
            Ok(crate::error::InternalServerError {
 1259   1258   
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
 1260   1259   
            })
 1261   1260   
        }
 1262   1261   
    }
 1263   1262   
}
 1264   1263   
/// See [`ValidationException`](crate::error::ValidationException).
 1265   1264   
pub mod validation_exception {
 1266   1265   
 1267   1266   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1268   1267   
    /// Holds one variant for each of the ways the builder can fail.
 1269         -
 1270   1268   
    #[allow(clippy::enum_variant_names)]
 1271   1269   
    pub enum ConstraintViolation {
 1272   1270   
        /// `message` was not provided but it is required when building `ValidationException`.
 1273   1271   
        MissingMessage,
 1274   1272   
    }
 1275   1273   
    impl ::std::fmt::Display for ConstraintViolation {
 1276   1274   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1277   1275   
            match self {
 1278   1276   
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
 1279   1277   
            }

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

@@ -853,853 +913,912 @@
  873    873   
                    .ok_or(ConstraintViolation::MissingTopLevel)?,
  874    874   
            })
  875    875   
        }
  876    876   
    }
  877    877   
}
  878    878   
/// See [`OperationWithNestedStructureInput`](crate::input::OperationWithNestedStructureInput).
  879    879   
pub mod operation_with_nested_structure_input {
  880    880   
  881    881   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  882    882   
    /// Holds one variant for each of the ways the builder can fail.
  883         -
  884    883   
    #[allow(clippy::enum_variant_names)]
  885    884   
    pub enum ConstraintViolation {
  886    885   
        /// `top_level` was not provided but it is required when building `OperationWithNestedStructureInput`.
  887    886   
        MissingTopLevel,
  888    887   
    }
  889    888   
    impl ::std::fmt::Display for ConstraintViolation {
  890    889   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  891    890   
            match self {
  892    891   
                ConstraintViolation::MissingTopLevel => write!(f, "`top_level` was not provided but it is required when building `OperationWithNestedStructureInput`"),
  893    892   
            }
@@ -1441,1440 +1501,1499 @@
 1461   1460   
                label: self.label.ok_or(ConstraintViolation::MissingLabel)?,
 1462   1461   
            })
 1463   1462   
        }
 1464   1463   
    }
 1465   1464   
}
 1466   1465   
/// See [`EndpointWithHostLabelOperationInput`](crate::input::EndpointWithHostLabelOperationInput).
 1467   1466   
pub mod endpoint_with_host_label_operation_input {
 1468   1467   
 1469   1468   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1470   1469   
    /// Holds one variant for each of the ways the builder can fail.
 1471         -
 1472   1470   
    #[allow(clippy::enum_variant_names)]
 1473   1471   
    pub enum ConstraintViolation {
 1474   1472   
        /// `label` was not provided but it is required when building `EndpointWithHostLabelOperationInput`.
 1475   1473   
        MissingLabel,
 1476   1474   
    }
 1477   1475   
    impl ::std::fmt::Display for ConstraintViolation {
 1478   1476   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1479   1477   
            match self {
 1480   1478   
                ConstraintViolation::MissingLabel => write!(f, "`label` was not provided but it is required when building `EndpointWithHostLabelOperationInput`"),
 1481   1479   
            }

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

@@ -1469,1469 +1529,1528 @@
 1489   1489   
    /// Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
 1490   1490   
    pub fn builder() -> crate::model::complex_nested_error_data::Builder {
 1491   1491   
        crate::model::complex_nested_error_data::Builder::default()
 1492   1492   
    }
 1493   1493   
}
 1494   1494   
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
 1495   1495   
pub mod validation_exception_field {
 1496   1496   
 1497   1497   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1498   1498   
    /// Holds one variant for each of the ways the builder can fail.
 1499         -
 1500   1499   
    #[allow(clippy::enum_variant_names)]
 1501   1500   
    pub enum ConstraintViolation {
 1502   1501   
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
 1503   1502   
        MissingPath,
 1504   1503   
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
 1505   1504   
        MissingMessage,
 1506   1505   
    }
 1507   1506   
    impl ::std::fmt::Display for ConstraintViolation {
 1508   1507   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1509   1508   
            match self {
@@ -1813,1812 +1873,1871 @@
 1833   1832   
                ),
 1834   1833   
            })
 1835   1834   
        }
 1836   1835   
    }
 1837   1836   
}
 1838   1837   
/// See [`TopLevel`](crate::model::TopLevel).
 1839   1838   
pub mod top_level {
 1840   1839   
 1841   1840   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1842   1841   
    /// Holds one variant for each of the ways the builder can fail.
 1843         -
 1844   1842   
    #[allow(clippy::enum_variant_names)]
 1845   1843   
    pub enum ConstraintViolation {
 1846   1844   
        /// `dialog` was not provided but it is required when building `TopLevel`.
 1847   1845   
        MissingDialog,
 1848   1846   
    }
 1849   1847   
    impl ::std::fmt::Display for ConstraintViolation {
 1850   1848   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1851   1849   
            match self {
 1852   1850   
                ConstraintViolation::MissingDialog => write!(
 1853   1851   
                    f,

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

@@ -27,27 +87,86 @@
   47     47   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
   48     48   
        let fut = async move {
   49     49   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
   50     50   
                request.headers(),
   51     51   
                &CONTENT_TYPE_OPERATIONWITHNESTEDSTRUCTURE,
   52     52   
            ) {
   53     53   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
   54     54   
            }
   55     55   
            crate::protocol_serde::shape_operation_with_nested_structure::de_operation_with_nested_structure_http_request(request)
   56     56   
                            .await
   57         -
                            .map_err(Into::into)
   58     57   
        };
   59     58   
        use ::futures_util::future::TryFutureExt;
   60     59   
        let fut = fut.map_err(
   61     60   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
   62     61   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   63     62   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
   64     63   
            },
   65     64   
        );
   66     65   
        OperationWithNestedStructureInputFuture {
   67     66   
            inner: Box::pin(fut),
@@ -130,129 +190,188 @@
  150    149   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  151    150   
        let fut = async move {
  152    151   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  153    152   
                request.headers(),
  154    153   
                &CONTENT_TYPE_OPERATIONWITHREQUIREDMEMBERS,
  155    154   
            ) {
  156    155   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  157    156   
            }
  158    157   
            crate::protocol_serde::shape_operation_with_required_members::de_operation_with_required_members_http_request(request)
  159    158   
                            .await
  160         -
                            .map_err(Into::into)
  161    159   
        };
  162    160   
        use ::futures_util::future::TryFutureExt;
  163    161   
        let fut = fut.map_err(
  164    162   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  165    163   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  166    164   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  167    165   
            },
  168    166   
        );
  169    167   
        OperationWithRequiredMembersInputFuture {
  170    168   
            inner: Box::pin(fut),
@@ -233,231 +293,290 @@
  253    251   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  254    252   
        let fut = async move {
  255    253   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  256    254   
                request.headers(),
  257    255   
                &CONTENT_TYPE_OPERATIONWITHDEFAULTS,
  258    256   
            ) {
  259    257   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  260    258   
            }
  261    259   
            crate::protocol_serde::shape_operation_with_defaults::de_operation_with_defaults_http_request(request)
  262    260   
                            .await
  263         -
                            .map_err(Into::into)
  264    261   
        };
  265    262   
        use ::futures_util::future::TryFutureExt;
  266    263   
        let fut = fut.map_err(
  267    264   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  268    265   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  269    266   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  270    267   
            },
  271    268   
        );
  272    269   
        OperationWithDefaultsInputFuture {
  273    270   
            inner: Box::pin(fut),
@@ -336,333 +396,392 @@
  356    353   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  357    354   
        let fut = async move {
  358    355   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  359    356   
                request.headers(),
  360    357   
                &CONTENT_TYPE_CONTENTTYPEPARAMETERS,
  361    358   
            ) {
  362    359   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  363    360   
            }
  364    361   
            crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters_http_request(request)
  365    362   
                            .await
  366         -
                            .map_err(Into::into)
  367    363   
        };
  368    364   
        use ::futures_util::future::TryFutureExt;
  369    365   
        let fut = fut.map_err(
  370    366   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  371    367   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  372    368   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  373    369   
            },
  374    370   
        );
  375    371   
        ContentTypeParametersInputFuture {
  376    372   
            inner: Box::pin(fut),
@@ -439,435 +499,494 @@
  459    455   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  460    456   
        let fut = async move {
  461    457   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  462    458   
                request.headers(),
  463    459   
                &CONTENT_TYPE_PUTWITHCONTENTENCODING,
  464    460   
            ) {
  465    461   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  466    462   
            }
  467    463   
            crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding_http_request(request)
  468    464   
                            .await
  469         -
                            .map_err(Into::into)
  470    465   
        };
  471    466   
        use ::futures_util::future::TryFutureExt;
  472    467   
        let fut = fut.map_err(
  473    468   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  474    469   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  475    470   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  476    471   
            },
  477    472   
        );
  478    473   
        PutWithContentEncodingInputFuture {
  479    474   
            inner: Box::pin(fut),
@@ -542,537 +602,596 @@
  562    557   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  563    558   
        let fut = async move {
  564    559   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  565    560   
                request.headers(),
  566    561   
                &CONTENT_TYPE_HOSTWITHPATHOPERATION,
  567    562   
            ) {
  568    563   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  569    564   
            }
  570    565   
            crate::protocol_serde::shape_host_with_path_operation::de_host_with_path_operation_http_request(request)
  571    566   
                            .await
  572         -
                            .map_err(Into::into)
  573    567   
        };
  574    568   
        use ::futures_util::future::TryFutureExt;
  575    569   
        let fut = fut.map_err(
  576    570   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  577    571   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  578    572   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  579    573   
            },
  580    574   
        );
  581    575   
        HostWithPathOperationInputFuture {
  582    576   
            inner: Box::pin(fut),
@@ -645,639 +705,698 @@
  665    659   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  666    660   
        let fut = async move {
  667    661   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  668    662   
                request.headers(),
  669    663   
                &CONTENT_TYPE_ENDPOINTWITHHOSTLABELOPERATION,
  670    664   
            ) {
  671    665   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  672    666   
            }
  673    667   
            crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_request(request)
  674    668   
                            .await
  675         -
                            .map_err(Into::into)
  676    669   
        };
  677    670   
        use ::futures_util::future::TryFutureExt;
  678    671   
        let fut = fut.map_err(
  679    672   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  680    673   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  681    674   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  682    675   
            },
  683    676   
        );
  684    677   
        EndpointWithHostLabelOperationInputFuture {
  685    678   
            inner: Box::pin(fut),
@@ -750,743 +810,802 @@
  770    763   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  771    764   
                request.headers(),
  772    765   
                &CONTENT_TYPE_ENDPOINTOPERATION,
  773    766   
            ) {
  774    767   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  775    768   
            }
  776    769   
            crate::protocol_serde::shape_endpoint_operation::de_endpoint_operation_http_request(
  777    770   
                request,
  778    771   
            )
  779    772   
            .await
  780         -
            .map_err(Into::into)
  781    773   
        };
  782    774   
        use ::futures_util::future::TryFutureExt;
  783    775   
        let fut = fut.map_err(
  784    776   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  785    777   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  786    778   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  787    779   
            },
  788    780   
        );
  789    781   
        EndpointOperationInputFuture {
  790    782   
            inner: Box::pin(fut),
@@ -869,861 +931,921 @@
  889    881   
    type Future = JsonUnionsInputFuture;
  890    882   
  891    883   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  892    884   
        let fut = async move {
  893    885   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  894    886   
                request.headers(),
  895    887   
                &CONTENT_TYPE_JSONUNIONS,
  896    888   
            ) {
  897    889   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  898    890   
            }
  899         -
            crate::protocol_serde::shape_json_unions::de_json_unions_http_request(request)
  900         -
                .await
  901         -
                .map_err(Into::into)
         891  +
            crate::protocol_serde::shape_json_unions::de_json_unions_http_request(request).await
  902    892   
        };
  903    893   
        use ::futures_util::future::TryFutureExt;
  904    894   
        let fut = fut.map_err(
  905    895   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  906    896   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  907    897   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  908    898   
            },
  909    899   
        );
  910    900   
        JsonUnionsInputFuture {
  911    901   
            inner: Box::pin(fut),
@@ -990,980 +1050,1039 @@
 1010   1000   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1011   1001   
                request.headers(),
 1012   1002   
                &CONTENT_TYPE_GREETINGWITHERRORS,
 1013   1003   
            ) {
 1014   1004   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1015   1005   
            }
 1016   1006   
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_request(
 1017   1007   
                request,
 1018   1008   
            )
 1019   1009   
            .await
 1020         -
            .map_err(Into::into)
 1021   1010   
        };
 1022   1011   
        use ::futures_util::future::TryFutureExt;
 1023   1012   
        let fut = fut.map_err(
 1024   1013   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1025   1014   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1026   1015   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1027   1016   
            },
 1028   1017   
        );
 1029   1018   
        GreetingWithErrorsInputFuture {
 1030   1019   
            inner: Box::pin(fut),
@@ -1103,1092 +1163,1151 @@
 1123   1112   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1124   1113   
        let fut = async move {
 1125   1114   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1126   1115   
                request.headers(),
 1127   1116   
                &CONTENT_TYPE_SIMPLESCALARPROPERTIES,
 1128   1117   
            ) {
 1129   1118   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1130   1119   
            }
 1131   1120   
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_request(request)
 1132   1121   
                            .await
 1133         -
                            .map_err(Into::into)
 1134   1122   
        };
 1135   1123   
        use ::futures_util::future::TryFutureExt;
 1136   1124   
        let fut = fut.map_err(
 1137   1125   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1138   1126   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1139   1127   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1140   1128   
            },
 1141   1129   
        );
 1142   1130   
        SimpleScalarPropertiesInputFuture {
 1143   1131   
            inner: Box::pin(fut),
@@ -1206,1194 +1266,1253 @@
 1226   1214   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1227   1215   
        let fut = async move {
 1228   1216   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1229   1217   
                request.headers(),
 1230   1218   
                &CONTENT_TYPE_EMPTYINPUTANDEMPTYOUTPUT,
 1231   1219   
            ) {
 1232   1220   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1233   1221   
            }
 1234   1222   
            crate::protocol_serde::shape_empty_input_and_empty_output::de_empty_input_and_empty_output_http_request(request)
 1235   1223   
                            .await
 1236         -
                            .map_err(Into::into)
 1237   1224   
        };
 1238   1225   
        use ::futures_util::future::TryFutureExt;
 1239   1226   
        let fut = fut.map_err(
 1240   1227   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1241   1228   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1242   1229   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1243   1230   
            },
 1244   1231   
        );
 1245   1232   
        EmptyInputAndEmptyOutputInputFuture {
 1246   1233   
            inner: Box::pin(fut),
@@ -1311,1298 +1371,1357 @@
 1331   1318   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1332   1319   
                request.headers(),
 1333   1320   
                &CONTENT_TYPE_NOINPUTANDOUTPUT,
 1334   1321   
            ) {
 1335   1322   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1336   1323   
            }
 1337   1324   
            crate::protocol_serde::shape_no_input_and_output::de_no_input_and_output_http_request(
 1338   1325   
                request,
 1339   1326   
            )
 1340   1327   
            .await
 1341         -
            .map_err(Into::into)
 1342   1328   
        };
 1343   1329   
        use ::futures_util::future::TryFutureExt;
 1344   1330   
        let fut = fut.map_err(
 1345   1331   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1346   1332   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1347   1333   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1348   1334   
            },
 1349   1335   
        );
 1350   1336   
        NoInputAndOutputInputFuture {
 1351   1337   
            inner: Box::pin(fut),
@@ -1424,1410 +1484,1469 @@
 1444   1430   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1445   1431   
        let fut = async move {
 1446   1432   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1447   1433   
                request.headers(),
 1448   1434   
                &CONTENT_TYPE_NOINPUTANDNOOUTPUT,
 1449   1435   
            ) {
 1450   1436   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1451   1437   
            }
 1452   1438   
            crate::protocol_serde::shape_no_input_and_no_output::de_no_input_and_no_output_http_request(request)
 1453   1439   
                            .await
 1454         -
                            .map_err(Into::into)
 1455   1440   
        };
 1456   1441   
        use ::futures_util::future::TryFutureExt;
 1457   1442   
        let fut = fut.map_err(
 1458   1443   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1459   1444   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1460   1445   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1461   1446   
            },
 1462   1447   
        );
 1463   1448   
        NoInputAndNoOutputInputFuture {
 1464   1449   
            inner: Box::pin(fut),

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

@@ -1091,1091 +1151,1150 @@
 1111   1111   
    /// Creates a new builder-style object to manufacture [`NoInputAndNoOutputOutput`](crate::output::NoInputAndNoOutputOutput).
 1112   1112   
    pub fn builder() -> crate::output::no_input_and_no_output_output::Builder {
 1113   1113   
        crate::output::no_input_and_no_output_output::Builder::default()
 1114   1114   
    }
 1115   1115   
}
 1116   1116   
/// See [`OperationWithNestedStructureOutput`](crate::output::OperationWithNestedStructureOutput).
 1117   1117   
pub mod operation_with_nested_structure_output {
 1118   1118   
 1119   1119   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1120   1120   
    /// Holds one variant for each of the ways the builder can fail.
 1121         -
 1122   1121   
    #[allow(clippy::enum_variant_names)]
 1123   1122   
    pub enum ConstraintViolation {
 1124   1123   
        /// `dialog` was not provided but it is required when building `OperationWithNestedStructureOutput`.
 1125   1124   
        MissingDialog,
 1126   1125   
    }
 1127   1126   
    impl ::std::fmt::Display for ConstraintViolation {
 1128   1127   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1129   1128   
            match self {
 1130   1129   
                ConstraintViolation::MissingDialog => write!(f, "`dialog` was not provided but it is required when building `OperationWithNestedStructureOutput`"),
 1131   1130   
            }
@@ -1173,1172 +1233,1231 @@
 1193   1192   
                ),
 1194   1193   
            })
 1195   1194   
        }
 1196   1195   
    }
 1197   1196   
}
 1198   1197   
/// See [`OperationWithRequiredMembersOutput`](crate::output::OperationWithRequiredMembersOutput).
 1199   1198   
pub mod operation_with_required_members_output {
 1200   1199   
 1201   1200   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1202   1201   
    /// Holds one variant for each of the ways the builder can fail.
 1203         -
 1204   1202   
    #[allow(clippy::enum_variant_names)]
 1205   1203   
    pub enum ConstraintViolation {
 1206   1204   
        /// `required_string` was not provided but it is required when building `OperationWithRequiredMembersOutput`.
 1207   1205   
        MissingRequiredString,
 1208   1206   
        /// `required_boolean` was not provided but it is required when building `OperationWithRequiredMembersOutput`.
 1209   1207   
        MissingRequiredBoolean,
 1210   1208   
        /// `required_list` was not provided but it is required when building `OperationWithRequiredMembersOutput`.
 1211   1209   
        MissingRequiredList,
 1212   1210   
        /// `required_timestamp` was not provided but it is required when building `OperationWithRequiredMembersOutput`.
 1213   1211   
        MissingRequiredTimestamp,

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

@@ -1524,1524 +1637,1635 @@
 1544   1544   
            }
 1545   1545   
            .into()
 1546   1546   
        })
 1547   1547   
    }
 1548   1548   
}
 1549   1549   
/// See [`InternalServerError`](crate::error::InternalServerError).
 1550   1550   
pub mod internal_server_error {
 1551   1551   
 1552   1552   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1553   1553   
    /// Holds one variant for each of the ways the builder can fail.
 1554         -
 1555   1554   
    #[allow(clippy::enum_variant_names)]
 1556   1555   
    pub enum ConstraintViolation {
 1557   1556   
        /// `message` was not provided but it is required when building `InternalServerError`.
 1558   1557   
        MissingMessage,
 1559   1558   
    }
 1560   1559   
    impl ::std::fmt::Display for ConstraintViolation {
 1561   1560   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1562   1561   
            match self {
 1563   1562   
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
 1564   1563   
            }
 1565   1564   
        }
 1566   1565   
    }
 1567   1566   
    impl ::std::error::Error for ConstraintViolation {}
 1568   1567   
    impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
 1569   1568   
        type Error = ConstraintViolation;
 1570   1569   
 1571   1570   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
 1572   1571   
            builder.build()
 1573   1572   
        }
 1574   1573   
    }
 1575   1574   
    /// A builder for [`InternalServerError`](crate::error::InternalServerError).
 1576   1575   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
 1577   1576   
    pub struct Builder {
 1578   1577   
        pub(crate) message: ::std::option::Option<::std::string::String>,
 1579   1578   
    }
 1580   1579   
    impl Builder {
 1581   1580   
        #[allow(missing_docs)] // documentation missing in model
 1582   1581   
        pub fn message(mut self, input: ::std::string::String) -> Self {
 1583   1582   
            self.message = Some(input);
 1584   1583   
            self
 1585   1584   
        }
 1586   1585   
        /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
 1587   1586   
        ///
 1588   1587   
        /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
 1589   1588   
        ///
 1590   1589   
        pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
 1591   1590   
            self.build_enforcing_required_and_enum_traits()
 1592   1591   
        }
 1593   1592   
        fn build_enforcing_required_and_enum_traits(
 1594   1593   
            self,
 1595   1594   
        ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
 1596   1595   
            Ok(crate::error::InternalServerError {
 1597   1596   
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
 1598   1597   
            })
 1599   1598   
        }
 1600   1599   
    }
 1601   1600   
}
 1602   1601   
/// See [`ValidationException`](crate::error::ValidationException).
 1603   1602   
pub mod validation_exception {
 1604   1603   
 1605   1604   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1606   1605   
    /// Holds one variant for each of the ways the builder can fail.
 1607         -
 1608   1606   
    #[allow(clippy::enum_variant_names)]
 1609   1607   
    pub enum ConstraintViolation {
 1610   1608   
        /// `message` was not provided but it is required when building `ValidationException`.
 1611   1609   
        MissingMessage,
 1612   1610   
    }
 1613   1611   
    impl ::std::fmt::Display for ConstraintViolation {
 1614   1612   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1615   1613   
            match self {
 1616   1614   
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
 1617   1615   
            }

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

@@ -1695,1695 +1755,1754 @@
 1715   1715   
                label: self.label.ok_or(ConstraintViolation::MissingLabel)?,
 1716   1716   
            })
 1717   1717   
        }
 1718   1718   
    }
 1719   1719   
}
 1720   1720   
/// See [`EndpointWithHostLabelOperationInput`](crate::input::EndpointWithHostLabelOperationInput).
 1721   1721   
pub mod endpoint_with_host_label_operation_input {
 1722   1722   
 1723   1723   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1724   1724   
    /// Holds one variant for each of the ways the builder can fail.
 1725         -
 1726   1725   
    #[allow(clippy::enum_variant_names)]
 1727   1726   
    pub enum ConstraintViolation {
 1728   1727   
        /// `label` was not provided but it is required when building `EndpointWithHostLabelOperationInput`.
 1729   1728   
        MissingLabel,
 1730   1729   
    }
 1731   1730   
    impl ::std::fmt::Display for ConstraintViolation {
 1732   1731   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1733   1732   
            match self {
 1734   1733   
                ConstraintViolation::MissingLabel => write!(f, "`label` was not provided but it is required when building `EndpointWithHostLabelOperationInput`"),
 1735   1734   
            }

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

@@ -1299,1299 +1359,1358 @@
 1319   1319   
    /// Creates a new builder-style object to manufacture [`EmptyStruct`](crate::model::EmptyStruct).
 1320   1320   
    pub fn builder() -> crate::model::empty_struct::Builder {
 1321   1321   
        crate::model::empty_struct::Builder::default()
 1322   1322   
    }
 1323   1323   
}
 1324   1324   
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
 1325   1325   
pub mod validation_exception_field {
 1326   1326   
 1327   1327   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1328   1328   
    /// Holds one variant for each of the ways the builder can fail.
 1329         -
 1330   1329   
    #[allow(clippy::enum_variant_names)]
 1331   1330   
    pub enum ConstraintViolation {
 1332   1331   
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
 1333   1332   
        MissingPath,
 1334   1333   
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
 1335   1334   
        MissingMessage,
 1336   1335   
    }
 1337   1336   
    impl ::std::fmt::Display for ConstraintViolation {
 1338   1337   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
 1339   1338   
            match self {

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

@@ -27,27 +87,86 @@
   47     47   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
   48     48   
        let fut = async move {
   49     49   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
   50     50   
                request.headers(),
   51     51   
                &CONTENT_TYPE_CONTENTTYPEPARAMETERS,
   52     52   
            ) {
   53     53   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
   54     54   
            }
   55     55   
            crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters_http_request(request)
   56     56   
                            .await
   57         -
                            .map_err(Into::into)
   58     57   
        };
   59     58   
        use ::futures_util::future::TryFutureExt;
   60     59   
        let fut = fut.map_err(
   61     60   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
   62     61   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   63     62   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
   64     63   
            },
   65     64   
        );
   66     65   
        ContentTypeParametersInputFuture {
   67     66   
            inner: Box::pin(fut),
@@ -130,129 +190,188 @@
  150    149   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  151    150   
        let fut = async move {
  152    151   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  153    152   
                request.headers(),
  154    153   
                &CONTENT_TYPE_PUTWITHCONTENTENCODING,
  155    154   
            ) {
  156    155   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  157    156   
            }
  158    157   
            crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding_http_request(request)
  159    158   
                            .await
  160         -
                            .map_err(Into::into)
  161    159   
        };
  162    160   
        use ::futures_util::future::TryFutureExt;
  163    161   
        let fut = fut.map_err(
  164    162   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  165    163   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  166    164   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  167    165   
            },
  168    166   
        );
  169    167   
        PutWithContentEncodingInputFuture {
  170    168   
            inner: Box::pin(fut),
@@ -235,233 +295,292 @@
  255    253   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  256    254   
                request.headers(),
  257    255   
                &CONTENT_TYPE_FRACTIONALSECONDS,
  258    256   
            ) {
  259    257   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  260    258   
            }
  261    259   
            crate::protocol_serde::shape_fractional_seconds::de_fractional_seconds_http_request(
  262    260   
                request,
  263    261   
            )
  264    262   
            .await
  265         -
            .map_err(Into::into)
  266    263   
        };
  267    264   
        use ::futures_util::future::TryFutureExt;
  268    265   
        let fut = fut.map_err(
  269    266   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  270    267   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  271    268   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  272    269   
            },
  273    270   
        );
  274    271   
        FractionalSecondsInputFuture {
  275    272   
            inner: Box::pin(fut),
@@ -356,353 +416,412 @@
  376    373   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  377    374   
        let fut = async move {
  378    375   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  379    376   
                request.headers(),
  380    377   
                &CONTENT_TYPE_DATETIMEOFFSETS,
  381    378   
            ) {
  382    379   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  383    380   
            }
  384    381   
            crate::protocol_serde::shape_datetime_offsets::de_datetime_offsets_http_request(request)
  385    382   
                .await
  386         -
                .map_err(Into::into)
  387    383   
        };
  388    384   
        use ::futures_util::future::TryFutureExt;
  389    385   
        let fut = fut.map_err(
  390    386   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  391    387   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  392    388   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  393    389   
            },
  394    390   
        );
  395    391   
        DatetimeOffsetsInputFuture {
  396    392   
            inner: Box::pin(fut),
@@ -476,472 +536,531 @@
  496    492   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  497    493   
        let fut = async move {
  498    494   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  499    495   
                request.headers(),
  500    496   
                &CONTENT_TYPE_HOSTWITHPATHOPERATION,
  501    497   
            ) {
  502    498   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  503    499   
            }
  504    500   
            crate::protocol_serde::shape_host_with_path_operation::de_host_with_path_operation_http_request(request)
  505    501   
                            .await
  506         -
                            .map_err(Into::into)
  507    502   
        };
  508    503   
        use ::futures_util::future::TryFutureExt;
  509    504   
        let fut = fut.map_err(
  510    505   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  511    506   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  512    507   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  513    508   
            },
  514    509   
        );
  515    510   
        HostWithPathOperationInputFuture {
  516    511   
            inner: Box::pin(fut),
@@ -579,574 +639,633 @@
  599    594   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  600    595   
        let fut = async move {
  601    596   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  602    597   
                request.headers(),
  603    598   
                &CONTENT_TYPE_ENDPOINTWITHHOSTLABELOPERATION,
  604    599   
            ) {
  605    600   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  606    601   
            }
  607    602   
            crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_request(request)
  608    603   
                            .await
  609         -
                            .map_err(Into::into)
  610    604   
        };
  611    605   
        use ::futures_util::future::TryFutureExt;
  612    606   
        let fut = fut.map_err(
  613    607   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  614    608   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  615    609   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  616    610   
            },
  617    611   
        );
  618    612   
        EndpointWithHostLabelOperationInputFuture {
  619    613   
            inner: Box::pin(fut),
@@ -684,678 +744,737 @@
  704    698   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  705    699   
                request.headers(),
  706    700   
                &CONTENT_TYPE_ENDPOINTOPERATION,
  707    701   
            ) {
  708    702   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  709    703   
            }
  710    704   
            crate::protocol_serde::shape_endpoint_operation::de_endpoint_operation_http_request(
  711    705   
                request,
  712    706   
            )
  713    707   
            .await
  714         -
            .map_err(Into::into)
  715    708   
        };
  716    709   
        use ::futures_util::future::TryFutureExt;
  717    710   
        let fut = fut.map_err(
  718    711   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  719    712   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  720    713   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  721    714   
            },
  722    715   
        );
  723    716   
        EndpointOperationInputFuture {
  724    717   
            inner: Box::pin(fut),
@@ -803,796 +865,856 @@
  823    816   
    type Future = JsonUnionsInputFuture;
  824    817   
  825    818   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  826    819   
        let fut = async move {
  827    820   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  828    821   
                request.headers(),
  829    822   
                &CONTENT_TYPE_JSONUNIONS,
  830    823   
            ) {
  831    824   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  832    825   
            }
  833         -
            crate::protocol_serde::shape_json_unions::de_json_unions_http_request(request)
  834         -
                .await
  835         -
                .map_err(Into::into)
         826  +
            crate::protocol_serde::shape_json_unions::de_json_unions_http_request(request).await
  836    827   
        };
  837    828   
        use ::futures_util::future::TryFutureExt;
  838    829   
        let fut = fut.map_err(
  839    830   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  840    831   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  841    832   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  842    833   
            },
  843    834   
        );
  844    835   
        JsonUnionsInputFuture {
  845    836   
            inner: Box::pin(fut),
@@ -924,915 +984,974 @@
  944    935   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  945    936   
                request.headers(),
  946    937   
                &CONTENT_TYPE_GREETINGWITHERRORS,
  947    938   
            ) {
  948    939   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  949    940   
            }
  950    941   
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_request(
  951    942   
                request,
  952    943   
            )
  953    944   
            .await
  954         -
            .map_err(Into::into)
  955    945   
        };
  956    946   
        use ::futures_util::future::TryFutureExt;
  957    947   
        let fut = fut.map_err(
  958    948   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  959    949   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  960    950   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  961    951   
            },
  962    952   
        );
  963    953   
        GreetingWithErrorsInputFuture {
  964    954   
            inner: Box::pin(fut),
@@ -1037,1027 +1097,1086 @@
 1057   1047   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1058   1048   
        let fut = async move {
 1059   1049   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1060   1050   
                request.headers(),
 1061   1051   
                &CONTENT_TYPE_SPARSENULLSOPERATION,
 1062   1052   
            ) {
 1063   1053   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1064   1054   
            }
 1065   1055   
            crate::protocol_serde::shape_sparse_nulls_operation::de_sparse_nulls_operation_http_request(request)
 1066   1056   
                            .await
 1067         -
                            .map_err(Into::into)
 1068   1057   
        };
 1069   1058   
        use ::futures_util::future::TryFutureExt;
 1070   1059   
        let fut = fut.map_err(
 1071   1060   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1072   1061   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1073   1062   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1074   1063   
            },
 1075   1064   
        );
 1076   1065   
        SparseNullsOperationInputFuture {
 1077   1066   
            inner: Box::pin(fut),
@@ -1140,1129 +1200,1188 @@
 1160   1149   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1161   1150   
        let fut = async move {
 1162   1151   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1163   1152   
                request.headers(),
 1164   1153   
                &CONTENT_TYPE_NULLOPERATION,
 1165   1154   
            ) {
 1166   1155   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1167   1156   
            }
 1168   1157   
            crate::protocol_serde::shape_null_operation::de_null_operation_http_request(request)
 1169   1158   
                .await
 1170         -
                .map_err(Into::into)
 1171   1159   
        };
 1172   1160   
        use ::futures_util::future::TryFutureExt;
 1173   1161   
        let fut = fut.map_err(
 1174   1162   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1175   1163   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1176   1164   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1177   1165   
            },
 1178   1166   
        );
 1179   1167   
        NullOperationInputFuture {
 1180   1168   
            inner: Box::pin(fut),
@@ -1254,1242 +1316,1302 @@
 1274   1262   
    type Future = JsonEnumsInputFuture;
 1275   1263   
 1276   1264   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1277   1265   
        let fut = async move {
 1278   1266   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1279   1267   
                request.headers(),
 1280   1268   
                &CONTENT_TYPE_JSONENUMS,
 1281   1269   
            ) {
 1282   1270   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1283   1271   
            }
 1284         -
            crate::protocol_serde::shape_json_enums::de_json_enums_http_request(request)
 1285         -
                .await
 1286         -
                .map_err(Into::into)
        1272  +
            crate::protocol_serde::shape_json_enums::de_json_enums_http_request(request).await
 1287   1273   
        };
 1288   1274   
        use ::futures_util::future::TryFutureExt;
 1289   1275   
        let fut = fut.map_err(
 1290   1276   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1291   1277   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1292   1278   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1293   1279   
            },
 1294   1280   
        );
 1295   1281   
        JsonEnumsInputFuture {
 1296   1282   
            inner: Box::pin(fut),
@@ -1373,1359 +1433,1418 @@
 1393   1379   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1394   1380   
        let fut = async move {
 1395   1381   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1396   1382   
                request.headers(),
 1397   1383   
                &CONTENT_TYPE_PUTANDGETINLINEDOCUMENTS,
 1398   1384   
            ) {
 1399   1385   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1400   1386   
            }
 1401   1387   
            crate::protocol_serde::shape_put_and_get_inline_documents::de_put_and_get_inline_documents_http_request(request)
 1402   1388   
                            .await
 1403         -
                            .map_err(Into::into)
 1404   1389   
        };
 1405   1390   
        use ::futures_util::future::TryFutureExt;
 1406   1391   
        let fut = fut.map_err(
 1407   1392   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1408   1393   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1409   1394   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1410   1395   
            },
 1411   1396   
        );
 1412   1397   
        PutAndGetInlineDocumentsInputFuture {
 1413   1398   
            inner: Box::pin(fut),
@@ -1476,1461 +1536,1520 @@
 1496   1481   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1497   1482   
        let fut = async move {
 1498   1483   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1499   1484   
                request.headers(),
 1500   1485   
                &CONTENT_TYPE_OPERATIONWITHOPTIONALINPUTOUTPUT,
 1501   1486   
            ) {
 1502   1487   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1503   1488   
            }
 1504   1489   
            crate::protocol_serde::shape_operation_with_optional_input_output::de_operation_with_optional_input_output_http_request(request)
 1505   1490   
                            .await
 1506         -
                            .map_err(Into::into)
 1507   1491   
        };
 1508   1492   
        use ::futures_util::future::TryFutureExt;
 1509   1493   
        let fut = fut.map_err(
 1510   1494   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1511   1495   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1512   1496   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1513   1497   
            },
 1514   1498   
        );
 1515   1499   
        OperationWithOptionalInputOutputInputFuture {
 1516   1500   
            inner: Box::pin(fut),
@@ -1579,1563 +1639,1622 @@
 1599   1583   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1600   1584   
        let fut = async move {
 1601   1585   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1602   1586   
                request.headers(),
 1603   1587   
                &CONTENT_TYPE_SIMPLESCALARPROPERTIES,
 1604   1588   
            ) {
 1605   1589   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1606   1590   
            }
 1607   1591   
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_request(request)
 1608   1592   
                            .await
 1609         -
                            .map_err(Into::into)
 1610   1593   
        };
 1611   1594   
        use ::futures_util::future::TryFutureExt;
 1612   1595   
        let fut = fut.map_err(
 1613   1596   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1614   1597   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1615   1598   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1616   1599   
            },
 1617   1600   
        );
 1618   1601   
        SimpleScalarPropertiesInputFuture {
 1619   1602   
            inner: Box::pin(fut),
@@ -1682,1665 +1742,1724 @@
 1702   1685   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1703   1686   
        let fut = async move {
 1704   1687   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1705   1688   
                request.headers(),
 1706   1689   
                &CONTENT_TYPE_KITCHENSINKOPERATION,
 1707   1690   
            ) {
 1708   1691   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1709   1692   
            }
 1710   1693   
            crate::protocol_serde::shape_kitchen_sink_operation::de_kitchen_sink_operation_http_request(request)
 1711   1694   
                            .await
 1712         -
                            .map_err(Into::into)
 1713   1695   
        };
 1714   1696   
        use ::futures_util::future::TryFutureExt;
 1715   1697   
        let fut = fut.map_err(
 1716   1698   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1717   1699   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1718   1700   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1719   1701   
            },
 1720   1702   
        );
 1721   1703   
        KitchenSinkOperationInputFuture {
 1722   1704   
            inner: Box::pin(fut),
@@ -1785,1767 +1845,1826 @@
 1805   1787   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1806   1788   
        let fut = async move {
 1807   1789   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1808   1790   
                request.headers(),
 1809   1791   
                &CONTENT_TYPE_EMPTYOPERATION,
 1810   1792   
            ) {
 1811   1793   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
 1812   1794   
            }
 1813   1795   
            crate::protocol_serde::shape_empty_operation::de_empty_operation_http_request(request)
 1814   1796   
                .await
 1815         -
                .map_err(Into::into)
 1816   1797   
        };
 1817   1798   
        use ::futures_util::future::TryFutureExt;
 1818   1799   
        let fut = fut.map_err(
 1819   1800   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
 1820   1801   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1821   1802   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
 1822   1803   
            },
 1823   1804   
        );
 1824   1805   
        EmptyOperationInputFuture {
 1825   1806   
            inner: Box::pin(fut),

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

@@ -502,502 +615,613 @@
  522    522   
            }
  523    523   
            .into()
  524    524   
        })
  525    525   
    }
  526    526   
}
  527    527   
/// See [`InternalServerError`](crate::error::InternalServerError).
  528    528   
pub mod internal_server_error {
  529    529   
  530    530   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  531    531   
    /// Holds one variant for each of the ways the builder can fail.
  532         -
  533    532   
    #[allow(clippy::enum_variant_names)]
  534    533   
    pub enum ConstraintViolation {
  535    534   
        /// `message` was not provided but it is required when building `InternalServerError`.
  536    535   
        MissingMessage,
  537    536   
    }
  538    537   
    impl ::std::fmt::Display for ConstraintViolation {
  539    538   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  540    539   
            match self {
  541    540   
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
  542    541   
            }
  543    542   
        }
  544    543   
    }
  545    544   
    impl ::std::error::Error for ConstraintViolation {}
  546    545   
    impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
  547    546   
        type Error = ConstraintViolation;
  548    547   
  549    548   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  550    549   
            builder.build()
  551    550   
        }
  552    551   
    }
  553    552   
    /// A builder for [`InternalServerError`](crate::error::InternalServerError).
  554    553   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  555    554   
    pub struct Builder {
  556    555   
        pub(crate) message: ::std::option::Option<::std::string::String>,
  557    556   
    }
  558    557   
    impl Builder {
  559    558   
        #[allow(missing_docs)] // documentation missing in model
  560    559   
        pub fn message(mut self, input: ::std::string::String) -> Self {
  561    560   
            self.message = Some(input);
  562    561   
            self
  563    562   
        }
  564    563   
        /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
  565    564   
        ///
  566    565   
        /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
  567    566   
        ///
  568    567   
        pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
  569    568   
            self.build_enforcing_required_and_enum_traits()
  570    569   
        }
  571    570   
        fn build_enforcing_required_and_enum_traits(
  572    571   
            self,
  573    572   
        ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
  574    573   
            Ok(crate::error::InternalServerError {
  575    574   
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  576    575   
            })
  577    576   
        }
  578    577   
    }
  579    578   
}
  580    579   
/// See [`ValidationException`](crate::error::ValidationException).
  581    580   
pub mod validation_exception {
  582    581   
  583    582   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  584    583   
    /// Holds one variant for each of the ways the builder can fail.
  585         -
  586    584   
    #[allow(clippy::enum_variant_names)]
  587    585   
    pub enum ConstraintViolation {
  588    586   
        /// `message` was not provided but it is required when building `ValidationException`.
  589    587   
        MissingMessage,
  590    588   
    }
  591    589   
    impl ::std::fmt::Display for ConstraintViolation {
  592    590   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  593    591   
            match self {
  594    592   
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
  595    593   
            }

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

@@ -604,604 +664,663 @@
  624    624   
                    .ok_or(ConstraintViolation::MissingRequiredHeaderSet)?,
  625    625   
            })
  626    626   
        }
  627    627   
    }
  628    628   
}
  629    629   
/// See [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput).
  630    630   
pub mod required_header_collection_operation_input {
  631    631   
  632    632   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  633    633   
    /// Holds one variant for each of the ways the builder can fail.
  634         -
  635    634   
    #[allow(clippy::enum_variant_names)]
  636    635   
    pub enum ConstraintViolation {
  637    636   
        /// `required_header_list` was not provided but it is required when building `RequiredHeaderCollectionOperationInput`.
  638    637   
        MissingRequiredHeaderList,
  639    638   
        /// `required_header_set` was not provided but it is required when building `RequiredHeaderCollectionOperationInput`.
  640    639   
        MissingRequiredHeaderSet,
  641    640   
    }
  642    641   
    impl ::std::fmt::Display for ConstraintViolation {
  643    642   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  644    643   
            match self {

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

@@ -577,577 +637,636 @@
  597    597   
    /// Creates a new builder-style object to manufacture [`EmptyStructure`](crate::model::EmptyStructure).
  598    598   
    pub fn builder() -> crate::model::empty_structure::Builder {
  599    599   
        crate::model::empty_structure::Builder::default()
  600    600   
    }
  601    601   
}
  602    602   
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  603    603   
pub mod validation_exception_field {
  604    604   
  605    605   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  606    606   
    /// Holds one variant for each of the ways the builder can fail.
  607         -
  608    607   
    #[allow(clippy::enum_variant_names)]
  609    608   
    pub enum ConstraintViolation {
  610    609   
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
  611    610   
        MissingPath,
  612    611   
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
  613    612   
        MissingMessage,
  614    613   
    }
  615    614   
    impl ::std::fmt::Display for ConstraintViolation {
  616    615   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  617    616   
            match self {
@@ -778,777 +838,836 @@
  798    797   
                    .ok_or(ConstraintViolation::MissingRequiredInnerMostShape)?,
  799    798   
            })
  800    799   
        }
  801    800   
    }
  802    801   
}
  803    802   
/// See [`InnerShape`](crate::model::InnerShape).
  804    803   
pub mod inner_shape {
  805    804   
  806    805   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  807    806   
    /// Holds one variant for each of the ways the builder can fail.
  808         -
  809    807   
    #[allow(clippy::enum_variant_names)]
  810    808   
    pub enum ConstraintViolation {
  811    809   
        /// `required_inner_most_shape` was not provided but it is required when building `InnerShape`.
  812    810   
        MissingRequiredInnerMostShape,
  813    811   
    }
  814    812   
    impl ::std::fmt::Display for ConstraintViolation {
  815    813   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  816    814   
            match self {
  817    815   
                ConstraintViolation::MissingRequiredInnerMostShape => write!(f, "`required_inner_most_shape` was not provided but it is required when building `InnerShape`"),
  818    816   
            }
@@ -1149,1147 +1209,1206 @@
 1169   1167   
                a_union: self.a_union.ok_or(ConstraintViolation::MissingAUnion)?,
 1170   1168   
            })
 1171   1169   
        }
 1172   1170   
    }
 1173   1171   
}
 1174   1172   
/// See [`InnermostShape`](crate::model::InnermostShape).
 1175   1173   
pub mod innermost_shape {
 1176   1174   
 1177   1175   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
 1178   1176   
    /// Holds one variant for each of the ways the builder can fail.
 1179         -
 1180   1177   
    #[allow(clippy::enum_variant_names)]
 1181   1178   
    pub enum ConstraintViolation {
 1182   1179   
        /// `a_string` was not provided but it is required when building `InnermostShape`.
 1183   1180   
        MissingAString,
 1184   1181   
        /// `a_boolean` was not provided but it is required when building `InnermostShape`.
 1185   1182   
        MissingABoolean,
 1186   1183   
        /// `a_byte` was not provided but it is required when building `InnermostShape`.
 1187   1184   
        MissingAByte,
 1188   1185   
        /// `a_short` was not provided but it is required when building `InnermostShape`.
 1189   1186   
        MissingAShort,

tmp-codegen-diff/codegen-server-test-python/misc/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_RESPONSECODEDEFAULTOPERATION,
   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_response_code_default_operation::de_response_code_default_operation_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   
        );
@@ -122,121 +182,180 @@
  142    141   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  143    142   
        let fut = async move {
  144    143   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  145    144   
                request.headers(),
  146    145   
                &CONTENT_TYPE_RESPONSECODEHTTPFALLBACKOPERATION,
  147    146   
            ) {
  148    147   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  149    148   
            }
  150    149   
            crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_request(request)
  151    150   
                            .await
  152         -
                            .map_err(Into::into)
  153    151   
        };
  154    152   
        use ::futures_util::future::TryFutureExt;
  155    153   
        let fut = fut.map_err(
  156    154   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  157    155   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  158    156   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  159    157   
                    e,
  160    158   
                )
  161    159   
            },
  162    160   
        );
@@ -222,220 +282,279 @@
  242    240   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  243    241   
        let fut = async move {
  244    242   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  245    243   
                request.headers(),
  246    244   
                &CONTENT_TYPE_RESPONSECODEREQUIREDOPERATION,
  247    245   
            ) {
  248    246   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  249    247   
            }
  250    248   
            crate::protocol_serde::shape_response_code_required_operation::de_response_code_required_operation_http_request(request)
  251    249   
                            .await
  252         -
                            .map_err(Into::into)
  253    250   
        };
  254    251   
        use ::futures_util::future::TryFutureExt;
  255    252   
        let fut = fut.map_err(
  256    253   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  257    254   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  258    255   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  259    256   
                    e,
  260    257   
                )
  261    258   
            },
  262    259   
        );
@@ -322,319 +382,378 @@
  342    339   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  343    340   
        let fut = async move {
  344    341   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  345    342   
                request.headers(),
  346    343   
                &CONTENT_TYPE_REQUIREDHEADERCOLLECTIONOPERATION,
  347    344   
            ) {
  348    345   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  349    346   
            }
  350    347   
            crate::protocol_serde::shape_required_header_collection_operation::de_required_header_collection_operation_http_request(request)
  351    348   
                            .await
  352         -
                            .map_err(Into::into)
  353    349   
        };
  354    350   
        use ::futures_util::future::TryFutureExt;
  355    351   
        let fut = fut.map_err(
  356    352   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  357    353   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  358    354   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  359    355   
                    e,
  360    356   
                )
  361    357   
            },
  362    358   
        );
@@ -422,418 +482,477 @@
  442    438   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  443    439   
        let fut = async move {
  444    440   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  445    441   
                request.headers(),
  446    442   
                &CONTENT_TYPE_REQUIREDINNERSHAPEOPERATION,
  447    443   
            ) {
  448    444   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  449    445   
            }
  450    446   
            crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation_http_request(request)
  451    447   
                            .await
  452         -
                            .map_err(Into::into)
  453    448   
        };
  454    449   
        use ::futures_util::future::TryFutureExt;
  455    450   
        let fut = fut.map_err(
  456    451   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  457    452   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  458    453   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  459    454   
                    e,
  460    455   
                )
  461    456   
            },
  462    457   
        );
@@ -522,517 +582,576 @@
  542    537   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  543    538   
        let fut = async move {
  544    539   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  545    540   
                request.headers(),
  546    541   
                &CONTENT_TYPE_TYPECOMPLEXITYOPERATION,
  547    542   
            ) {
  548    543   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  549    544   
            }
  550    545   
            crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_operation_http_request(request)
  551    546   
                            .await
  552         -
                            .map_err(Into::into)
  553    547   
        };
  554    548   
        use ::futures_util::future::TryFutureExt;
  555    549   
        let fut = fut.map_err(
  556    550   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  557    551   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  558    552   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  559    553   
                    e,
  560    554   
                )
  561    555   
            },
  562    556   
        );

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

@@ -368,368 +487,485 @@
  388    388   
        ) -> crate::output::ResponseCodeHttpFallbackOperationOutput {
  389    389   
            crate::output::ResponseCodeHttpFallbackOperationOutput {}
  390    390   
        }
  391    391   
    }
  392    392   
}
  393    393   
/// See [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput).
  394    394   
pub mod response_code_required_operation_output {
  395    395   
  396    396   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  397    397   
    /// Holds one variant for each of the ways the builder can fail.
  398         -
  399    398   
    #[allow(clippy::enum_variant_names)]
  400    399   
    pub enum ConstraintViolation {
  401    400   
        /// `response_code` was not provided but it is required when building `ResponseCodeRequiredOperationOutput`.
  402    401   
        MissingResponseCode,
  403    402   
    }
  404    403   
    impl ::std::fmt::Display for ConstraintViolation {
  405    404   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  406    405   
            match self {
  407    406   
                ConstraintViolation::MissingResponseCode => write!(f, "`response_code` was not provided but it is required when building `ResponseCodeRequiredOperationOutput`"),
  408    407   
            }
  409    408   
        }
  410    409   
    }
  411    410   
    impl ::std::error::Error for ConstraintViolation {}
  412    411   
    impl ::std::convert::TryFrom<Builder> for crate::output::ResponseCodeRequiredOperationOutput {
  413    412   
        type Error = ConstraintViolation;
  414    413   
  415    414   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  416    415   
            builder.build()
  417    416   
        }
  418    417   
    }
  419    418   
    /// A builder for [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput).
  420    419   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  421    420   
    pub struct Builder {
  422    421   
        pub(crate) response_code: ::std::option::Option<i32>,
  423    422   
    }
  424    423   
    impl Builder {
  425    424   
        #[allow(missing_docs)] // documentation missing in model
  426    425   
        pub fn response_code(mut self, input: i32) -> Self {
  427    426   
            self.response_code = Some(input);
  428    427   
            self
  429    428   
        }
  430    429   
        /// Consumes the builder and constructs a [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput).
  431    430   
        ///
  432    431   
        /// The builder fails to construct a [`ResponseCodeRequiredOperationOutput`](crate::output::ResponseCodeRequiredOperationOutput) if you do not provide a value for all non-`Option`al members.
  433    432   
        ///
  434    433   
        pub fn build(
  435    434   
            self,
  436    435   
        ) -> Result<crate::output::ResponseCodeRequiredOperationOutput, ConstraintViolation>
  437    436   
        {
  438    437   
            self.build_enforcing_required_and_enum_traits()
  439    438   
        }
  440    439   
        fn build_enforcing_required_and_enum_traits(
  441    440   
            self,
  442    441   
        ) -> Result<crate::output::ResponseCodeRequiredOperationOutput, ConstraintViolation>
  443    442   
        {
  444    443   
            Ok(crate::output::ResponseCodeRequiredOperationOutput {
  445    444   
                response_code: self
  446    445   
                    .response_code
  447    446   
                    .ok_or(ConstraintViolation::MissingResponseCode)?,
  448    447   
            })
  449    448   
        }
  450    449   
    }
  451    450   
}
  452    451   
/// See [`RequiredHeaderCollectionOperationOutput`](crate::output::RequiredHeaderCollectionOperationOutput).
  453    452   
pub mod required_header_collection_operation_output {
  454    453   
  455    454   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  456    455   
    /// Holds one variant for each of the ways the builder can fail.
  457         -
  458    456   
    #[allow(clippy::enum_variant_names)]
  459    457   
    pub enum ConstraintViolation {
  460    458   
        /// `required_header_list` was not provided but it is required when building `RequiredHeaderCollectionOperationOutput`.
  461    459   
        MissingRequiredHeaderList,
  462    460   
        /// `required_header_set` was not provided but it is required when building `RequiredHeaderCollectionOperationOutput`.
  463    461   
        MissingRequiredHeaderSet,
  464    462   
    }
  465    463   
    impl ::std::fmt::Display for ConstraintViolation {
  466    464   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  467    465   
            match self {