1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_http_checksum_required_http_error(
|
4 - | _response_status: u16,
|
5 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 - | _response_body: &[u8],
|
7 - | ) -> std::result::Result<
|
8 - | crate::operation::http_checksum_required::HttpChecksumRequiredOutput,
|
9 - | crate::operation::http_checksum_required::HttpChecksumRequiredError,
|
10 - | > {
|
11 - | #[allow(unused_mut)]
|
12 - | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 - | .map_err(crate::operation::http_checksum_required::HttpChecksumRequiredError::unhandled)?;
|
14 - | let generic = generic_builder.build();
|
15 - | Err(crate::operation::http_checksum_required::HttpChecksumRequiredError::generic(generic))
|
16 - | }
|
17 - |
|
18 - | #[allow(clippy::unnecessary_wraps)]
|
19 - | pub fn de_http_checksum_required_http_response(
|
20 - | _response_status: u16,
|
21 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
22 - | _response_body: &[u8],
|
23 - | ) -> std::result::Result<
|
24 - | crate::operation::http_checksum_required::HttpChecksumRequiredOutput,
|
25 - | crate::operation::http_checksum_required::HttpChecksumRequiredError,
|
26 - | > {
|
27 - | Ok({
|
28 - | #[allow(unused_mut)]
|
29 - | let mut output = crate::operation::http_checksum_required::builders::HttpChecksumRequiredOutputBuilder::default();
|
30 - | output = crate::protocol_serde::shape_http_checksum_required::de_http_checksum_required(_response_body, output)
|
31 - | .map_err(crate::operation::http_checksum_required::HttpChecksumRequiredError::unhandled)?;
|
32 - | output.build()
|
33 - | })
|
34 - | }
|
35 - |
|
36 - | pub fn ser_http_checksum_required_input(
|
37 - | input: &crate::operation::http_checksum_required::HttpChecksumRequiredInput,
|
38 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
39 - | let mut out = String::new();
|
40 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
41 - | crate::protocol_serde::shape_http_checksum_required_input::ser_http_checksum_required_input_input(&mut object, input)?;
|
42 - | object.finish();
|
43 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
44 - | }
|
45 - |
|
46 - | pub(crate) fn de_http_checksum_required(
|
47 - | _value: &[u8],
|
48 - | mut builder: crate::operation::http_checksum_required::builders::HttpChecksumRequiredOutputBuilder,
|
49 - | ) -> ::std::result::Result<
|
50 - | crate::operation::http_checksum_required::builders::HttpChecksumRequiredOutputBuilder,
|
51 - | ::aws_smithy_json::deserialize::error::DeserializeError,
|
52 - | > {
|
53 - | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
|
54 - | let tokens = &mut tokens_owned;
|
55 - | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
56 - | loop {
|
57 - | match tokens.next().transpose()? {
|
58 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
59 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
60 - | "foo" => {
|
61 - | builder = builder.set_foo(
|
62 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
63 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
64 - | .transpose()?,
|
65 - | );
|
66 - | }
|
67 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
68 - | },
|
69 - | other => {
|
70 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
71 - | "expected object key or end object, found: {other:?}"
|
72 - | )))
|
73 - | }
|
74 - | }
|
75 - | }
|
76 - | if tokens.next().is_some() {
|
77 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
78 - | "found more JSON tokens after completing parsing",
|
79 - | ));
|
80 - | }
|
81 - | Ok(builder)
|
82 - | }
|