1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* RustType.kt:516 */
|
2 3 | #[allow(clippy::unnecessary_wraps)]
|
4 + | /* ProtocolParserGenerator.kt:99 */
|
3 5 | pub fn de_timestamp_format_headers_http_error(
|
4 6 | _response_status: u16,
|
5 7 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 8 | _response_body: &[u8],
|
7 9 | ) -> std::result::Result<
|
8 10 | crate::operation::timestamp_format_headers::TimestampFormatHeadersOutput,
|
9 11 | crate::operation::timestamp_format_headers::TimestampFormatHeadersError,
|
10 12 | > {
|
13 + | /* RustType.kt:516 */
|
11 14 | #[allow(unused_mut)]
|
15 + | /* ProtocolParserGenerator.kt:106 */
|
12 16 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 17 | .map_err(crate::operation::timestamp_format_headers::TimestampFormatHeadersError::unhandled)?;
|
18 + | /* ProtocolParserGenerator.kt:120 */
|
14 19 | let generic = generic_builder.build();
|
20 + | /* ProtocolParserGenerator.kt:185 */
|
15 21 | Err(crate::operation::timestamp_format_headers::TimestampFormatHeadersError::generic(generic))
|
22 + | /* ProtocolParserGenerator.kt:99 */
|
16 23 | }
|
17 24 |
|
25 + | /* RustType.kt:516 */
|
18 26 | #[allow(clippy::unnecessary_wraps)]
|
27 + | /* ProtocolParserGenerator.kt:71 */
|
19 28 | pub fn de_timestamp_format_headers_http_response(
|
20 29 | _response_status: u16,
|
21 30 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
22 31 | _response_body: &[u8],
|
23 32 | ) -> std::result::Result<
|
24 33 | crate::operation::timestamp_format_headers::TimestampFormatHeadersOutput,
|
25 34 | crate::operation::timestamp_format_headers::TimestampFormatHeadersError,
|
26 35 | > {
|
36 + | /* ProtocolParserGenerator.kt:77 */
|
27 37 | Ok({
|
38 + | /* RustType.kt:516 */
|
28 39 | #[allow(unused_mut)]
|
40 + | /* ProtocolParserGenerator.kt:240 */
|
29 41 | let mut output = crate::operation::timestamp_format_headers::builders::TimestampFormatHeadersOutputBuilder::default();
|
42 + | /* ProtocolParserGenerator.kt:267 */
|
30 43 | output = output.set_default_format(
|
44 + | /* ProtocolParserGenerator.kt:302 */
|
31 45 | crate::protocol_serde::shape_timestamp_format_headers_output::de_default_format_header(_response_headers).map_err(|_| {
|
32 46 | crate::operation::timestamp_format_headers::TimestampFormatHeadersError::unhandled(
|
33 47 | "Failed to parse defaultFormat from header `X-defaultFormat",
|
34 48 | )
|
35 - | })?,
|
49 + | })?, /* ProtocolParserGenerator.kt:267 */
|
36 50 | );
|
51 + | /* ProtocolParserGenerator.kt:267 */
|
37 52 | output = output.set_member_date_time(
|
53 + | /* ProtocolParserGenerator.kt:302 */
|
38 54 | crate::protocol_serde::shape_timestamp_format_headers_output::de_member_date_time_header(_response_headers).map_err(|_| {
|
39 55 | crate::operation::timestamp_format_headers::TimestampFormatHeadersError::unhandled(
|
40 56 | "Failed to parse memberDateTime from header `X-memberDateTime",
|
41 57 | )
|
42 - | })?,
|
58 + | })?, /* ProtocolParserGenerator.kt:267 */
|
43 59 | );
|
60 + | /* ProtocolParserGenerator.kt:267 */
|
44 61 | output = output.set_member_epoch_seconds(
|
62 + | /* ProtocolParserGenerator.kt:302 */
|
45 63 | crate::protocol_serde::shape_timestamp_format_headers_output::de_member_epoch_seconds_header(_response_headers).map_err(|_| {
|
46 64 | crate::operation::timestamp_format_headers::TimestampFormatHeadersError::unhandled(
|
47 65 | "Failed to parse memberEpochSeconds from header `X-memberEpochSeconds",
|
48 66 | )
|
49 - | })?,
|
67 + | })?, /* ProtocolParserGenerator.kt:267 */
|
50 68 | );
|
69 + | /* ProtocolParserGenerator.kt:267 */
|
51 70 | output = output.set_member_http_date(
|
71 + | /* ProtocolParserGenerator.kt:302 */
|
52 72 | crate::protocol_serde::shape_timestamp_format_headers_output::de_member_http_date_header(_response_headers).map_err(|_| {
|
53 73 | crate::operation::timestamp_format_headers::TimestampFormatHeadersError::unhandled(
|
54 74 | "Failed to parse memberHttpDate from header `X-memberHttpDate",
|
55 75 | )
|
56 - | })?,
|
76 + | })?, /* ProtocolParserGenerator.kt:267 */
|
57 77 | );
|
78 + | /* ProtocolParserGenerator.kt:267 */
|
58 79 | output = output.set_target_date_time(
|
80 + | /* ProtocolParserGenerator.kt:302 */
|
59 81 | crate::protocol_serde::shape_timestamp_format_headers_output::de_target_date_time_header(_response_headers).map_err(|_| {
|
60 82 | crate::operation::timestamp_format_headers::TimestampFormatHeadersError::unhandled(
|
61 83 | "Failed to parse targetDateTime from header `X-targetDateTime",
|
62 84 | )
|
63 - | })?,
|
85 + | })?, /* ProtocolParserGenerator.kt:267 */
|
64 86 | );
|
87 + | /* ProtocolParserGenerator.kt:267 */
|
65 88 | output = output.set_target_epoch_seconds(
|
89 + | /* ProtocolParserGenerator.kt:302 */
|
66 90 | crate::protocol_serde::shape_timestamp_format_headers_output::de_target_epoch_seconds_header(_response_headers).map_err(|_| {
|
67 91 | crate::operation::timestamp_format_headers::TimestampFormatHeadersError::unhandled(
|
68 92 | "Failed to parse targetEpochSeconds from header `X-targetEpochSeconds",
|
69 93 | )
|
70 - | })?,
|
94 + | })?, /* ProtocolParserGenerator.kt:267 */
|
71 95 | );
|
96 + | /* ProtocolParserGenerator.kt:267 */
|
72 97 | output = output.set_target_http_date(
|
98 + | /* ProtocolParserGenerator.kt:302 */
|
73 99 | crate::protocol_serde::shape_timestamp_format_headers_output::de_target_http_date_header(_response_headers).map_err(|_| {
|
74 100 | crate::operation::timestamp_format_headers::TimestampFormatHeadersError::unhandled(
|
75 101 | "Failed to parse targetHttpDate from header `X-targetHttpDate",
|
76 102 | )
|
77 - | })?,
|
103 + | })?, /* ProtocolParserGenerator.kt:267 */
|
78 104 | );
|
105 + | /* ClientBuilderInstantiator.kt:56 */
|
79 106 | output.build()
|
107 + | /* ProtocolParserGenerator.kt:77 */
|
80 108 | })
|
109 + | /* ProtocolParserGenerator.kt:71 */
|
81 110 | }
|
82 111 |
|
112 + | /* HttpBindingGenerator.kt:542 */
|
83 113 | pub fn ser_timestamp_format_headers_headers(
|
84 114 | input: &crate::operation::timestamp_format_headers::TimestampFormatHeadersInput,
|
85 115 | mut builder: ::http::request::Builder,
|
86 116 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
117 + | /* HttpBindingGenerator.kt:592 */
|
87 118 | if let ::std::option::Option::Some(inner_1) = &input.member_epoch_seconds {
|
119 + | /* HttpBindingGenerator.kt:704 */
|
88 120 | let formatted_2 = inner_1.fmt(::aws_smithy_types::date_time::Format::EpochSeconds)?;
|
121 + | /* HttpBindingGenerator.kt:706 */
|
89 122 | let header_value = formatted_2;
|
90 123 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
91 124 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
92 125 | "member_epoch_seconds",
|
93 126 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
94 127 | )
|
95 128 | })?;
|
96 129 | builder = builder.header("X-memberEpochSeconds", header_value);
|
130 + | /* HttpBindingGenerator.kt:592 */
|
97 131 | }
|
132 + | /* HttpBindingGenerator.kt:592 */
|
98 133 | if let ::std::option::Option::Some(inner_3) = &input.member_http_date {
|
134 + | /* HttpBindingGenerator.kt:704 */
|
99 135 | let formatted_4 = inner_3.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
136 + | /* HttpBindingGenerator.kt:706 */
|
100 137 | let header_value = formatted_4;
|
101 138 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
102 139 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
103 140 | "member_http_date",
|
104 141 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
105 142 | )
|
106 143 | })?;
|
107 144 | builder = builder.header("X-memberHttpDate", header_value);
|
145 + | /* HttpBindingGenerator.kt:592 */
|
108 146 | }
|
147 + | /* HttpBindingGenerator.kt:592 */
|
109 148 | if let ::std::option::Option::Some(inner_5) = &input.member_date_time {
|
149 + | /* HttpBindingGenerator.kt:704 */
|
110 150 | let formatted_6 = inner_5.fmt(::aws_smithy_types::date_time::Format::DateTime)?;
|
151 + | /* HttpBindingGenerator.kt:706 */
|
111 152 | let header_value = formatted_6;
|
112 153 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
113 154 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
114 155 | "member_date_time",
|
115 156 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
116 157 | )
|
117 158 | })?;
|
118 159 | builder = builder.header("X-memberDateTime", header_value);
|
160 + | /* HttpBindingGenerator.kt:592 */
|
119 161 | }
|
162 + | /* HttpBindingGenerator.kt:592 */
|
120 163 | if let ::std::option::Option::Some(inner_7) = &input.default_format {
|
164 + | /* HttpBindingGenerator.kt:704 */
|
121 165 | let formatted_8 = inner_7.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
166 + | /* HttpBindingGenerator.kt:706 */
|
122 167 | let header_value = formatted_8;
|
123 168 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
124 169 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
125 170 | "default_format",
|
126 171 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
127 172 | )
|
128 173 | })?;
|
129 174 | builder = builder.header("X-defaultFormat", header_value);
|
175 + | /* HttpBindingGenerator.kt:592 */
|
130 176 | }
|
177 + | /* HttpBindingGenerator.kt:592 */
|
131 178 | if let ::std::option::Option::Some(inner_9) = &input.target_epoch_seconds {
|
179 + | /* HttpBindingGenerator.kt:704 */
|
132 180 | let formatted_10 = inner_9.fmt(::aws_smithy_types::date_time::Format::EpochSeconds)?;
|
181 + | /* HttpBindingGenerator.kt:706 */
|
133 182 | let header_value = formatted_10;
|
134 183 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
135 184 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
136 185 | "target_epoch_seconds",
|
137 186 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
138 187 | )
|
139 188 | })?;
|
140 189 | builder = builder.header("X-targetEpochSeconds", header_value);
|
190 + | /* HttpBindingGenerator.kt:592 */
|
141 191 | }
|
192 + | /* HttpBindingGenerator.kt:592 */
|
142 193 | if let ::std::option::Option::Some(inner_11) = &input.target_http_date {
|
194 + | /* HttpBindingGenerator.kt:704 */
|
143 195 | let formatted_12 = inner_11.fmt(::aws_smithy_types::date_time::Format::HttpDate)?;
|
196 + | /* HttpBindingGenerator.kt:706 */
|
144 197 | let header_value = formatted_12;
|
145 198 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
146 199 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
147 200 | "target_http_date",
|
148 201 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
149 202 | )
|
150 203 | })?;
|
151 204 | builder = builder.header("X-targetHttpDate", header_value);
|
205 + | /* HttpBindingGenerator.kt:592 */
|
152 206 | }
|
207 + | /* HttpBindingGenerator.kt:592 */
|
153 208 | if let ::std::option::Option::Some(inner_13) = &input.target_date_time {
|
209 + | /* HttpBindingGenerator.kt:704 */
|
154 210 | let formatted_14 = inner_13.fmt(::aws_smithy_types::date_time::Format::DateTime)?;
|
211 + | /* HttpBindingGenerator.kt:706 */
|
155 212 | let header_value = formatted_14;
|
156 213 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
157 214 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
158 215 | "target_date_time",
|
159 216 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
160 217 | )
|
161 218 | })?;
|
162 219 | builder = builder.header("X-targetDateTime", header_value);
|
220 + | /* HttpBindingGenerator.kt:592 */
|
163 221 | }
|
222 + | /* HttpBindingGenerator.kt:555 */
|
164 223 | Ok(builder)
|
224 + | /* HttpBindingGenerator.kt:542 */
|
165 225 | }
|