aws_sdk_s3/protocol_serde/
shape_put_object_output.rs
1pub(crate) fn de_bucket_key_enabled_header(
3 header_map: &::aws_smithy_runtime_api::http::Headers,
4) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_http::header::ParseError> {
5 let headers = header_map.get_all("x-amz-server-side-encryption-bucket-key-enabled");
6 let var_1 = ::aws_smithy_http::header::read_many_primitive::<bool>(headers)?;
7 if var_1.len() > 1 {
8 Err(::aws_smithy_http::header::ParseError::new(format!(
9 "expected one item but found {}",
10 var_1.len()
11 )))
12 } else {
13 let mut var_1 = var_1;
14 Ok(var_1.pop())
15 }
16}
17
18pub(crate) fn de_checksum_crc32_header(
19 header_map: &::aws_smithy_runtime_api::http::Headers,
20) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
21 let headers = header_map.get_all("x-amz-checksum-crc32");
22 ::aws_smithy_http::header::one_or_none(headers)
23}
24
25pub(crate) fn de_checksum_crc32_c_header(
26 header_map: &::aws_smithy_runtime_api::http::Headers,
27) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
28 let headers = header_map.get_all("x-amz-checksum-crc32c");
29 ::aws_smithy_http::header::one_or_none(headers)
30}
31
32pub(crate) fn de_checksum_crc64_nvme_header(
33 header_map: &::aws_smithy_runtime_api::http::Headers,
34) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
35 let headers = header_map.get_all("x-amz-checksum-crc64nvme");
36 ::aws_smithy_http::header::one_or_none(headers)
37}
38
39pub(crate) fn de_checksum_sha1_header(
40 header_map: &::aws_smithy_runtime_api::http::Headers,
41) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
42 let headers = header_map.get_all("x-amz-checksum-sha1");
43 ::aws_smithy_http::header::one_or_none(headers)
44}
45
46pub(crate) fn de_checksum_sha256_header(
47 header_map: &::aws_smithy_runtime_api::http::Headers,
48) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
49 let headers = header_map.get_all("x-amz-checksum-sha256");
50 ::aws_smithy_http::header::one_or_none(headers)
51}
52
53pub(crate) fn de_checksum_type_header(
54 header_map: &::aws_smithy_runtime_api::http::Headers,
55) -> ::std::result::Result<::std::option::Option<crate::types::ChecksumType>, ::aws_smithy_http::header::ParseError> {
56 let headers = header_map.get_all("x-amz-checksum-type");
57 ::aws_smithy_http::header::one_or_none(headers)
58}
59
60pub(crate) fn de_e_tag_header(
61 header_map: &::aws_smithy_runtime_api::http::Headers,
62) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
63 let headers = header_map.get_all("ETag");
64 ::aws_smithy_http::header::one_or_none(headers)
65}
66
67pub(crate) fn de_expiration_header(
68 header_map: &::aws_smithy_runtime_api::http::Headers,
69) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
70 let headers = header_map.get_all("x-amz-expiration");
71 ::aws_smithy_http::header::one_or_none(headers)
72}
73
74pub(crate) fn de_request_charged_header(
75 header_map: &::aws_smithy_runtime_api::http::Headers,
76) -> ::std::result::Result<::std::option::Option<crate::types::RequestCharged>, ::aws_smithy_http::header::ParseError> {
77 let headers = header_map.get_all("x-amz-request-charged");
78 ::aws_smithy_http::header::one_or_none(headers)
79}
80
81pub(crate) fn de_sse_customer_algorithm_header(
82 header_map: &::aws_smithy_runtime_api::http::Headers,
83) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
84 let headers = header_map.get_all("x-amz-server-side-encryption-customer-algorithm");
85 ::aws_smithy_http::header::one_or_none(headers)
86}
87
88pub(crate) fn de_sse_customer_key_md5_header(
89 header_map: &::aws_smithy_runtime_api::http::Headers,
90) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
91 let headers = header_map.get_all("x-amz-server-side-encryption-customer-key-MD5");
92 ::aws_smithy_http::header::one_or_none(headers)
93}
94
95pub(crate) fn de_ssekms_encryption_context_header(
96 header_map: &::aws_smithy_runtime_api::http::Headers,
97) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
98 let headers = header_map.get_all("x-amz-server-side-encryption-context");
99 ::aws_smithy_http::header::one_or_none(headers)
100}
101
102pub(crate) fn de_ssekms_key_id_header(
103 header_map: &::aws_smithy_runtime_api::http::Headers,
104) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
105 let headers = header_map.get_all("x-amz-server-side-encryption-aws-kms-key-id");
106 ::aws_smithy_http::header::one_or_none(headers)
107}
108
109pub(crate) fn de_server_side_encryption_header(
110 header_map: &::aws_smithy_runtime_api::http::Headers,
111) -> ::std::result::Result<::std::option::Option<crate::types::ServerSideEncryption>, ::aws_smithy_http::header::ParseError> {
112 let headers = header_map.get_all("x-amz-server-side-encryption");
113 ::aws_smithy_http::header::one_or_none(headers)
114}
115
116pub(crate) fn de_size_header(
117 header_map: &::aws_smithy_runtime_api::http::Headers,
118) -> ::std::result::Result<::std::option::Option<i64>, ::aws_smithy_http::header::ParseError> {
119 let headers = header_map.get_all("x-amz-object-size");
120 let var_2 = ::aws_smithy_http::header::read_many_primitive::<i64>(headers)?;
121 if var_2.len() > 1 {
122 Err(::aws_smithy_http::header::ParseError::new(format!(
123 "expected one item but found {}",
124 var_2.len()
125 )))
126 } else {
127 let mut var_2 = var_2;
128 Ok(var_2.pop())
129 }
130}
131
132pub(crate) fn de_version_id_header(
133 header_map: &::aws_smithy_runtime_api::http::Headers,
134) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> {
135 let headers = header_map.get_all("x-amz-version-id");
136 ::aws_smithy_http::header::one_or_none(headers)
137}