Server Test

Server Test

rev. ee474c7509d7728618c23068f3741e8e5b339ef9

Files changed:

tmp-codegen-diff/codegen-server-test/s3-http0x/rust-server-codegen/src/output.rs

@@ -0,1 +0,351 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[derive(
           4  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
           5  +
)]
           6  +
pub struct GetObjectOutput {}
           7  +
impl GetObjectOutput {
           8  +
    /// Creates a new builder-style object to manufacture [`GetObjectOutput`](crate::output::GetObjectOutput).
           9  +
    pub fn builder() -> crate::output::get_object_output::Builder {
          10  +
        crate::output::get_object_output::Builder::default()
          11  +
    }
          12  +
}
          13  +
          14  +
#[allow(missing_docs)] // documentation missing in model
          15  +
#[derive(
          16  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          17  +
)]
          18  +
pub struct DeleteObjectTaggingOutput {
          19  +
    #[allow(missing_docs)] // documentation missing in model
          20  +
    pub version_id: ::std::option::Option<::std::string::String>,
          21  +
}
          22  +
impl DeleteObjectTaggingOutput {
          23  +
    #[allow(missing_docs)] // documentation missing in model
          24  +
    pub fn version_id(&self) -> ::std::option::Option<&str> {
          25  +
        self.version_id.as_deref()
          26  +
    }
          27  +
}
          28  +
impl DeleteObjectTaggingOutput {
          29  +
    /// Creates a new builder-style object to manufacture [`DeleteObjectTaggingOutput`](crate::output::DeleteObjectTaggingOutput).
          30  +
    pub fn builder() -> crate::output::delete_object_tagging_output::Builder {
          31  +
        crate::output::delete_object_tagging_output::Builder::default()
          32  +
    }
          33  +
}
          34  +
          35  +
#[allow(missing_docs)] // documentation missing in model
          36  +
#[derive(
          37  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          38  +
)]
          39  +
pub struct GetBucketLocationOutput {
          40  +
    #[allow(missing_docs)] // documentation missing in model
          41  +
    pub location_constraint: ::std::option::Option<crate::model::BucketLocationConstraint>,
          42  +
}
          43  +
impl GetBucketLocationOutput {
          44  +
    #[allow(missing_docs)] // documentation missing in model
          45  +
    pub fn location_constraint(
          46  +
        &self,
          47  +
    ) -> ::std::option::Option<&crate::model::BucketLocationConstraint> {
          48  +
        self.location_constraint.as_ref()
          49  +
    }
          50  +
}
          51  +
impl GetBucketLocationOutput {
          52  +
    /// Creates a new builder-style object to manufacture [`GetBucketLocationOutput`](crate::output::GetBucketLocationOutput).
          53  +
    pub fn builder() -> crate::output::get_bucket_location_output::Builder {
          54  +
        crate::output::get_bucket_location_output::Builder::default()
          55  +
    }
          56  +
}
          57  +
          58  +
#[allow(missing_docs)] // documentation missing in model
          59  +
#[derive(
          60  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
          61  +
)]
          62  +
pub struct ListObjectsV2Output {
          63  +
    #[allow(missing_docs)] // documentation missing in model
          64  +
    pub is_truncated: ::std::option::Option<bool>,
          65  +
    #[allow(missing_docs)] // documentation missing in model
          66  +
    pub contents: ::std::option::Option<::std::vec::Vec<crate::model::Object>>,
          67  +
    #[allow(missing_docs)] // documentation missing in model
          68  +
    pub name: ::std::option::Option<::std::string::String>,
          69  +
    #[allow(missing_docs)] // documentation missing in model
          70  +
    pub prefix: ::std::option::Option<::std::string::String>,
          71  +
    #[allow(missing_docs)] // documentation missing in model
          72  +
    pub delimiter: ::std::option::Option<::std::string::String>,
          73  +
    #[allow(missing_docs)] // documentation missing in model
          74  +
    pub max_keys: ::std::option::Option<i32>,
          75  +
    #[allow(missing_docs)] // documentation missing in model
          76  +
    pub common_prefixes: ::std::option::Option<::std::vec::Vec<crate::model::CommonPrefix>>,
          77  +
    #[allow(missing_docs)] // documentation missing in model
          78  +
    pub encoding_type: ::std::option::Option<crate::model::EncodingType>,
          79  +
    #[allow(missing_docs)] // documentation missing in model
          80  +
    pub key_count: ::std::option::Option<i32>,
          81  +
    #[allow(missing_docs)] // documentation missing in model
          82  +
    pub continuation_token: ::std::option::Option<::std::string::String>,
          83  +
    #[allow(missing_docs)] // documentation missing in model
          84  +
    pub next_continuation_token: ::std::option::Option<::std::string::String>,
          85  +
    #[allow(missing_docs)] // documentation missing in model
          86  +
    pub start_after: ::std::option::Option<::std::string::String>,
          87  +
}
          88  +
