140 146 | crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError,
|
141 147 | >::new());
|
142 148 |
|
143 149 | ::std::borrow::Cow::Owned(rcb)
|
144 150 | }
|
145 151 | }
|
146 152 |
|
147 153 | #[derive(Debug)]
|
148 154 | struct DescribeAggregateComplianceByConformancePacksResponseDeserializer;
|
149 155 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DescribeAggregateComplianceByConformancePacksResponseDeserializer {
|
150 - | fn deserialize_nonstreaming(
|
156 + | fn deserialize_nonstreaming_with_config(
|
151 157 | &self,
|
152 158 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
159 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
153 160 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
154 161 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
155 - | let headers = response.headers();
|
156 - | let body = response.body().bytes().expect("body loaded");
|
157 162 | #[allow(unused_mut)]
|
158 163 | let mut force_error = false;
|
159 164 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
160 - | let parse_result = if !success && status != 200 || force_error {
|
161 - | crate::protocol_serde::shape_describe_aggregate_compliance_by_conformance_packs::de_describe_aggregate_compliance_by_conformance_packs_http_error(status, headers, body)
|
165 + | if !success && status != 200 || force_error {
|
166 + | let headers = response.headers();
|
167 + | let body = response.body().bytes().expect("body loaded");
|
168 + | #[allow(unused_mut)]
|
169 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
170 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
171 + | })?;
|
172 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
173 + | let generic = generic_builder.build();
|
174 + | let error_code = match generic.code() {
|
175 + | ::std::option::Option::Some(code) => code,
|
176 + | ::std::option::Option::None => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::unhandled(generic)))),
|
177 + | };
|
178 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
179 + | let protocol = _cfg
|
180 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
181 + | .expect("a SharedClientProtocol is required");
|
182 + | let err = match error_code {
|
183 + | "InvalidLimitException" => crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::InvalidLimitException({
|
184 + | let mut tmp = match protocol.deserialize_response(response, crate::types::error::InvalidLimitException::SCHEMA, _cfg)
|
185 + | .and_then(|mut deser| crate::types::error::InvalidLimitException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
|
186 + | {
|
187 + | ::std::result::Result::Ok(val) => val,
|
188 + | ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
|
189 + | };
|
190 + | tmp.meta = generic;
|
191 + | if tmp.message.is_none() {
|
192 + | tmp.message = _error_message;
|
193 + | }
|
194 + | tmp
|
195 + | }),
|
196 + | "InvalidNextTokenException" => crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::InvalidNextTokenException({
|
197 + | let mut tmp = match protocol.deserialize_response(response, crate::types::error::InvalidNextTokenException::SCHEMA, _cfg)
|
198 + | .and_then(|mut deser| crate::types::error::InvalidNextTokenException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
|
199 + | {
|
200 + | ::std::result::Result::Ok(val) => val,
|
201 + | ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
|
202 + | };
|
203 + | tmp.meta = generic;
|
204 + | if tmp.message.is_none() {
|
205 + | tmp.message = _error_message;
|
206 + | }
|
207 + | tmp
|
208 + | }),
|
209 + | "NoSuchConfigurationAggregatorException" => crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::NoSuchConfigurationAggregatorException({
|
210 + | let mut tmp = match protocol.deserialize_response(response, crate::types::error::NoSuchConfigurationAggregatorException::SCHEMA, _cfg)
|
211 + | .and_then(|mut deser| crate::types::error::NoSuchConfigurationAggregatorException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
|
212 + | {
|
213 + | ::std::result::Result::Ok(val) => val,
|
214 + | ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
|
215 + | };
|
216 + | tmp.meta = generic;
|
217 + | if tmp.message.is_none() {
|
218 + | tmp.message = _error_message;
|
219 + | }
|
220 + | tmp
|
221 + | }),
|
222 + | "ValidationException" => crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::ValidationException({
|
223 + | let mut tmp = match protocol.deserialize_response(response, crate::types::error::ValidationException::SCHEMA, _cfg)
|
224 + | .and_then(|mut deser| crate::types::error::ValidationException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
|
225 + | {
|
226 + | ::std::result::Result::Ok(val) => val,
|
227 + | ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
|
228 + | };
|
229 + | tmp.meta = generic;
|
230 + | if tmp.message.is_none() {
|
231 + | tmp.message = _error_message;
|
232 + | }
|
233 + | tmp
|
234 + | }),
|
235 + | _ => crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksError::generic(generic)
|
236 + | };
|
237 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
238 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
239 + | ))
|
162 240 | } else {
|
163 - | crate::protocol_serde::shape_describe_aggregate_compliance_by_conformance_packs::de_describe_aggregate_compliance_by_conformance_packs_http_response(status, headers, body)
|
164 - | };
|
165 - | crate::protocol_serde::type_erase_result(parse_result)
|
241 + | let protocol = _cfg
|
242 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
243 + | .expect("a SharedClientProtocol is required");
|
244 + | let mut deser = protocol
|
245 + | .deserialize_response(response, DescribeAggregateComplianceByConformancePacks::OUTPUT_SCHEMA, _cfg)
|
246 + | .map_err(|e| {
|
247 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
248 + | })?;
|
249 + | let body = response.body().bytes().expect("body loaded");
|
250 + | let output = crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksOutput::deserialize_with_response(
|
251 + | &mut *deser,
|
252 + | response.headers(),
|
253 + | response.status().into(),
|
254 + | body,
|
255 + | ).map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
|
256 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
257 + | }
|
166 258 | }
|
167 259 | }
|
168 260 | #[derive(Debug)]
|
169 261 | struct DescribeAggregateComplianceByConformancePacksRequestSerializer;
|
170 262 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DescribeAggregateComplianceByConformancePacksRequestSerializer {
|
171 263 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
172 264 | fn serialize_input(
|
173 265 | &self,
|
174 266 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
175 267 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
176 268 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
177 269 | let input = input
|
178 270 | .downcast::<crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksInput>()
|
179 271 | .expect("correct type");
|
180 - | let _header_serialization_settings = _cfg
|
181 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
182 - | .cloned()
|
183 - | .unwrap_or_default();
|
184 - | let mut request_builder = {
|
185 - | #[allow(clippy::uninlined_format_args)]
|
186 - | fn uri_base(
|
187 - | _input: &crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksInput,
|
188 - | output: &mut ::std::string::String,
|
189 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
190 - | use ::std::fmt::Write as _;
|
191 - | ::std::write!(output, "/").expect("formatting should succeed");
|
192 - | ::std::result::Result::Ok(())
|
193 - | }
|
194 - | #[allow(clippy::unnecessary_wraps)]
|
195 - | fn update_http_builder(
|
196 - | input: &crate::operation::describe_aggregate_compliance_by_conformance_packs::DescribeAggregateComplianceByConformancePacksInput,
|
197 - | builder: ::http_1x::request::Builder,
|
198 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
199 - | let mut uri = ::std::string::String::new();
|
200 - | uri_base(input, &mut uri)?;
|
201 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
202 - | }
|
203 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
204 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
|
205 - | builder = _header_serialization_settings.set_default_header(
|
206 - | builder,
|
207 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
208 - | "StarlingDoveService.DescribeAggregateComplianceByConformancePacks",
|
209 - | );
|
210 - | builder
|
211 - | };
|
212 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_describe_aggregate_compliance_by_conformance_packs::ser_describe_aggregate_compliance_by_conformance_packs_input(&input)?);
|
213 - | if let Some(content_length) = body.content_length() {
|
214 - | let content_length = content_length.to_string();
|
215 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
216 - | }
|
217 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
272 + | let protocol = _cfg
|
273 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
274 + | .expect("a SharedClientProtocol is required");
|
275 + | let mut request = protocol
|
276 + | .serialize_request(&input, DescribeAggregateComplianceByConformancePacks::INPUT_SCHEMA, "", _cfg)
|
277 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
278 + |
|
279 + | return ::std::result::Result::Ok(request);
|
218 280 | }
|
219 281 | }
|
220 282 | #[derive(Debug)]
|
221 283 | struct DescribeAggregateComplianceByConformancePacksEndpointParamsInterceptor;
|
222 284 |
|
223 285 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeAggregateComplianceByConformancePacksEndpointParamsInterceptor {
|
224 286 | fn name(&self) -> &'static str {
|
225 287 | "DescribeAggregateComplianceByConformancePacksEndpointParamsInterceptor"
|
226 288 | }
|
227 289 |
|