1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_malformed_short_http_error(
|
4 - | _response_status: u16,
|
5 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 - | _response_body: &[u8],
|
7 - | ) -> std::result::Result<crate::operation::malformed_short::MalformedShortOutput, crate::operation::malformed_short::MalformedShortError> {
|
8 - | #[allow(unused_mut)]
|
9 - | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
10 - | .map_err(crate::operation::malformed_short::MalformedShortError::unhandled)?;
|
11 - | let generic = generic_builder.build();
|
12 - | Err(crate::operation::malformed_short::MalformedShortError::generic(generic))
|
13 - | }
|
14 - |
|
15 - | #[allow(clippy::unnecessary_wraps)]
|
16 - | pub fn de_malformed_short_http_response(
|
17 - | _response_status: u16,
|
18 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
19 - | _response_body: &[u8],
|
20 - | ) -> std::result::Result<crate::operation::malformed_short::MalformedShortOutput, crate::operation::malformed_short::MalformedShortError> {
|
21 - | Ok({
|
22 - | #[allow(unused_mut)]
|
23 - | let mut output = crate::operation::malformed_short::builders::MalformedShortOutputBuilder::default();
|
24 - | output.build()
|
25 - | })
|
26 - | }
|
27 - |
|
28 - | pub fn ser_malformed_short_headers(
|
29 - | input: &crate::operation::malformed_short::MalformedShortInput,
|
30 - | mut builder: ::http_1x::request::Builder,
|
31 - | ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
32 - | if let ::std::option::Option::Some(inner_1) = &input.short_in_header {
|
33 - | let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_1);
|
34 - | let formatted_2 = encoder.encode();
|
35 - | let header_value = formatted_2;
|
36 - | let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
|
37 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
38 - | "short_in_header",
|
39 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
40 - | )
|
41 - | })?;
|
42 - | builder = builder.header("shortInHeader", header_value);
|
43 - | }
|
44 - | Ok(builder)
|
45 - | }
|
46 - |
|
47 - | pub fn ser_malformed_short_input(
|
48 - | input: &crate::operation::malformed_short::MalformedShortInput,
|
49 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
50 - | let mut out = String::new();
|
51 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
52 - | crate::protocol_serde::shape_malformed_short_input::ser_malformed_short_input_input(&mut object, input)?;
|
53 - | object.finish();
|
54 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
55 - | }
|