impl ListObjectsV2Output {
          89  +
    #[allow(missing_docs)] // documentation missing in model
          90  +
    pub fn is_truncated(&self) -> ::std::option::Option<bool> {
          91  +
        self.is_truncated
          92  +
    }
          93  +
    #[allow(missing_docs)] // documentation missing in model
          94  +
    pub fn contents(&self) -> ::std::option::Option<&[crate::model::Object]> {
          95  +
        self.contents.as_deref()
          96  +
    }
          97  +
    #[allow(missing_docs)] // documentation missing in model
          98  +
    pub fn name(&self) -> ::std::option::Option<&str> {
          99  +
        self.name.as_deref()
         100  +
    }
         101  +
    #[allow(missing_docs)] // documentation missing in model
         102  +
    pub fn prefix(&self) -> ::std::option::Option<&str> {
         103  +
        self.prefix.as_deref()
         104  +
    }
         105  +
    #[allow(missing_docs)] // documentation missing in model
         106  +
    pub fn delimiter(&self) -> ::std::option::Option<&str> {
         107  +
        self.delimiter.as_deref()
         108  +
    }
         109  +
    #[allow(missing_docs)] // documentation missing in model
         110  +
    pub fn max_keys(&self) -> ::std::option::Option<i32> {
         111  +
        self.max_keys
         112  +
    }
         113  +
    #[allow(missing_docs)] // documentation missing in model
         114  +
    pub fn common_prefixes(&self) -> ::std::option::Option<&[crate::model::CommonPrefix]> {
         115  +
        self.common_prefixes.as_deref()
         116  +
    }
         117  +
    #[allow(missing_docs)] // documentation missing in model
         118  +
    pub fn encoding_type(&self) -> ::std::option::Option<&crate::model::EncodingType> {
         119  +
        self.encoding_type.as_ref()
         120  +
    }
         121  +
    #[allow(missing_docs)] // documentation missing in model
         122  +
    pub fn key_count(&self) -> ::std::option::Option<i32> {
         123  +
        self.key_count
         124  +
    }
         125  +
    #[allow(missing_docs)] // documentation missing in model
         126  +
    pub fn continuation_token(&self) -> ::std::option::Option<&str> {
         127  +
        self.continuation_token.as_deref()
         128  +
    }
         129  +
    #[allow(missing_docs)] // documentation missing in model
         130  +
    pub fn next_continuation_token(&self) -> ::std::option::Option<&str> {
         131  +
        self.next_continuation_token.as_deref()
         132  +
    }
         133  +
    #[allow(missing_docs)] // documentation missing in model
         134  +
    pub fn start_after(&self) -> ::std::option::Option<&str> {
         135  +
        self.start_after.as_deref()
         136  +
    }
         137  +
}
         138  +
impl ListObjectsV2Output {
         139  +
    /// Creates a new builder-style object to manufacture [`ListObjectsV2Output`](crate::output::ListObjectsV2Output).
         140  +
    pub fn builder() -> crate::output::list_objects_v2_output::Builder {
         141  +
        crate::output::list_objects_v2_output::Builder::default()
         142  +
    }
         143  +
}
         144  +
/// See [`GetObjectOutput`](crate::output::GetObjectOutput).
         145  +
pub mod get_object_output {
         146  +
         147  +
    impl ::std::convert::From<Builder> for crate::output::GetObjectOutput {
         148  +
        fn from(builder: Builder) -> Self {
         149  +
            builder.build()
         150  +
        }
         151  +
    }
         152  +
    /// A builder for [`GetObjectOutput`](crate::output::GetObjectOutput).
         153  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         154  +
    pub struct Builder {}
         155  +
    impl Builder {
         156  +
        /// Consumes the builder and constructs a [`GetObjectOutput`](crate::output::GetObjectOutput).
         157  +
        pub fn build(self) -> crate::output::GetObjectOutput {
         158  +
            self.build_enforcing_all_constraints()
         159  +
        }
         160  +
        fn build_enforcing_all_constraints(self) -> crate::output::GetObjectOutput {
         161  +
            crate::output::GetObjectOutput {}
         162  +
        }
         163  +
    }
         164  +
}
         165  +
/// See [`DeleteObjectTaggingOutput`](crate::output::DeleteObjectTaggingOutput).
         166  +
pub mod delete_object_tagging_output {
         167  +
         168  +
    impl ::std::convert::From<Builder> for crate::output::DeleteObjectTaggingOutput {
         169  +
        fn from(builder: Builder) -> Self {
         170  +
            builder.build()
         171  +
        }
         172  +
    }
         173  +
    /// A builder for [`DeleteObjectTaggingOutput`](crate::output::DeleteObjectTaggingOutput).
         174  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         175  +
    pub struct Builder {
         176  +
        pub(crate) version_id: ::std::option::Option<::std::string::String>,
         177  +
    }
         178  +
    impl Builder {
         179  +
        #[allow(missing_docs)] // documentation missing in model
         180  +
        pub fn version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         181  +
            self.version_id = input;
         182  +
            self
         183  +
        }
         184  +
        /// Consumes the builder and constructs a [`DeleteObjectTaggingOutput`](crate::output::DeleteObjectTaggingOutput).
         185  +
        pub fn build(self) -> crate::output::DeleteObjectTaggingOutput {
         186  +
            self.build_enforcing_all_constraints()
         187  +
        }
         188  +
        fn build_enforcing_all_constraints(self) -> crate::output::DeleteObjectTaggingOutput {
         189  +
            crate::output::DeleteObjectTaggingOutput {
         190  +
                version_id: self.version_id,
         191  +
            }
         192  +
        }
         193  +
    }
         194  +
}
         195  +
/// See [`GetBucketLocationOutput`](crate::output::GetBucketLocationOutput).
         196  +
