147 153 | ::std::borrow::Cow::Owned(rcb)
|
148 154 | }
|
149 155 | }
|
150 156 |
|
151 157 | #[derive(Debug)]
|
152 158 | struct GetResourceConfigHistoryResponseDeserializer;
|
153 159 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetResourceConfigHistoryResponseDeserializer {
|
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_get_resource_config_history::de_get_resource_config_history_http_error(status, headers, body)
|
166 - | } else {
|
167 - | crate::protocol_serde::shape_get_resource_config_history::de_get_resource_config_history_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::get_resource_config_history::GetResourceConfigHistoryError::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 + | "InvalidLimitException" => crate::operation::get_resource_config_history::GetResourceConfigHistoryError::InvalidLimitException({
|
194 + | let mut tmp = match protocol
|
195 + | .deserialize_response(response, crate::types::error::InvalidLimitException::SCHEMA, _cfg)
|
196 + | .and_then(|mut deser| {
|
197 + | crate::types::error::InvalidLimitException::deserialize_with_response(
|
198 + | &mut *deser,
|
199 + | response.headers(),
|
200 + | response.status().into(),
|
201 + | body,
|
202 + | )
|
203 + | }) {
|
204 + | ::std::result::Result::Ok(val) => val,
|
205 + | ::std::result::Result::Err(e) => {
|
206 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
207 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
208 + | ))
|
209 + | }
|
210 + | };
|
211 + | tmp.meta = generic;
|
212 + | if tmp.message.is_none() {
|
213 + | tmp.message = _error_message;
|
214 + | }
|
215 + | tmp
|
216 + | }),
|
217 + | "InvalidNextTokenException" => {
|
218 + | crate::operation::get_resource_config_history::GetResourceConfigHistoryError::InvalidNextTokenException({
|
219 + | let mut tmp = match protocol
|
220 + | .deserialize_response(response, crate::types::error::InvalidNextTokenException::SCHEMA, _cfg)
|
221 + | .and_then(|mut deser| {
|
222 + | crate::types::error::InvalidNextTokenException::deserialize_with_response(
|
223 + | &mut *deser,
|
224 + | response.headers(),
|
225 + | response.status().into(),
|
226 + | body,
|
227 + | )
|
228 + | }) {
|
229 + | ::std::result::Result::Ok(val) => val,
|
230 + | ::std::result::Result::Err(e) => {
|
231 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
232 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
233 + | ))
|
234 + | }
|
235 + | };
|
236 + | tmp.meta = generic;
|
237 + | if tmp.message.is_none() {
|
238 + | tmp.message = _error_message;
|
239 + | }
|
240 + | tmp
|
241 + | })
|
242 + | }
|
243 + | "InvalidTimeRangeException" => {
|
244 + | crate::operation::get_resource_config_history::GetResourceConfigHistoryError::InvalidTimeRangeException({
|
245 + | let mut tmp = match protocol
|
246 + | .deserialize_response(response, crate::types::error::InvalidTimeRangeException::SCHEMA, _cfg)
|
247 + | .and_then(|mut deser| {
|
248 + | crate::types::error::InvalidTimeRangeException::deserialize_with_response(
|
249 + | &mut *deser,
|
250 + | response.headers(),
|
251 + | response.status().into(),
|
252 + | body,
|
253 + | )
|
254 + | }) {
|
255 + | ::std::result::Result::Ok(val) => val,
|
256 + | ::std::result::Result::Err(e) => {
|
257 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
258 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
259 + | ))
|
260 + | }
|
261 + | };
|
262 + | tmp.meta = generic;
|
263 + | if tmp.message.is_none() {
|
264 + | tmp.message = _error_message;
|
265 + | }
|
266 + | tmp
|
267 + | })
|
268 + | }
|
269 + | "NoAvailableConfigurationRecorderException" => {
|
270 + | crate::operation::get_resource_config_history::GetResourceConfigHistoryError::NoAvailableConfigurationRecorderException({
|
271 + | let mut tmp = match protocol
|
272 + | .deserialize_response(response, crate::types::error::NoAvailableConfigurationRecorderException::SCHEMA, _cfg)
|
273 + | .and_then(|mut deser| {
|
274 + | crate::types::error::NoAvailableConfigurationRecorderException::deserialize_with_response(
|
275 + | &mut *deser,
|
276 + | response.headers(),
|
277 + | response.status().into(),
|
278 + | body,
|
279 + | )
|
280 + | }) {
|
281 + | ::std::result::Result::Ok(val) => val,
|
282 + | ::std::result::Result::Err(e) => {
|
283 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
284 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
285 + | ))
|
286 + | }
|
168 287 | };
|
169 - | crate::protocol_serde::type_erase_result(parse_result)
|
288 + | tmp.meta = generic;
|
289 + | if tmp.message.is_none() {
|
290 + | tmp.message = _error_message;
|
291 + | }
|
292 + | tmp
|
293 + | })
|
294 + | }
|
295 + | "ResourceNotDiscoveredException" => {
|
296 + | crate::operation::get_resource_config_history::GetResourceConfigHistoryError::ResourceNotDiscoveredException({
|
297 + | let mut tmp = match protocol
|
298 + | .deserialize_response(response, crate::types::error::ResourceNotDiscoveredException::SCHEMA, _cfg)
|
299 + | .and_then(|mut deser| {
|
300 + | crate::types::error::ResourceNotDiscoveredException::deserialize_with_response(
|
301 + | &mut *deser,
|
302 + | response.headers(),
|
303 + | response.status().into(),
|
304 + | body,
|
305 + | )
|
306 + | }) {
|
307 + | ::std::result::Result::Ok(val) => val,
|
308 + | ::std::result::Result::Err(e) => {
|
309 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
310 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
311 + | ))
|
312 + | }
|
313 + | };
|
314 + | tmp.meta = generic;
|
315 + | if tmp.message.is_none() {
|
316 + | tmp.message = _error_message;
|
317 + | }
|
318 + | tmp
|
319 + | })
|
320 + | }
|
321 + | "ValidationException" => crate::operation::get_resource_config_history::GetResourceConfigHistoryError::ValidationException({
|
322 + | let mut tmp = match protocol
|
323 + | .deserialize_response(response, crate::types::error::ValidationException::SCHEMA, _cfg)
|
324 + | .and_then(|mut deser| {
|
325 + | crate::types::error::ValidationException::deserialize_with_response(
|
326 + | &mut *deser,
|
327 + | response.headers(),
|
328 + | response.status().into(),
|
329 + | body,
|
330 + | )
|
331 + | }) {
|
332 + | ::std::result::Result::Ok(val) => val,
|
333 + | ::std::result::Result::Err(e) => {
|
334 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
335 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
336 + | ))
|
337 + | }
|
338 + | };
|
339 + | tmp.meta = generic;
|
340 + | if tmp.message.is_none() {
|
341 + | tmp.message = _error_message;
|
342 + | }
|
343 + | tmp
|
344 + | }),
|
345 + | _ => crate::operation::get_resource_config_history::GetResourceConfigHistoryError::generic(generic),
|
346 + | };
|
347 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
348 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
349 + | ))
|
350 + | } else {
|
351 + | let protocol = _cfg
|
352 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
353 + | .expect("a SharedClientProtocol is required");
|
354 + | let mut deser = protocol
|
355 + | .deserialize_response(response, GetResourceConfigHistory::OUTPUT_SCHEMA, _cfg)
|
356 + | .map_err(|e| {
|
357 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
358 + | })?;
|
359 + | let body = response.body().bytes().expect("body loaded");
|
360 + | let output = crate::operation::get_resource_config_history::GetResourceConfigHistoryOutput::deserialize_with_response(
|
361 + | &mut *deser,
|
362 + | response.headers(),
|
363 + | response.status().into(),
|
364 + | body,
|
365 + | )
|
366 + | .map_err(|e| {
|
367 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
368 + | })?;
|
369 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
370 + | }
|
170 371 | }
|
171 372 | }
|
172 373 | #[derive(Debug)]
|
173 374 | struct GetResourceConfigHistoryRequestSerializer;
|
174 375 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetResourceConfigHistoryRequestSerializer {
|
175 376 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
176 377 | fn serialize_input(
|
177 378 | &self,
|
178 379 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
179 380 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
180 381 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
181 382 | let input = input
|
182 383 | .downcast::<crate::operation::get_resource_config_history::GetResourceConfigHistoryInput>()
|
183 384 | .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::get_resource_config_history::GetResourceConfigHistoryInput,
|
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::get_resource_config_history::GetResourceConfigHistoryInput,
|
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.GetResourceConfigHistory",
|
213 - | );
|
214 - | builder
|
215 - | };
|
216 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
217 - | crate::protocol_serde::shape_get_resource_config_history::ser_get_resource_config_history_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())
|
385 + | let protocol = _cfg
|
386 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
387 + | .expect("a SharedClientProtocol is required");
|
388 + | let mut request = protocol
|
389 + | .serialize_request(&input, GetResourceConfigHistory::INPUT_SCHEMA, "", _cfg)
|
390 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
391 + |
|
392 + | return ::std::result::Result::Ok(request);
|
224 393 | }
|
225 394 | }
|
226 395 | #[derive(Debug)]
|
227 396 | struct GetResourceConfigHistoryEndpointParamsInterceptor;
|
228 397 |
|
229 398 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetResourceConfigHistoryEndpointParamsInterceptor {
|
230 399 | fn name(&self) -> &'static str {
|
231 400 | "GetResourceConfigHistoryEndpointParamsInterceptor"
|
232 401 | }
|
233 402 |
|