147 153 | ::std::borrow::Cow::Owned(rcb)
|
148 154 | }
|
149 155 | }
|
150 156 |
|
151 157 | #[derive(Debug)]
|
152 158 | struct DeleteRemediationConfigurationResponseDeserializer;
|
153 159 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteRemediationConfigurationResponseDeserializer {
|
154 160 | fn deserialize_nonstreaming(
|
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_delete_remediation_configuration::de_delete_remediation_configuration_http_error(status, headers, body)
|
166 - | } else {
|
167 - | crate::protocol_serde::shape_delete_remediation_configuration::de_delete_remediation_configuration_http_response(status, headers, body)
|
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::delete_remediation_configuration::DeleteRemediationConfigurationError::unhandled(generic),
|
184 + | ),
|
185 + | ))
|
186 + | }
|
187 + | };
|
188 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
189 + | let protocol = _cfg
|
190 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
191 + | .expect("a SharedClientProtocol is required");
|
192 + | let err = match error_code {
|
193 + | "InsufficientPermissionsException" => {
|
194 + | crate::operation::delete_remediation_configuration::DeleteRemediationConfigurationError::InsufficientPermissionsException({
|
195 + | let mut tmp = match protocol
|
196 + | .deserialize_response(response, crate::types::error::InsufficientPermissionsException::SCHEMA, _cfg)
|
197 + | .and_then(|mut deser| {
|
198 + | crate::types::error::InsufficientPermissionsException::deserialize_with_response(
|
199 + | &mut *deser,
|
200 + | response.headers(),
|
201 + | response.status().into(),
|
202 + | body,
|
203 + | )
|
204 + | }) {
|
205 + | ::std::result::Result::Ok(val) => val,
|
206 + | ::std::result::Result::Err(e) => {
|
207 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
208 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
209 + | ))
|
210 + | }
|
168 211 | };
|
169 - | crate::protocol_serde::type_erase_result(parse_result)
|
212 + | tmp.meta = generic;
|
213 + | if tmp.message.is_none() {
|
214 + | tmp.message = _error_message;
|
215 + | }
|
216 + | tmp
|
217 + | })
|
218 + | }
|
219 + | "InvalidParameterValueException" => {
|
220 + | crate::operation::delete_remediation_configuration::DeleteRemediationConfigurationError::InvalidParameterValueException({
|
221 + | let mut tmp = match protocol
|
222 + | .deserialize_response(response, crate::types::error::InvalidParameterValueException::SCHEMA, _cfg)
|
223 + | .and_then(|mut deser| {
|
224 + | crate::types::error::InvalidParameterValueException::deserialize_with_response(
|
225 + | &mut *deser,
|
226 + | response.headers(),
|
227 + | response.status().into(),
|
228 + | body,
|
229 + | )
|
230 + | }) {
|
231 + | ::std::result::Result::Ok(val) => val,
|
232 + | ::std::result::Result::Err(e) => {
|
233 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
234 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
235 + | ))
|
236 + | }
|
237 + | };
|
238 + | tmp.meta = generic;
|
239 + | if tmp.message.is_none() {
|
240 + | tmp.message = _error_message;
|
241 + | }
|
242 + | tmp
|
243 + | })
|
244 + | }
|
245 + | "NoSuchRemediationConfigurationException" => {
|
246 + | crate::operation::delete_remediation_configuration::DeleteRemediationConfigurationError::NoSuchRemediationConfigurationException(
|
247 + | {
|
248 + | let mut tmp = match protocol
|
249 + | .deserialize_response(response, crate::types::error::NoSuchRemediationConfigurationException::SCHEMA, _cfg)
|
250 + | .and_then(|mut deser| {
|
251 + | crate::types::error::NoSuchRemediationConfigurationException::deserialize_with_response(
|
252 + | &mut *deser,
|
253 + | response.headers(),
|
254 + | response.status().into(),
|
255 + | body,
|
256 + | )
|
257 + | }) {
|
258 + | ::std::result::Result::Ok(val) => val,
|
259 + | ::std::result::Result::Err(e) => {
|
260 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
261 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
262 + | ))
|
263 + | }
|
264 + | };
|
265 + | tmp.meta = generic;
|
266 + | if tmp.message.is_none() {
|
267 + | tmp.message = _error_message;
|
268 + | }
|
269 + | tmp
|
270 + | },
|
271 + | )
|
272 + | }
|
273 + | "RemediationInProgressException" => {
|
274 + | crate::operation::delete_remediation_configuration::DeleteRemediationConfigurationError::RemediationInProgressException({
|
275 + | let mut tmp = match protocol
|
276 + | .deserialize_response(response, crate::types::error::RemediationInProgressException::SCHEMA, _cfg)
|
277 + | .and_then(|mut deser| {
|
278 + | crate::types::error::RemediationInProgressException::deserialize_with_response(
|
279 + | &mut *deser,
|
280 + | response.headers(),
|
281 + | response.status().into(),
|
282 + | body,
|
283 + | )
|
284 + | }) {
|
285 + | ::std::result::Result::Ok(val) => val,
|
286 + | ::std::result::Result::Err(e) => {
|
287 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
288 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
289 + | ))
|
290 + | }
|
291 + | };
|
292 + | tmp.meta = generic;
|
293 + | if tmp.message.is_none() {
|
294 + | tmp.message = _error_message;
|
295 + | }
|
296 + | tmp
|
297 + | })
|
298 + | }
|
299 + | _ => crate::operation::delete_remediation_configuration::DeleteRemediationConfigurationError::generic(generic),
|
300 + | };
|
301 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
302 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
303 + | ))
|
304 + | } else {
|
305 + | let protocol = _cfg
|
306 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
307 + | .expect("a SharedClientProtocol is required");
|
308 + | let mut deser = protocol
|
309 + | .deserialize_response(response, DeleteRemediationConfiguration::OUTPUT_SCHEMA, _cfg)
|
310 + | .map_err(|e| {
|
311 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
312 + | })?;
|
313 + | let body = response.body().bytes().expect("body loaded");
|
314 + | let output = crate::operation::delete_remediation_configuration::DeleteRemediationConfigurationOutput::deserialize_with_response(
|
315 + | &mut *deser,
|
316 + | response.headers(),
|
317 + | response.status().into(),
|
318 + | body,
|
319 + | )
|
320 + | .map_err(|e| {
|
321 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
322 + | })?;
|
323 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
324 + | }
|
170 325 | }
|
171 326 | }
|
172 327 | #[derive(Debug)]
|
173 328 | struct DeleteRemediationConfigurationRequestSerializer;
|
174 329 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DeleteRemediationConfigurationRequestSerializer {
|
175 330 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
176 331 | fn serialize_input(
|
177 332 | &self,
|
178 333 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
179 334 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
180 335 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
181 336 | let input = input
|
182 337 | .downcast::<crate::operation::delete_remediation_configuration::DeleteRemediationConfigurationInput>()
|
183 338 | .expect("correct type");
|
184 - | let _header_serialization_settings = _cfg
|
185 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
186 - | .cloned()
|
187 - | .unwrap_or_default();
|
188 - | let mut request_builder = {
|
189 - | #[allow(clippy::uninlined_format_args)]
|
190 - | fn uri_base(
|
191 - | _input: &crate::operation::delete_remediation_configuration::DeleteRemediationConfigurationInput,
|
192 - | output: &mut ::std::string::String,
|
193 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
194 - | use ::std::fmt::Write as _;
|
195 - | ::std::write!(output, "/").expect("formatting should succeed");
|
196 - | ::std::result::Result::Ok(())
|
197 - | }
|
198 - | #[allow(clippy::unnecessary_wraps)]
|
199 - | fn update_http_builder(
|
200 - | input: &crate::operation::delete_remediation_configuration::DeleteRemediationConfigurationInput,
|
201 - | builder: ::http_1x::request::Builder,
|
202 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
203 - | let mut uri = ::std::string::String::new();
|
204 - | uri_base(input, &mut uri)?;
|
205 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
206 - | }
|
207 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
208 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
|
209 - | builder = _header_serialization_settings.set_default_header(
|
210 - | builder,
|
211 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
212 - | "StarlingDoveService.DeleteRemediationConfiguration",
|
213 - | );
|
214 - | builder
|
215 - | };
|
216 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
217 - | crate::protocol_serde::shape_delete_remediation_configuration::ser_delete_remediation_configuration_input(&input)?,
|
218 - | );
|
219 - | if let Some(content_length) = body.content_length() {
|
220 - | let content_length = content_length.to_string();
|
221 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
222 - | }
|
223 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
339 + | let protocol = _cfg
|
340 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
341 + | .expect("a SharedClientProtocol is required");
|
342 + | let mut request = protocol
|
343 + | .serialize_request(&input, DeleteRemediationConfiguration::INPUT_SCHEMA, "", _cfg)
|
344 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
345 + |
|
346 + | return ::std::result::Result::Ok(request);
|
224 347 | }
|
225 348 | }
|
226 349 | #[derive(Debug)]
|
227 350 | struct DeleteRemediationConfigurationEndpointParamsInterceptor;
|
228 351 |
|
229 352 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteRemediationConfigurationEndpointParamsInterceptor {
|
230 353 | fn name(&self) -> &'static str {
|
231 354 | "DeleteRemediationConfigurationEndpointParamsInterceptor"
|
232 355 | }
|
233 356 |
|