pub mod get_bucket_location_output {
         197  +
         198  +
    impl ::std::convert::From<Builder> for crate::output::GetBucketLocationOutput {
         199  +
        fn from(builder: Builder) -> Self {
         200  +
            builder.build()
         201  +
        }
         202  +
    }
         203  +
    /// A builder for [`GetBucketLocationOutput`](crate::output::GetBucketLocationOutput).
         204  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         205  +
    pub struct Builder {
         206  +
        pub(crate) location_constraint:
         207  +
            ::std::option::Option<crate::model::BucketLocationConstraint>,
         208  +
    }
         209  +
    impl Builder {
         210  +
        #[allow(missing_docs)] // documentation missing in model
         211  +
        pub fn location_constraint(
         212  +
            mut self,
         213  +
            input: ::std::option::Option<crate::model::BucketLocationConstraint>,
         214  +
        ) -> Self {
         215  +
            self.location_constraint = input;
         216  +
            self
         217  +
        }
         218  +
        /// Consumes the builder and constructs a [`GetBucketLocationOutput`](crate::output::GetBucketLocationOutput).
         219  +
        pub fn build(self) -> crate::output::GetBucketLocationOutput {
         220  +
            self.build_enforcing_all_constraints()
         221  +
        }
         222  +
        fn build_enforcing_all_constraints(self) -> crate::output::GetBucketLocationOutput {
         223  +
            crate::output::GetBucketLocationOutput {
         224  +
                location_constraint: self.location_constraint,
         225  +
            }
         226  +
        }
         227  +
    }
         228  +
}
         229  +
/// See [`ListObjectsV2Output`](crate::output::ListObjectsV2Output).
         230  +
pub mod list_objects_v2_output {
         231  +
         232  +
    impl ::std::convert::From<Builder> for crate::output::ListObjectsV2Output {
         233  +
        fn from(builder: Builder) -> Self {
         234  +
            builder.build()
         235  +
        }
         236  +
    }
         237  +
    /// A builder for [`ListObjectsV2Output`](crate::output::ListObjectsV2Output).
         238  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         239  +
    pub struct Builder {
         240  +
        pub(crate) is_truncated: ::std::option::Option<bool>,
         241  +
        pub(crate) contents: ::std::option::Option<::std::vec::Vec<crate::model::Object>>,
         242  +
        pub(crate) name: ::std::option::Option<::std::string::String>,
         243  +
        pub(crate) prefix: ::std::option::Option<::std::string::String>,
         244  +
        pub(crate) delimiter: ::std::option::Option<::std::string::String>,
         245  +
        pub(crate) max_keys: ::std::option::Option<i32>,
         246  +
        pub(crate) common_prefixes:
         247  +
            ::std::option::Option<::std::vec::Vec<crate::model::CommonPrefix>>,
         248  +
        pub(crate) encoding_type: ::std::option::Option<crate::model::EncodingType>,
         249  +
        pub(crate) key_count: ::std::option::Option<i32>,
         250  +
        pub(crate) continuation_token: ::std::option::Option<::std::string::String>,
         251  +
        pub(crate) next_continuation_token: ::std::option::Option<::std::string::String>,
         252  +
        pub(crate) start_after: ::std::option::Option<::std::string::String>,
         253  +
    }
         254  +
    impl Builder {
         255  +
        #[allow(missing_docs)] // documentation missing in model
         256  +
        pub fn is_truncated(mut self, input: ::std::option::Option<bool>) -> Self {
         257  +
            self.is_truncated = input;
         258  +
            self
         259  +
        }
         260  +
        #[allow(missing_docs)] // documentation missing in model
         261  +
        pub fn contents(
         262  +
            mut self,
         263  +
            input: ::std::option::Option<::std::vec::Vec<crate::model::Object>>,
         264  +
        ) -> Self {
         265  +
            self.contents = input;
         266  +
            self
         267  +
        }
         268  +
        #[allow(missing_docs)] // documentation missing in model
         269  +
        pub fn name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         270  +
            self.name = input;
         271  +
            self
         272  +
        }
         273  +
        #[allow(missing_docs)] // documentation missing in model
         274  +
        pub fn prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         275  +
            self.prefix = input;
         276  +
            self
         277  +
        }
         278  +
        #[allow(missing_docs)] // documentation missing in model
         279  +
        pub fn delimiter(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         280  +
            self.delimiter = input;
         281  +
            self
         282  +
        }
         283  +
        #[allow(missing_docs)] // documentation missing in model
         284  +
        pub fn max_keys(mut self, input: ::std::option::Option<i32>) -> Self {
         285  +
            self.max_keys = input;
         286  +
            self
         287  +
        }
         288  +
        #[allow(missing_docs)] // documentation missing in model
         289  +
        pub fn common_prefixes(
         290  +
            mut self,
         291  +
            input: ::std::option::Option<::std::vec::Vec<crate::model::CommonPrefix>>,
         292  +
        ) -> Self {
         293  +
            self.common_prefixes = input;
         294  +
            self
         295  +
        }
         296  +
        #[allow(missing_docs)] // documentation missing in model
         297  +
        pub fn encoding_type(
         298  +
            mut self,
         299  +
            input: ::std::option::Option<crate::model::EncodingType>,
         300  +
        ) -> Self {
         301  +
            self.encoding_type = input;
         302  +
            self
         303  +
        }
         304  +
        #[allow(missing_docs)] // documentation missing in model
         305  +
        pub fn key_count(mut self, input: ::std::option::Option<i32>) -> Self {
         306  +
            self.key_count = input;
         307  +
            self
         308  +
        }
         309  +
        #[allow(missing_docs)] // documentation missing in model
         310  +
        pub fn continuation_token(
         311  +
            mut self,
         312  +
            input: ::std::option::Option<::std::string::String>,
         313  +
        ) -> Self {
         314  +
            self.continuation_token = input;
         315  +
            self
         316  +
        }
         317  +
        #[allow(missing_docs)] // documentation missing in model
         318  +
        pub fn next_continuation_token(
         319  +
            mut self,
         320  +
            input: ::std::option::Option<::std::string::String>,
         321  +
        ) -> Self {
         322  +
            self.next_continuation_token = input;
         323  +
            self
         324  +
        }
         325  +
        #[allow(missing_docs)] // documentation missing in model
         326  +
        pub fn start_after(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         327  +
            self.start_after = input;
         328  +
            self
         329  +
        }
         330  +
        /// Consumes the builder and constructs a [`ListObjectsV2Output`](crate::output::ListObjectsV2Output).
         331  +
        pub fn build(self) -> crate::output::ListObjectsV2Output {
         332  +
            self.build_enforcing_all_constraints()
         333  +
        }
         334  +
        fn build_enforcing_all_constraints(self) -> crate::output::ListObjectsV2Output {
         335  +
            crate::output::ListObjectsV2Output {
         336  +
                is_truncated: self.is_truncated,
         337  +
                contents: self.contents,
         338  +
                name: self.name,
         339  +
                prefix: self.prefix,
         340  +
                delimiter: self.delimiter,
         341  +
                max_keys: self.max_keys,
         342  +
                common_prefixes: self.common_prefixes,
         343  +
                encoding_type: self.encoding_type,
         344  +
                key_count: self.key_count,
         345  +
                continuation_token: self.continuation_token,
         346  +
                next_continuation_token: self.next_continuation_token,
         347  +
                start_after: self.start_after,
         348  +
            }
         349  +
        }
         350  +
    }
         351  +
}

