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_http_payload_traits_with_media_type_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::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput,
|
9 11 | crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError,
|
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::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError::unhandled)?;
|
18 + | /* ProtocolParserGenerator.kt:120 */
|
14 19 | let generic = generic_builder.build();
|
20 + | /* ProtocolParserGenerator.kt:185 */
|
15 21 | Err(crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError::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_http_payload_traits_with_media_type_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::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeOutput,
|
25 34 | crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError,
|
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::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeOutputBuilder::default();
|
30 - | output = output.set_blob(crate::protocol_serde::shape_http_payload_traits_with_media_type_output::de_blob_payload(
|
31 - | _response_body,
|
32 - | )?);
|
42 + | /* ProtocolParserGenerator.kt:267 */
|
43 + | output = output.set_blob(
|
44 + | /* ProtocolParserGenerator.kt:327 */crate::protocol_serde::shape_http_payload_traits_with_media_type_output::de_blob_payload(_response_body)?
|
45 + | /* ProtocolParserGenerator.kt:267 */);
|
46 + | /* ProtocolParserGenerator.kt:267 */
|
33 47 | output = output.set_foo(
|
48 + | /* ProtocolParserGenerator.kt:302 */
|
34 49 | crate::protocol_serde::shape_http_payload_traits_with_media_type_output::de_foo_header(_response_headers).map_err(|_| {
|
35 50 | crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeError::unhandled(
|
36 51 | "Failed to parse foo from header `X-Foo",
|
37 52 | )
|
38 - | })?,
|
53 + | })?, /* ProtocolParserGenerator.kt:267 */
|
39 54 | );
|
55 + | /* ClientBuilderInstantiator.kt:56 */
|
40 56 | output.build()
|
57 + | /* ProtocolParserGenerator.kt:77 */
|
41 58 | })
|
59 + | /* ProtocolParserGenerator.kt:71 */
|
42 60 | }
|
43 61 |
|
62 + | /* HttpBindingGenerator.kt:542 */
|
44 63 | pub fn ser_http_payload_traits_with_media_type_headers(
|
45 64 | input: &crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput,
|
46 65 | mut builder: ::http::request::Builder,
|
47 66 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
67 + | /* HttpBindingGenerator.kt:592 */
|
48 68 | if let ::std::option::Option::Some(inner_1) = &input.foo {
|
69 + | /* HttpBindingGenerator.kt:704 */
|
49 70 | let formatted_2 = inner_1.as_str();
|
71 + | /* HttpBindingGenerator.kt:706 */
|
50 72 | let header_value = formatted_2;
|
51 73 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
52 74 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
53 75 | "foo",
|
54 76 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
55 77 | )
|
56 78 | })?;
|
57 79 | builder = builder.header("X-Foo", header_value);
|
80 + | /* HttpBindingGenerator.kt:592 */
|
58 81 | }
|
82 + | /* HttpBindingGenerator.kt:555 */
|
59 83 | Ok(builder)
|
84 + | /* HttpBindingGenerator.kt:542 */
|
60 85 | }
|