1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* RustType.kt:534 */
|
2 3 | #[allow(clippy::unnecessary_wraps)]
|
4 + | /* ServerHttpBoundProtocolGenerator.kt:408 */
|
3 5 | pub async fn de_timestamp_format_headers_http_request<B>(
|
4 - | #[allow(unused_variables)] request: ::http::Request<B>,
|
6 + | #[allow(unused_variables)] request: ::http_1x::Request<B>,
|
5 7 | ) -> std::result::Result<
|
6 8 | crate::input::TimestampFormatHeadersInput,
|
7 9 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
|
8 10 | >
|
9 11 | where
|
10 12 | B: ::aws_smithy_http_server::body::HttpBody + Send,
|
11 13 | B::Data: Send,
|
12 14 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
|
13 15 | From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
|
14 16 | {
|
17 + | /* ServerHttpBoundProtocolGenerator.kt:424 */
|
15 18 | Ok({
|
19 + | /* RustType.kt:534 */
|
16 20 | #[allow(unused_mut)]
|
21 + | /* ServerHttpBoundProtocolGenerator.kt:759 */
|
17 22 | let mut input = crate::input::timestamp_format_headers_input::Builder::default();
|
23 + | /* RustType.kt:534 */
|
18 24 | #[allow(unused_variables)]
|
25 + | /* ServerHttpBoundProtocolGenerator.kt:764 */
|
19 26 | let ::aws_smithy_runtime_api::http::RequestParts {
|
20 27 | uri, headers, body, ..
|
21 28 | } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
|
29 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
22 30 | if let Some(value) =
|
23 31 | crate::protocol_serde::shape_timestamp_format_headers_input::de_default_format_header(
|
24 32 | &headers,
|
25 33 | )?
|
26 34 | {
|
27 35 | input = input.set_default_format(Some(value))
|
28 36 | }
|
37 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
29 38 | if let Some(value) =
|
30 39 | crate::protocol_serde::shape_timestamp_format_headers_input::de_member_date_time_header(
|
31 40 | &headers,
|
32 41 | )?
|
33 42 | {
|
34 43 | input = input.set_member_date_time(Some(value))
|
35 44 | }
|
45 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
36 46 | if let Some(value) = crate::protocol_serde::shape_timestamp_format_headers_input::de_member_epoch_seconds_header(&headers)? {
|
37 47 | input = input.set_member_epoch_seconds(Some(value))
|
38 48 | }
|
49 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
39 50 | if let Some(value) =
|
40 51 | crate::protocol_serde::shape_timestamp_format_headers_input::de_member_http_date_header(
|
41 52 | &headers,
|
42 53 | )?
|
43 54 | {
|
44 55 | input = input.set_member_http_date(Some(value))
|
45 56 | }
|
57 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
46 58 | if let Some(value) =
|
47 59 | crate::protocol_serde::shape_timestamp_format_headers_input::de_target_date_time_header(
|
48 60 | &headers,
|
49 61 | )?
|
50 62 | {
|
51 63 | input = input.set_target_date_time(Some(value))
|
52 64 | }
|
65 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
53 66 | if let Some(value) = crate::protocol_serde::shape_timestamp_format_headers_input::de_target_epoch_seconds_header(&headers)? {
|
54 67 | input = input.set_target_epoch_seconds(Some(value))
|
55 68 | }
|
69 + | /* ServerHttpBoundProtocolGenerator.kt:856 */
|
56 70 | if let Some(value) =
|
57 71 | crate::protocol_serde::shape_timestamp_format_headers_input::de_target_http_date_header(
|
58 72 | &headers,
|
59 73 | )?
|
60 74 | {
|
61 75 | input = input.set_target_http_date(Some(value))
|
62 76 | }
|
77 + | /* ServerHttpBoundProtocolGenerator.kt:896 */
|
63 78 | input.build()
|
79 + | /* ServerHttpBoundProtocolGenerator.kt:424 */
|
64 80 | })
|
81 + | /* ServerHttpBoundProtocolGenerator.kt:408 */
|
65 82 | }
|
66 83 |
|
84 + | /* RustType.kt:534 */
|
67 85 | #[allow(clippy::unnecessary_wraps)]
|
86 + | /* ServerHttpBoundProtocolGenerator.kt:445 */
|
68 87 | pub fn ser_timestamp_format_headers_http_response(
|
69 88 | #[allow(unused_variables)] output: crate::output::TimestampFormatHeadersOutput,
|
70 89 | ) -> std::result::Result<
|
71 90 | ::aws_smithy_http_server::response::Response,
|
72 91 | ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
|
73 92 | > {
|
93 + | /* ServerHttpBoundProtocolGenerator.kt:457 */
|
74 94 | Ok({
|
95 + | /* RustType.kt:534 */
|
75 96 | #[allow(unused_mut)]
|
76 - | let mut builder = ::http::Response::builder();
|
97 + | /* ServerHttpBoundProtocolGenerator.kt:547 */
|
98 + | let mut builder = ::http_1x::Response::builder();
|
99 + | /* ServerHttpBoundProtocolGenerator.kt:665 */
|
77 100 | builder = crate::protocol_serde::shape_timestamp_format_headers::ser_timestamp_format_headers_headers(&output, builder)?;
|
101 + | /* ServerHttpBoundProtocolGenerator.kt:633 */
|
78 102 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
79 103 | builder,
|
80 - | ::http::header::CONTENT_TYPE,
|
104 + | ::http_1x::header::CONTENT_TYPE,
|
81 105 | "application/json",
|
82 106 | );
|
107 + | /* ServerHttpBoundProtocolGenerator.kt:718 */
|
83 108 | let http_status: u16 = 200;
|
84 109 | builder = builder.status(http_status);
|
110 + | /* ServerHttpBoundProtocolGenerator.kt:597 */
|
85 111 | let payload =
|
86 - | crate::protocol_serde::shape_timestamp_format_headers_output::ser_timestamp_format_headers_output_output_output(&output)?
|
87 - | ;
|
112 + | /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_timestamp_format_headers_output::ser_timestamp_format_headers_output_output_output(&output)?
|
113 + | /* ServerHttpBoundProtocolGenerator.kt:597 */;
|
114 + | /* ServerHttpBoundProtocolGenerator.kt:699 */
|
88 115 | let content_length = payload.len();
|
89 116 | builder = ::aws_smithy_http::header::set_response_header_if_absent(
|
90 117 | builder,
|
91 - | ::http::header::CONTENT_LENGTH,
|
118 + | ::http_1x::header::CONTENT_LENGTH,
|
92 119 | content_length,
|
93 120 | );
|
121 + | /* ServerHttpBoundProtocolGenerator.kt:603 */
|
94 122 | let body = ::aws_smithy_http_server::body::to_boxed(payload);
|
123 + | /* ServerHttpBoundProtocolGenerator.kt:611 */
|
95 124 | builder.body(body)?
|
125 + | /* ServerHttpBoundProtocolGenerator.kt:457 */
|
96 126 | })
|
127 + | /* ServerHttpBoundProtocolGenerator.kt:445 */
|
97 128 | }
|
98 129 |
|
130 + | /* HttpBindingGenerator.kt:565 */
|
99 131 | pub fn ser_timestamp_format_headers_headers(
|
100 132 | input: &crate::output::TimestampFormatHeadersOutput,
|
101 - | mut builder: ::http::response::Builder,
|
102 - | ) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
|
103 - | {
|
133 + | mut builder: ::http_1x::response::Builder,
|
134 + | ) -> std::result::Result<
|
135 + | ::http_1x::response::Builder,
|
136 + | ::aws_smithy_types::error::operation::BuildError,
|
137 + | > {
|
138 + | /* HttpBindingGenerator.kt:615 */
|
104 139 | if let ::std::option::Option::Some(inner_1) = &input.member_epoch_seconds {
|
140 + | /* HttpBindingGenerator.kt:727 */
|
105 141 | let formatted_2 = inner_1.fmt(::aws_smithy_types::date_time::Format::EpochSeconds)?;
|
142 + | /* HttpBindingGenerator.kt:728 */
|
106 143 | if !formatted_2.is_empty() {
|
144 + | /* HttpBindingGenerator.kt:729 */
|
107 145 | let header_value = formatted_2;
|
108 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
146 + | let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
|
109 147 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
110 148 | "member_epoch_seconds",
|
111 149 | format!(
|
112 150 | "`{}` cannot be used as a header value: {}",
|
113 151 | &header_value, err
|
114 152 | ),
|
115 153 | )
|
116 154 | })?;
|
117 155 | builder = builder.header("X-memberEpochSeconds", header_value);
|
156 + | /* HttpBindingGenerator.kt:728 */
|
118 157 | }
|
158 + | /* HttpBindingGenerator.kt:615 */
|
119 159 | }
|
160 + | /* HttpBindingGenerator.kt:615 */
|
120 161 | if let ::std::option::Option::Some(inner_3) = &input.member_http_date {
|
162 + | /* HttpBindingGenerator.kt:727 */
|
121 163 | let formatted_4 = inner_3.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
164 + | /* HttpBindingGenerator.kt:728 */
|
122 165 | if !formatted_4.is_empty() {
|
166 + | /* HttpBindingGenerator.kt:729 */
|
123 167 | let header_value = formatted_4;
|
124 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
168 + | let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
|
125 169 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
126 170 | "member_http_date",
|
127 171 | format!(
|
128 172 | "`{}` cannot be used as a header value: {}",
|
129 173 | &header_value, err
|
130 174 | ),
|
131 175 | )
|
132 176 | })?;
|
133 177 | builder = builder.header("X-memberHttpDate", header_value);
|
178 + | /* HttpBindingGenerator.kt:728 */
|
134 179 | }
|
180 + | /* HttpBindingGenerator.kt:615 */
|
135 181 | }
|
182 + | /* HttpBindingGenerator.kt:615 */
|
136 183 | if let ::std::option::Option::Some(inner_5) = &input.member_date_time {
|
184 + | /* HttpBindingGenerator.kt:727 */
|
137 185 | let formatted_6 = inner_5.fmt(::aws_smithy_types::date_time::Format::DateTime)?;
|
186 + | /* HttpBindingGenerator.kt:728 */
|
138 187 | if !formatted_6.is_empty() {
|
188 + | /* HttpBindingGenerator.kt:729 */
|
139 189 | let header_value = formatted_6;
|
140 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
190 + | let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
|
141 191 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
142 192 | "member_date_time",
|
143 193 | format!(
|
144 194 | "`{}` cannot be used as a header value: {}",
|
145 195 | &header_value, err
|
146 196 | ),
|
147 197 | )
|
148 198 | })?;
|
149 199 | builder = builder.header("X-memberDateTime", header_value);
|
200 + | /* HttpBindingGenerator.kt:728 */
|
150 201 | }
|
202 + | /* HttpBindingGenerator.kt:615 */
|
151 203 | }
|
204 + | /* HttpBindingGenerator.kt:615 */
|
152 205 | if let ::std::option::Option::Some(inner_7) = &input.default_format {
|
206 + | /* HttpBindingGenerator.kt:727 */
|
153 207 | let formatted_8 = inner_7.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
208 + | /* HttpBindingGenerator.kt:728 */
|
154 209 | if !formatted_8.is_empty() {
|
210 + | /* HttpBindingGenerator.kt:729 */
|
155 211 | let header_value = formatted_8;
|
156 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
212 + | let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
|
157 213 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
158 214 | "default_format",
|
159 215 | format!(
|
160 216 | "`{}` cannot be used as a header value: {}",
|
161 217 | &header_value, err
|
162 218 | ),
|
163 219 | )
|
164 220 | })?;
|
165 221 | builder = builder.header("X-defaultFormat", header_value);
|
222 + | /* HttpBindingGenerator.kt:728 */
|
166 223 | }
|
224 + | /* HttpBindingGenerator.kt:615 */
|
167 225 | }
|
226 + | /* HttpBindingGenerator.kt:615 */
|
168 227 | if let ::std::option::Option::Some(inner_9) = &input.target_epoch_seconds {
|
228 + | /* HttpBindingGenerator.kt:727 */
|
169 229 | let formatted_10 = inner_9.fmt(::aws_smithy_types::date_time::Format::EpochSeconds)?;
|
230 + | /* HttpBindingGenerator.kt:728 */
|
170 231 | if !formatted_10.is_empty() {
|
232 + | /* HttpBindingGenerator.kt:729 */
|
171 233 | let header_value = formatted_10;
|
172 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
234 + | let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
|
173 235 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
174 236 | "target_epoch_seconds",
|
175 237 | format!(
|
176 238 | "`{}` cannot be used as a header value: {}",
|
177 239 | &header_value, err
|
178 240 | ),
|
179 241 | )
|
180 242 | })?;
|
181 243 | builder = builder.header("X-targetEpochSeconds", header_value);
|
244 + | /* HttpBindingGenerator.kt:728 */
|
182 245 | }
|
246 + | /* HttpBindingGenerator.kt:615 */
|
183 247 | }
|
248 + | /* HttpBindingGenerator.kt:615 */
|
184 249 | if let ::std::option::Option::Some(inner_11) = &input.target_http_date {
|
250 + | /* HttpBindingGenerator.kt:727 */
|
185 251 | let formatted_12 = inner_11.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
252 + | /* HttpBindingGenerator.kt:728 */
|
186 253 | if !formatted_12.is_empty() {
|
254 + | /* HttpBindingGenerator.kt:729 */
|
187 255 | let header_value = formatted_12;
|
188 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
256 + | let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
|
189 257 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
190 258 | "target_http_date",
|
191 259 | format!(
|
192 260 | "`{}` cannot be used as a header value: {}",
|
193 261 | &header_value, err
|
194 262 | ),
|
195 263 | )
|
196 264 | })?;
|
197 265 | builder = builder.header("X-targetHttpDate", header_value);
|
266 + | /* HttpBindingGenerator.kt:728 */
|
198 267 | }
|
268 + | /* HttpBindingGenerator.kt:615 */
|
199 269 | }
|
270 + | /* HttpBindingGenerator.kt:615 */
|
200 271 | if let ::std::option::Option::Some(inner_13) = &input.target_date_time {
|
272 + | /* HttpBindingGenerator.kt:727 */
|
201 273 | let formatted_14 = inner_13.fmt(::aws_smithy_types::date_time::Format::DateTime)?;
|
274 + | /* HttpBindingGenerator.kt:728 */
|
202 275 | if !formatted_14.is_empty() {
|
276 + | /* HttpBindingGenerator.kt:729 */
|
203 277 | let header_value = formatted_14;
|
204 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
278 + | let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
|
205 279 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
206 280 | "target_date_time",
|
207 281 | format!(
|
208 282 | "`{}` cannot be used as a header value: {}",
|
209 283 | &header_value, err
|
210 284 | ),
|
211 285 | )
|
212 286 | })?;
|
213 287 | builder = builder.header("X-targetDateTime", header_value);
|
288 + | /* HttpBindingGenerator.kt:728 */
|
214 289 | }
|
290 + | /* HttpBindingGenerator.kt:615 */
|
215 291 | }
|
292 + | /* HttpBindingGenerator.kt:578 */
|
216 293 | Ok(builder)
|
294 + | /* HttpBindingGenerator.kt:565 */
|
217 295 | }
|