tmp-codegen-diff/codegen-server-test/s3-http0x/rust-server-codegen/src/protocol_serde.rs

@@ -0,1 +0,32 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) mod shape_delete_object_tagging;
           3  +
           4  +
pub(crate) mod shape_get_bucket_location;
           5  +
           6  +
pub(crate) mod shape_get_object;
           7  +
           8  +
pub(crate) mod shape_list_objects_v2;
           9  +
          10  +
pub(crate) mod shape_delete_object_tagging_input;
          11  +
          12  +
pub(crate) mod shape_get_bucket_location_input;
          13  +
          14  +
pub(crate) mod shape_get_object_input;
          15  +
          16  +
pub(crate) mod shape_list_objects_v2_input;
          17  +
          18  +
pub(crate) mod shape_no_such_bucket;
          19  +
          20  +
pub(crate) mod shape_validation_exception;
          21  +
          22  +
pub(crate) mod shape_get_bucket_location_output;
          23  +
          24  +
pub(crate) mod shape_list_objects_v2_output;
          25  +
          26  +
pub(crate) mod shape_common_prefix;
          27  +
          28  +
pub(crate) mod shape_object;
          29  +
          30  +
pub(crate) mod shape_validation_exception_field;
          31  +
          32  +
pub(crate) mod shape_owner;

tmp-codegen-diff/codegen-server-test/s3-http0x/rust-server-codegen/src/protocol_serde/shape_common_prefix.rs

@@ -0,1 +0,14 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_common_prefix(
           3  +
    input: &crate::model::CommonPrefix,
           4  +
    writer: ::aws_smithy_xml::encode::ElWriter,
           5  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    #[allow(unused_mut)]
           7  +
    let mut scope = writer.finish();
           8  +
    if let Some(var_1) = &input.prefix {
           9  +
        let mut inner_writer = scope.start_el("Prefix").finish();
          10  +
        inner_writer.data(var_1.as_str());
          11  +
    }
          12  +
    scope.finish();
          13  +
    Ok(())
          14  +
}

tmp-codegen-diff/codegen-server-test/s3-http0x/rust-server-codegen/src/protocol_serde/shape_delete_object_tagging.rs

@@ -0,1 +0,137 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_delete_object_tagging_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::DeleteObjectTaggingInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::delete_object_tagging_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        if let Some(value) = crate::protocol_serde::shape_delete_object_tagging_input::de_expected_bucket_owner_header(&headers)? {
          23  +
                                input = input.set_expected_bucket_owner(Some(value))
          24  +
                            }
          25  +
        let input_string = uri.path();
          26  +
        let (input_string, (m0, m1)) =
          27  +
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
          28  +
                ::nom::sequence::preceded(
          29  +
                    ::nom::bytes::complete::tag("/"),
          30  +
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
          31  +
                        ::nom::bytes::complete::take_until("/"),
          32  +
                        ::nom::combinator::rest,
          33  +
                    )),
          34  +
                ),
          35  +
                ::nom::sequence::preceded(
          36  +
                    ::nom::bytes::complete::tag("/"),
          37  +
                    ::nom::combinator::rest::<_, ::nom::error::Error<&str>>,
          38  +
                ),
          39  +
            ))(input_string)?;
          40  +
        debug_assert_eq!("", input_string);
          41  +
        input = input
          42  +
            .set_bucket(crate::protocol_serde::shape_delete_object_tagging_input::de_bucket(m0)?);
          43  +
        input =
          44  +
            input.set_key(crate::protocol_serde::shape_delete_object_tagging_input::de_key(m1)?);
          45  +
        let query_string = uri.query().unwrap_or("");
          46  +
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          47  +
        let mut version_id_seen = false;
          48  +
        for (k, v) in pairs {
          49  +
            if !version_id_seen && k == "versionId" {
          50  +
                input = input.set_version_id(
          51  +
                    crate::protocol_serde::shape_delete_object_tagging_input::de_version_id(&v)?,
          52  +
                );
          53  +
                version_id_seen = true;
          54  +
            }
          55  +
        }
          56  +
        input.build()?
          57  +
    })
          58  +
}
          59  +
          60  +
#[allow(clippy::unnecessary_wraps)]
          61  +
