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