1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_describe_aggregate_compliance_by_conformance_packs_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::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksOutput,
|
9 - | crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError,
|
10 - | > {
|
11 - | #[allow(unused_mut)]
|
12 - | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body).map_err(
|
13 - | crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::unhandled,
|
14 - | )?;
|
15 - | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
16 - | let generic = generic_builder.build();
|
17 - | let error_code =
|
18 - | match generic.code() {
|
19 - | Some(code) => code,
|
20 - | None => return Err(
|
21 - | crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::unhandled(
|
22 - | generic,
|
23 - | ),
|
24 - | ),
|
25 - | };
|
26 - |
|
27 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
28 - | Err(match error_code {
|
29 - | "InvalidLimitException" => crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::InvalidLimitException({
|
30 - | #[allow(unused_mut)]
|
31 - | let mut tmp =
|
32 - | {
|
33 - | #[allow(unused_mut)]
|
34 - | let mut output = crate::types::error::builders::InvalidLimitExceptionBuilder::default();
|
35 - | output = crate::protocol_serde::shape_invalid_limit_exception::de_invalid_limit_exception_json_err(_response_body, output).map_err(crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::unhandled)?;
|
36 - | let output = output.meta(generic);
|
37 - | output.build()
|
38 - | }
|
39 - | ;
|
40 - | if tmp.message.is_none() {
|
41 - | tmp.message = _error_message;
|
42 - | }
|
43 - | tmp
|
44 - | }),
|
45 - | "InvalidNextTokenException" => crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::InvalidNextTokenException({
|
46 - | #[allow(unused_mut)]
|
47 - | let mut tmp =
|
48 - | {
|
49 - | #[allow(unused_mut)]
|
50 - | let mut output = crate::types::error::builders::InvalidNextTokenExceptionBuilder::default();
|
51 - | output = crate::protocol_serde::shape_invalid_next_token_exception::de_invalid_next_token_exception_json_err(_response_body, output).map_err(crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::unhandled)?;
|
52 - | let output = output.meta(generic);
|
53 - | output.build()
|
54 - | }
|
55 - | ;
|
56 - | if tmp.message.is_none() {
|
57 - | tmp.message = _error_message;
|
58 - | }
|
59 - | tmp
|
60 - | }),
|
61 - | "NoSuchConfigurationAggregatorException" => crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::NoSuchConfigurationAggregatorException({
|
62 - | #[allow(unused_mut)]
|
63 - | let mut tmp =
|
64 - | {
|
65 - | #[allow(unused_mut)]
|
66 - | let mut output = crate::types::error::builders::NoSuchConfigurationAggregatorExceptionBuilder::default();
|
67 - | output = crate::protocol_serde::shape_no_such_configuration_aggregator_exception::de_no_such_configuration_aggregator_exception_json_err(_response_body, output).map_err(crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::unhandled)?;
|
68 - | let output = output.meta(generic);
|
69 - | output.build()
|
70 - | }
|
71 - | ;
|
72 - | if tmp.message.is_none() {
|
73 - | tmp.message = _error_message;
|
74 - | }
|
75 - | tmp
|
76 - | }),
|
77 - | "ValidationException" => crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::ValidationException({
|
78 - | #[allow(unused_mut)]
|
79 - | let mut tmp =
|
80 - | {
|
81 - | #[allow(unused_mut)]
|
82 - | let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
|
83 - | output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::unhandled)?;
|
84 - | let output = output.meta(generic);
|
85 - | output.build()
|
86 - | }
|
87 - | ;
|
88 - | if tmp.message.is_none() {
|
89 - | tmp.message = _error_message;
|
90 - | }
|
91 - | tmp
|
92 - | }),
|
93 - | _ => crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::generic(generic)
|
94 - | })
|
95 - | }
|
96 - |
|
97 - | #[allow(clippy::unnecessary_wraps)]
|
98 - | pub fn de_describe_aggregate_compliance_by_conformance_packs_http_response(
|
99 - | _response_status: u16,
|
100 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
101 - | _response_body: &[u8],
|
102 - | ) -> std::result::Result<
|
103 - | crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksOutput,
|
104 - | crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError,
|
105 - | > {
|
106 - | Ok({
|
107 - | #[allow(unused_mut)]
|
108 - | let mut output = crate::operation::describe_aggregate_compliance_by_conformance_packs::builders::DescribeAggregateComplianceByConformancePacksOutputBuilder::default();
|
109 - | output =
|
110 - | crate::protocol_serde::shape_describe_aggregate_compliance_by_conformance_packs::de_describe_aggregate_compliance_by_conformance_packs(
|
111 - | _response_body,
|
112 - | output,
|
113 - | )
|
114 - | .map_err(
|
115 - | crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::unhandled,
|
116 - | )?;
|
117 - | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
118 - | output.build()
|
119 - | })
|
120 - | }
|
121 - |
|
122 - | pub fn ser_describe_aggregate_compliance_by_conformance_packs_input(
|
123 - | input: &crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksInput,
|
124 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
125 - | let mut out = String::new();
|
126 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
127 - | crate::protocol_serde::shape_describe_aggregate_compliance_by_conformance_packs_input::ser_describe_aggregate_compliance_by_conformance_packs_input_input(&mut object, input)?;
|
128 - | object.finish();
|
129 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
130 - | }
|
131 - |
|
132 - | pub(crate) fn de_describe_aggregate_compliance_by_conformance_packs(
|
133 - | _value: &[u8],
|
134 - | mut builder: crate::operation::describe_aggregate_compliance_by_conformance_packs::builders::DescribeAggregateComplianceByConformancePacksOutputBuilder,
|
135 - | ) -> ::std::result::Result<
|
136 - | crate::operation::describe_aggregate_compliance_by_conformance_packs::builders::DescribeAggregateComplianceByConformancePacksOutputBuilder,
|
137 - | ::aws_smithy_json::deserialize::error::DeserializeError,
|
138 - | > {
|
139 - | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
|
140 - | let tokens = &mut tokens_owned;
|
141 - | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
142 - | loop {
|
143 - | match tokens.next().transpose()? {
|
144 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
145 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
146 - | match key.to_unescaped()?.as_ref() {
|
147 - | "AggregateComplianceByConformancePacks" => {
|
148 - | builder = builder.set_aggregate_compliance_by_conformance_packs(
|
149 - | crate::protocol_serde::shape_aggregate_compliance_by_conformance_pack_list::de_aggregate_compliance_by_conformance_pack_list(tokens, _value)?
|
150 - | );
|
151 - | }
|
152 - | "NextToken" => {
|
153 - | builder = builder.set_next_token(
|
154 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
155 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
156 - | .transpose()?,
|
157 - | );
|
158 - | }
|
159 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
160 - | }
|
161 - | }
|
162 - | other => {
|
163 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
164 - | "expected object key or end object, found: {other:?}"
|
165 - | )))
|
166 - | }
|
167 - | }
|
168 - | }
|
169 - | if tokens.next().is_some() {
|
170 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
171 - | "found more JSON tokens after completing parsing",
|
172 - | ));
|
173 - | }
|
174 - | Ok(builder)
|
175 - | }
|