pub fn ser_delete_object_tagging_http_response(
          62  +
    #[allow(unused_variables)] output: crate::output::DeleteObjectTaggingOutput,
          63  +
) -> std::result::Result<
          64  +
    ::aws_smithy_legacy_http_server::response::Response,
          65  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::ResponseRejection,
          66  +
> {
          67  +
    Ok({
          68  +
        #[allow(unused_mut)]
          69  +
        let mut builder = ::http::Response::builder();
          70  +
        builder =
          71  +
            crate::protocol_serde::shape_delete_object_tagging::ser_delete_object_tagging_headers(
          72  +
                &output, builder,
          73  +
            )?;
          74  +
        let http_status: u16 = 204;
          75  +
        builder = builder.status(http_status);
          76  +
        let payload = "";
          77  +
        let content_length = payload.len();
          78  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          79  +
            builder,
          80  +
            ::http::header::CONTENT_LENGTH,
          81  +
            content_length,
          82  +
        );
          83  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          84  +
        builder.body(body)?
          85  +
    })
          86  +
}
          87  +
          88  +
#[allow(clippy::unnecessary_wraps)]
          89  +
pub fn ser_delete_object_tagging_http_error(
          90  +
    error: &crate::error::DeleteObjectTaggingError,
          91  +
) -> std::result::Result<
          92  +
    ::aws_smithy_legacy_http_server::response::Response,
          93  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::ResponseRejection,
          94  +
> {
          95  +
    Ok({
          96  +
        match error {
          97  +
            crate::error::DeleteObjectTaggingError::ValidationException(output) => {
          98  +
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
          99  +
                #[allow(unused_mut)]
         100  +
                let mut builder = ::http::Response::builder();
         101  +
                let content_length = payload.len();
         102  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         103  +
                    builder,
         104  +
                    ::http::header::CONTENT_LENGTH,
         105  +
                    content_length,
         106  +
                );
         107  +
                builder
         108  +
                    .status(400)
         109  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         110  +
            }
         111  +
        }
         112  +
    })
         113  +
}
         114  +
         115  +
pub fn ser_delete_object_tagging_headers(
         116  +
    input: &crate::output::DeleteObjectTaggingOutput,
         117  +
    mut builder: ::http::response::Builder,
         118  +
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
         119  +
{
         120  +
    if let ::std::option::Option::Some(inner_1) = &input.version_id {
         121  +
        let formatted_2 = inner_1.as_str();
         122  +
        if !formatted_2.is_empty() {
         123  +
            let header_value = formatted_2;
         124  +
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         125  +
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
         126  +
                    "version_id",
         127  +
                    format!(
         128  +
                        "`{}` cannot be used as a header value: {}",
         129  +
                        &header_value, err
         130  +
                    ),
         131  +
                )
         132  +
            })?;
         133  +
            builder = builder.header("x-amz-version-id", header_value);
         134  +
        }
         135  +
    }
         136  +
    Ok(builder)
         137  +
}

tmp-codegen-diff/codegen-server-test/s3-http0x/rust-server-codegen/src/protocol_serde/shape_delete_object_tagging_input.rs

@@ -0,1 +0,44 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub(crate) fn de_expected_bucket_owner_header(
           3  +
    header_map: &::aws_smithy_runtime_api::http::Headers,
           4  +
) -> ::std::result::Result<
           5  +
    ::std::option::Option<::std::string::String>,
           6  +
    ::aws_smithy_legacy_http::header::ParseError,
           7  +
> {
           8  +
    let headers = header_map.get_all("x-amz-expected-bucket-owner");
           9  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
          10  +
}
          11  +
          12  +
pub fn de_bucket(
          13  +
    value: &str,
          14  +
) -> std::result::Result<
          15  +
    ::std::string::String,
          16  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection,
          17  +
> {
          18  +
    let value = ::percent_encoding::percent_decode_str(value)
          19  +
        .decode_utf8()?
          20  +
        .into_owned();
          21  +
    Ok(value)
          22  +
}
          23  +
          24  +
pub fn de_key(
          25  +
    value: &str,
          26  +
) -> std::result::Result<
          27  +
    ::std::string::String,
          28  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection,
          29  +
> {
          30  +
    let value = ::percent_encoding::percent_decode_str(value)
          31  +
        .decode_utf8()?
          32  +
        .into_owned();
          33  +
    Ok(value)
          34  +
}
          35  +
          36  +
pub fn de_version_id(
          37  +
    value: &str,
          38  +
) -> std::result::Result<
          39  +
    ::std::option::Option<::std::string::String>,
          40  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection,
          41  +
> {
          42  +
    let value = value.to_owned();
          43  +
    Ok(Some(value))
          44  +
}

tmp-codegen-diff/codegen-server-test/s3-http0x/rust-server-codegen/src/protocol_serde/shape_get_bucket_location.rs

@@ -0,1 +0,114 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_get_bucket_location_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::GetBucketLocationInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::get_bucket_location_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        let input_string = uri.path();
          23  +
        let (input_string, m0) = ::nom::sequence::preceded(
          24  +
            ::nom::bytes::complete::tag("/"),
          25  +
            ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
          26  +
                ::nom::bytes::complete::take_until("/"),
          27  +
                ::nom::combinator::rest,
          28  +
            )),
          29  +
        )(input_string)?;
          30  +
        debug_assert_eq!("", input_string);
          31  +
        input = input
          32  +
            .set_bucket(crate::protocol_serde::shape_get_bucket_location_input::de_bucket(m0)?);
          33  +
        input.build()?
          34  +
    })
          35  +
}
          36  +
          37  +
#[allow(clippy::unnecessary_wraps)]
          38  +
