144 150 | crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError,
|
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 DeleteConfigurationRecorderResponseDeserializer;
|
153 159 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteConfigurationRecorderResponseDeserializer {
|
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_delete_configuration_recorder::de_delete_configuration_recorder_http_error(status, headers, body)
|
166 - | } else {
|
167 - | crate::protocol_serde::shape_delete_configuration_recorder::de_delete_configuration_recorder_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_configuration_recorder::DeleteConfigurationRecorderError::unhandled(generic),
|
184 + | ),
|
185 + | ))
|
186 + | }
|
168 187 | };
|
169 - | crate::protocol_serde::type_erase_result(parse_result)
|
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 + | "NoSuchConfigurationRecorderException" => {
|
194 + | crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError::NoSuchConfigurationRecorderException({
|
195 + | let mut tmp = match protocol
|
196 + | .deserialize_response(response, crate::types::error::NoSuchConfigurationRecorderException::SCHEMA, _cfg)
|
197 + | .and_then(|mut deser| {
|
198 + | crate::types::error::NoSuchConfigurationRecorderException::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 + | }
|
211 + | };
|
212 + | tmp.meta = generic;
|
213 + | if tmp.message.is_none() {
|
214 + | tmp.message = _error_message;
|
215 + | }
|
216 + | tmp
|
217 + | })
|
218 + | }
|
219 + | "UnmodifiableEntityException" => {
|
220 + | crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError::UnmodifiableEntityException({
|
221 + | let mut tmp = match protocol
|
222 + | .deserialize_response(response, crate::types::error::UnmodifiableEntityException::SCHEMA, _cfg)
|
223 + | .and_then(|mut deser| {
|
224 + | crate::types::error::UnmodifiableEntityException::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 + | _ => crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError::generic(generic),
|
246 + | };
|
247 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
248 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
249 + | ))
|
250 + | } else {
|
251 + | let protocol = _cfg
|
252 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
253 + | .expect("a SharedClientProtocol is required");
|
254 + | let mut deser = protocol
|
255 + | .deserialize_response(response, DeleteConfigurationRecorder::OUTPUT_SCHEMA, _cfg)
|
256 + | .map_err(|e| {
|
257 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
258 + | })?;
|
259 + | let body = response.body().bytes().expect("body loaded");
|
260 + | let output = crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderOutput::deserialize_with_response(
|
261 + | &mut *deser,
|
262 + | response.headers(),
|
263 + | response.status().into(),
|
264 + | body,
|
265 + | )
|
266 + | .map_err(|e| {
|
267 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
268 + | })?;
|
269 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
270 + | }
|
170 271 | }
|
171 272 | }
|
172 273 | #[derive(Debug)]
|
173 274 | struct DeleteConfigurationRecorderRequestSerializer;
|
174 275 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DeleteConfigurationRecorderRequestSerializer {
|
175 276 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
176 277 | fn serialize_input(
|
177 278 | &self,
|
178 279 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
179 280 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
180 281 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
181 282 | let input = input
|
182 283 | .downcast::<crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderInput>()
|
183 284 | .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_configuration_recorder::DeleteConfigurationRecorderInput,
|
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_configuration_recorder::DeleteConfigurationRecorderInput,
|
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.DeleteConfigurationRecorder",
|
213 - | );
|
214 - | builder
|
215 - | };
|
216 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
217 - | crate::protocol_serde::shape_delete_configuration_recorder::ser_delete_configuration_recorder_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())
|
285 + | let protocol = _cfg
|
286 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
287 + | .expect("a SharedClientProtocol is required");
|
288 + | let mut request = protocol
|
289 + | .serialize_request(&input, DeleteConfigurationRecorder::INPUT_SCHEMA, "", _cfg)
|
290 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
291 + |
|
292 + | return ::std::result::Result::Ok(request);
|
224 293 | }
|
225 294 | }
|
226 295 | #[derive(Debug)]
|
227 296 | struct DeleteConfigurationRecorderEndpointParamsInterceptor;
|
228 297 |
|
229 298 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteConfigurationRecorderEndpointParamsInterceptor {
|
230 299 | fn name(&self) -> &'static str {
|
231 300 | "DeleteConfigurationRecorderEndpointParamsInterceptor"
|
232 301 | }
|
233 302 |
|