15 15 | }
|
16 16 |
|
17 17 | #[allow(clippy::unnecessary_wraps)]
|
18 18 | pub fn de_delete_objects_http_response(
|
19 19 | _response_status: u16,
|
20 20 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
21 21 | _response_body: &[u8],
|
22 22 | ) -> std::result::Result<crate::operation::delete_objects::DeleteObjectsOutput, crate::operation::delete_objects::DeleteObjectsError> {
|
23 23 | Ok({
|
24 24 | #[allow(unused_mut)]
|
25 25 | let mut output = crate::operation::delete_objects::builders::DeleteObjectsOutputBuilder::default();
|
26 26 | output = crate::protocol_serde::shape_delete_objects::de_delete_objects(_response_body, output)
|
27 27 | .map_err(crate::operation::delete_objects::DeleteObjectsError::unhandled)?;
|
28 28 | output = output.set_request_charged(
|
29 29 | crate::protocol_serde::shape_delete_objects_output::de_request_charged_header(_response_headers).map_err(|_| {
|
30 30 | crate::operation::delete_objects::DeleteObjectsError::unhandled("Failed to parse RequestCharged from header `x-amz-request-charged")
|
31 31 | })?,
|
32 32 | );
|
33 33 | output._set_extended_request_id(crate::s3_request_id::RequestIdExt::extended_request_id(_response_headers).map(str::to_string));
|
34 34 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
35 35 | output.build()
|
36 36 | })
|
37 37 | }
|
38 38 |
|
39 39 | pub fn ser_delete_objects_headers(
|
40 40 | input: &crate::operation::delete_objects::DeleteObjectsInput,
|
41 41 | mut builder: ::http::request::Builder,
|
42 42 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
43 43 | if let ::std::option::Option::Some(inner_1) = &input.mfa {
|
44 44 | let formatted_2 = inner_1.as_str();
|
45 + | if !formatted_2.is_empty() {
|
45 46 | let header_value = formatted_2;
|
46 47 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
47 48 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
48 49 | "mfa",
|
49 50 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
50 51 | )
|
51 52 | })?;
|
52 53 | builder = builder.header("x-amz-mfa", header_value);
|
53 54 | }
|
55 + | }
|
54 56 | if let ::std::option::Option::Some(inner_3) = &input.request_payer {
|
55 57 | let formatted_4 = inner_3.as_str();
|
58 + | if !formatted_4.is_empty() {
|
56 59 | let header_value = formatted_4;
|
57 60 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
58 61 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
59 62 | "request_payer",
|
60 63 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
61 64 | )
|
62 65 | })?;
|
63 66 | builder = builder.header("x-amz-request-payer", header_value);
|
64 67 | }
|
68 + | }
|
65 69 | if let ::std::option::Option::Some(inner_5) = &input.bypass_governance_retention {
|
66 70 | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_5);
|
67 71 | let formatted_6 = encoder.encode();
|
72 + | if !formatted_6.is_empty() {
|
68 73 | let header_value = formatted_6;
|
69 74 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
70 75 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
71 76 | "bypass_governance_retention",
|
72 77 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
73 78 | )
|
74 79 | })?;
|
75 80 | builder = builder.header("x-amz-bypass-governance-retention", header_value);
|
76 81 | }
|
82 + | }
|
77 83 | if let ::std::option::Option::Some(inner_7) = &input.expected_bucket_owner {
|
78 84 | let formatted_8 = inner_7.as_str();
|
85 + | if !formatted_8.is_empty() {
|
79 86 | let header_value = formatted_8;
|
80 87 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
81 88 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
82 89 | "expected_bucket_owner",
|
83 90 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
84 91 | )
|
85 92 | })?;
|
86 93 | builder = builder.header("x-amz-expected-bucket-owner", header_value);
|
87 94 | }
|
95 + | }
|
88 96 | if let ::std::option::Option::Some(inner_9) = &input.checksum_algorithm {
|
89 97 | let formatted_10 = inner_9.as_str();
|
98 + | if !formatted_10.is_empty() {
|
90 99 | let header_value = formatted_10;
|
91 100 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
92 101 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
93 102 | "checksum_algorithm",
|
94 103 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
95 104 | )
|
96 105 | })?;
|
97 106 | builder = builder.header("x-amz-sdk-checksum-algorithm", header_value);
|
98 107 | }
|
108 + | }
|
99 109 | Ok(builder)
|
100 110 | }
|
101 111 |
|
102 112 | #[allow(unused_mut)]
|
103 113 | pub fn de_delete_objects(
|
104 114 | inp: &[u8],
|
105 115 | mut builder: crate::operation::delete_objects::builders::DeleteObjectsOutputBuilder,
|
106 116 | ) -> Result<crate::operation::delete_objects::builders::DeleteObjectsOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
|
107 117 | let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
|
108 118 |
|