pub fn ser_get_bucket_location_http_response(
          39  +
    #[allow(unused_variables)] output: crate::output::GetBucketLocationOutput,
          40  +
) -> std::result::Result<
          41  +
    ::aws_smithy_legacy_http_server::response::Response,
          42  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::ResponseRejection,
          43  +
> {
          44  +
    Ok({
          45  +
        #[allow(unused_mut)]
          46  +
        let mut builder = ::http::Response::builder();
          47  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          48  +
            builder,
          49  +
            ::http::header::CONTENT_TYPE,
          50  +
            "application/xml",
          51  +
        );
          52  +
        let http_status: u16 = 200;
          53  +
        builder = builder.status(http_status);
          54  +
        let payload =
          55  +
            crate::protocol_serde::shape_get_bucket_location::ser_get_bucket_location_output(
          56  +
                &output,
          57  +
            )?;
          58  +
        let content_length = payload.len();
          59  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          60  +
            builder,
          61  +
            ::http::header::CONTENT_LENGTH,
          62  +
            content_length,
          63  +
        );
          64  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          65  +
        builder.body(body)?
          66  +
    })
          67  +
}
          68  +
          69  +
#[allow(clippy::unnecessary_wraps)]
          70  +
pub fn ser_get_bucket_location_http_error(
          71  +
    error: &crate::error::GetBucketLocationError,
          72  +
) -> std::result::Result<
          73  +
    ::aws_smithy_legacy_http_server::response::Response,
          74  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::ResponseRejection,
          75  +
> {
          76  +
    Ok({
          77  +
        match error {
          78  +
            crate::error::GetBucketLocationError::ValidationException(output) => {
          79  +
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
          80  +
                #[allow(unused_mut)]
          81  +
                let mut builder = ::http::Response::builder();
          82  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          83  +
                    builder,
          84  +
                    ::http::header::CONTENT_TYPE,
          85  +
                    "application/xml",
          86  +
                );
          87  +
                let content_length = payload.len();
          88  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          89  +
                    builder,
          90  +
                    ::http::header::CONTENT_LENGTH,
          91  +
                    content_length,
          92  +
                );
          93  +
                builder
          94  +
                    .status(400)
          95  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
          96  +
            }
          97  +
        }
          98  +
    })
          99  +
}
         100  +
         101  +
pub fn ser_get_bucket_location_output(
         102  +
    output: &crate::output::GetBucketLocationOutput,
         103  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
         104  +
    let mut out = String::new();
         105  +
    {
         106  +
        let mut writer = ::aws_smithy_xml::encode::XmlWriter::new(&mut out);
         107  +
        #[allow(unused_mut)]
         108  +
        let mut root = writer
         109  +
            .start_el("LocationConstraint")
         110  +
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
         111  +
        crate::protocol_serde::shape_get_bucket_location_output::ser_get_bucket_location_output_output(output, root)?
         112  +
    }
         113  +
    Ok(out)
         114  +
}

tmp-codegen-diff/codegen-server-test/s3-http0x/rust-server-codegen/src/protocol_serde/shape_get_bucket_location_input.rs

@@ -0,1 +0,12 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn de_bucket(
           3  +
    value: &str,
           4  +
) -> std::result::Result<
           5  +
    ::std::string::String,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection,
           7  +
> {
           8  +
    let value = ::percent_encoding::percent_decode_str(value)
           9  +
        .decode_utf8()?
          10  +
        .into_owned();
          11  +
    Ok(value)
          12  +
}

tmp-codegen-diff/codegen-server-test/s3-http0x/rust-server-codegen/src/protocol_serde/shape_get_bucket_location_output.rs

@@ -0,1 +0,14 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn ser_get_bucket_location_output_output(
           3  +
    input: &crate::output::GetBucketLocationOutput,
           4  +
    writer: ::aws_smithy_xml::encode::ElWriter,
           5  +
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    #[allow(unused_mut)]
           7  +
    let mut scope = writer.finish();
           8  +
    if let Some(var_1) = &input.location_constraint {
           9  +
        let mut inner_writer = scope.start_el("LocationConstraint").finish();
          10  +
        inner_writer.data(var_1.as_str());
          11  +
    }
          12  +
    scope.finish();
          13  +
    Ok(())
          14  +
}

tmp-codegen-diff/codegen-server-test/s3-http0x/rust-server-codegen/src/protocol_serde/shape_get_object.rs

@@ -0,1 +0,95 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_get_object_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::GetObjectInput,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::get_object_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        let input_string = uri.path();
          23  +
        let (input_string, (m0, m1)) =
          24  +
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
          25  +
                ::nom::sequence::preceded(
          26  +
                    ::nom::bytes::complete::tag("/"),
          27  +
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
          28  +
                        ::nom::bytes::complete::take_until("/"),
          29  +
                        ::nom::combinator::rest,
          30  +
                    )),
          31  +
                ),
          32  +
                ::nom::sequence::preceded(
          33  +
                    ::nom::bytes::complete::tag("/"),
          34  +
                    ::nom::combinator::rest::<_, ::nom::error::Error<&str>>,
          35  +
                ),
          36  +
            ))(input_string)?;
          37  +
        debug_assert_eq!("", input_string);
          38  +
        input = input.set_bucket(crate::protocol_serde::shape_get_object_input::de_bucket(
          39  +
            m0,
          40  +
        )?);
          41  +
        input = input.set_key(crate::protocol_serde::shape_get_object_input::de_key(m1)?);
          42  +
        input.build()?
          43  +
    })
          44  +
}
          45  +
          46  +
#[allow(clippy::unnecessary_wraps)]
          47  +
