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