pub fn ser_get_object_http_response(
          48  +
    #[allow(unused_variables)] output: crate::output::GetObjectOutput,
          49  +
) -> std::result::Result<
          50  +
    ::aws_smithy_legacy_http_server::response::Response,
          51  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::ResponseRejection,
          52  +
> {
          53  +
    Ok({
          54  +
        #[allow(unused_mut)]
          55  +
        let mut builder = ::http::Response::builder();
          56  +
        let http_status: u16 = 200;
          57  +
        builder = builder.status(http_status);
          58  +
        let payload = "";
          59  +
        let content_length = payload.len();
          60  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          61  +
            builder,
          62  +
            ::http::header::CONTENT_LENGTH,
          63  +
            content_length,
          64  +
        );
          65  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
          66  +
        builder.body(body)?
          67  +
    })
          68  +
}
          69  +
          70  +
#[allow(clippy::unnecessary_wraps)]
          71  +
pub fn ser_get_object_http_error(
          72  +
    error: &crate::error::GetObjectError,
          73  +
) -> std::result::Result<
          74  +
    ::aws_smithy_legacy_http_server::response::Response,
          75  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::ResponseRejection,
          76  +
> {
          77  +
    Ok({
          78  +
        match error {
          79  +
            crate::error::GetObjectError::ValidationException(output) => {
          80  +
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
          81  +
                #[allow(unused_mut)]
          82  +
                let mut builder = ::http::Response::builder();
          83  +
                let content_length = payload.len();
          84  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
          85  +
                    builder,
          86  +
                    ::http::header::CONTENT_LENGTH,
          87  +
                    content_length,
          88  +
                );
          89  +
                builder
          90  +
                    .status(400)
          91  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
          92  +
            }
          93  +
        }
          94  +
    })
          95  +
}

tmp-codegen-diff/codegen-server-test/s3-http0x/rust-server-codegen/src/protocol_serde/shape_get_object_input.rs

@@ -0,1 +0,24 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn de_bucket(
           3  +
    value: &str,
           4  +
) -> std::result::Result<
           5  +
    ::std::string::String,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection,
           7  +
> {
           8  +
    let value = ::percent_encoding::percent_decode_str(value)
           9  +
        .decode_utf8()?
          10  +
        .into_owned();
          11  +
    Ok(value)
          12  +
}
          13  +
          14  +
pub fn de_key(
          15  +
    value: &str,
          16  +
) -> std::result::Result<
          17  +
    ::std::string::String,
          18  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection,
          19  +
> {
          20  +
    let value = ::percent_encoding::percent_decode_str(value)
          21  +
        .decode_utf8()?
          22  +
        .into_owned();
          23  +
    Ok(value)
          24  +
}

tmp-codegen-diff/codegen-server-test/s3-http0x/rust-server-codegen/src/protocol_serde/shape_list_objects_v2.rs

@@ -0,1 +0,198 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(clippy::unnecessary_wraps)]
           3  +
pub async fn de_list_objects_v2_http_request<B>(
           4  +
    #[allow(unused_variables)] request: ::http::Request<B>,
           5  +
) -> std::result::Result<
           6  +
    crate::input::ListObjectsV2Input,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection,
           8  +
>
           9  +
where
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
          11  +
    B::Data: Send,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
          14  +
{
          15  +
    Ok({
          16  +
        #[allow(unused_mut)]
          17  +
        let mut input = crate::input::list_objects_v2_input::Builder::default();
          18  +
        #[allow(unused_variables)]
          19  +
        let ::aws_smithy_runtime_api::http::RequestParts {
          20  +
            uri, headers, body, ..
          21  +
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          22  +
        if let Some(value) =
          23  +
            crate::protocol_serde::shape_list_objects_v2_input::de_expected_bucket_owner_header(
          24  +
                &headers,
          25  +
            )?
          26  +
        {
          27  +
            input = input.set_expected_bucket_owner(Some(value))
          28  +
        }
          29  +
        if let Some(value) =
          30  +
            crate::protocol_serde::shape_list_objects_v2_input::de_request_payer_header(&headers)?
          31  +
        {
          32  +
            input = input.set_request_payer(Some(value))
          33  +
        }
          34  +
        let input_string = uri.path();
          35  +
        let (input_string, m0) = ::nom::sequence::preceded(
          36  +
            ::nom::bytes::complete::tag("/"),
          37  +
            ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
          38  +
                ::nom::bytes::complete::take_until("/"),
          39  +
                ::nom::combinator::rest,
          40  +
            )),
          41  +
        )(input_string)?;
          42  +
        debug_assert_eq!("", input_string);
          43  +
        input =
          44  +
            input.set_bucket(crate::protocol_serde::shape_list_objects_v2_input::de_bucket(m0)?);
          45  +
        let query_string = uri.query().unwrap_or("");
          46  +
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
          47  +
        let mut continuation_token_seen = false;
          48  +
        let mut delimiter_seen = false;
          49  +
        let mut encoding_type_seen = false;
          50  +
        let mut fetch_owner_seen = false;
          51  +
        let mut max_keys_seen = false;
          52  +
        let mut prefix_seen = false;
          53  +
        let mut start_after_seen = false;
          54  +
        for (k, v) in pairs {
          55  +
            if !continuation_token_seen && k == "continuation-token" {
          56  +
                input = input.set_continuation_token(
          57  +
                    crate::protocol_serde::shape_list_objects_v2_input::de_continuation_token(&v)?,
          58  +
                );
          59  +
                continuation_token_seen = true;
          60  +
            }
          61  +
            if !delimiter_seen && k == "delimiter" {
          62  +
                input = input.set_delimiter(
          63  +
                    crate::protocol_serde::shape_list_objects_v2_input::de_delimiter(&v)?,
          64  +
                );
          65  +
                delimiter_seen = true;
          66  +
            }
          67  +
            if !encoding_type_seen && k == "encoding-type" {
          68  +
                input = input.set_encoding_type(
          69  +
                    crate::protocol_serde::shape_list_objects_v2_input::de_encoding_type(&v)?,
          70  +
                );
          71  +
                encoding_type_seen = true;
          72  +
            }
          73  +
            if !fetch_owner_seen && k == "fetch-owner" {
          74  +
                input = input.set_fetch_owner(
          75  +
                    crate::protocol_serde::shape_list_objects_v2_input::de_fetch_owner(&v)?,
          76  +
                );
          77  +
                fetch_owner_seen = true;
          78  +
            }
          79  +
            if !max_keys_seen && k == "max-keys" {
          80  +
                input = input.set_max_keys(
          81  +
                    crate::protocol_serde::shape_list_objects_v2_input::de_max_keys(&v)?,
          82  +
                );
          83  +
                max_keys_seen = true;
          84  +
            }
          85  +
            if !prefix_seen && k == "prefix" {
          86  +
                input = input
          87  +
                    .set_prefix(crate::protocol_serde::shape_list_objects_v2_input::de_prefix(&v)?);
          88  +
                prefix_seen = true;
          89  +
            }
          90  +
            if !start_after_seen && k == "start-after" {
          91  +
                input = input.set_start_after(
          92  +
                    crate::protocol_serde::shape_list_objects_v2_input::de_start_after(&v)?,
          93  +
                );
          94  +
                start_after_seen = true;
          95  +
            }
          96  +
        }
          97  +
        input.build()?
          98  +
    })
          99  +
}
         100  +
         101  +
#[allow(clippy::unnecessary_wraps)]
         102  +
pub fn ser_list_objects_v2_http_response(
         103  +
    #[allow(unused_variables)] output: crate::output::ListObjectsV2Output,
         104  +
) -> std::result::Result<
         105  +
    ::aws_smithy_legacy_http_server::response::Response,
         106  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::ResponseRejection,
         107  +
> {
         108  +
    Ok({
         109  +
        #[allow(unused_mut)]
         110  +
        let mut builder = ::http::Response::builder();
         111  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         112  +
            builder,
         113  +
            ::http::header::CONTENT_TYPE,
         114  +
            "application/xml",
         115  +
        );
         116  +
        let http_status: u16 = 200;
         117  +
        builder = builder.status(http_status);
         118  +
        let payload =
         119  +
            crate::protocol_serde::shape_list_objects_v2::ser_list_objects_v2_output(&output)?;
         120  +
        let content_length = payload.len();
         121  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         122  +
            builder,
         123  +
            ::http::header::CONTENT_LENGTH,
         124  +
            content_length,
         125  +
        );
         126  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
         127  +
        builder.body(body)?
         128  +
    })
         129  +
}
         130  +
         131  +
#[allow(clippy::unnecessary_wraps)]
         132  +
pub fn ser_list_objects_v2_http_error(
         133  +
    error: &crate::error::ListObjectsV2Error,
         134  +
) -> std::result::Result<
         135  +
    ::aws_smithy_legacy_http_server::response::Response,
         136  +
    ::aws_smithy_legacy_http_server::protocol::rest_xml::rejection::ResponseRejection,
         137  +
> {
         138  +
    Ok({
         139  +
        match error {
         140  +
            crate::error::ListObjectsV2Error::NoSuchBucket(output) => {
         141  +
                let payload =
         142  +
                    crate::protocol_serde::shape_no_such_bucket::ser_no_such_bucket_error(output)?;
         143  +
                #[allow(unused_mut)]
         144  +
                let mut builder = ::http::Response::builder();
         145  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         146  +
                    builder,
         147  +
                    ::http::header::CONTENT_TYPE,
         148  +
                    "application/xml",
         149  +
                );
         150  +
                let content_length = payload.len();
         151  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         152  +
                    builder,
         153  +
                    ::http::header::CONTENT_LENGTH,
         154  +
                    content_length,
         155  +
                );
         156  +
                builder
         157  +
                    .status(400)
         158  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         159  +
            }
         160  +
            crate::error::ListObjectsV2Error::ValidationException(output) => {
         161  +
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         162  +
                #[allow(unused_mut)]
         163  +
                let mut builder = ::http::Response::builder();
         164  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         165  +
                    builder,
         166  +
                    ::http::header::CONTENT_TYPE,
         167  +
                    "application/xml",
         168  +
                );
         169  +
                let content_length = payload.len();
         170  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
         171  +
                    builder,
         172  +
                    ::http::header::CONTENT_LENGTH,
         173  +
                    content_length,
         174  +
                );
         175  +
                builder
         176  +
                    .status(400)
         177  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
         178  +
            }
         179  +
        }
         180  +
    })
         181  +
}
         182  +
         183  +
pub fn ser_list_objects_v2_output(
         184  +
    output: &crate::output::ListObjectsV2Output,
         185  +
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
         186  +
    let mut out = String::new();
         187  +
    {
         188  +
        let mut writer = ::aws_smithy_xml::encode::XmlWriter::new(&mut out);
         189  +
        #[allow(unused_mut)]
         190  +
        let mut root = writer
         191  +
            .start_el("ListObjectsV2Output")
         192  +
            .write_ns("http://s3.amazonaws.com/doc/2006-03-01/", None);
         193  +
        crate::protocol_serde::shape_list_objects_v2_output::ser_list_objects_v2_output_output(
         194  +
            output, root,
         195  +
        )?
         196  +
    }
         197  +
    Ok(out)
         198  +
}