1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_delete_configuration_recorder_http_error(
|
4 - | _response_status: u16,
|
5 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 - | _response_body: &[u8],
|
7 - | ) -> std::result::Result<
|
8 - | crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderOutput,
|
9 - | crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError,
|
10 - | > {
|
11 - | #[allow(unused_mut)]
|
12 - | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 - | .map_err(crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError::unhandled)?;
|
14 - | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
15 - | let generic = generic_builder.build();
|
16 - | let error_code = match generic.code() {
|
17 - | Some(code) => code,
|
18 - | None => return Err(crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError::unhandled(generic)),
|
19 - | };
|
20 - |
|
21 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
22 - | Err(match error_code {
|
23 - | "NoSuchConfigurationRecorderException" => {
|
24 - | crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError::NoSuchConfigurationRecorderException({
|
25 - | #[allow(unused_mut)]
|
26 - | let mut tmp = {
|
27 - | #[allow(unused_mut)]
|
28 - | let mut output = crate::types::error::builders::NoSuchConfigurationRecorderExceptionBuilder::default();
|
29 - | output =
|
30 - | crate::protocol_serde::shape_no_such_configuration_recorder_exception::de_no_such_configuration_recorder_exception_json_err(
|
31 - | _response_body,
|
32 - | output,
|
33 - | )
|
34 - | .map_err(crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError::unhandled)?;
|
35 - | let output = output.meta(generic);
|
36 - | output.build()
|
37 - | };
|
38 - | if tmp.message.is_none() {
|
39 - | tmp.message = _error_message;
|
40 - | }
|
41 - | tmp
|
42 - | })
|
43 - | }
|
44 - | "UnmodifiableEntityException" => {
|
45 - | crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError::UnmodifiableEntityException({
|
46 - | #[allow(unused_mut)]
|
47 - | let mut tmp = {
|
48 - | #[allow(unused_mut)]
|
49 - | let mut output = crate::types::error::builders::UnmodifiableEntityExceptionBuilder::default();
|
50 - | output =
|
51 - | crate::protocol_serde::shape_unmodifiable_entity_exception::de_unmodifiable_entity_exception_json_err(_response_body, output)
|
52 - | .map_err(crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError::unhandled)?;
|
53 - | let output = output.meta(generic);
|
54 - | output.build()
|
55 - | };
|
56 - | if tmp.message.is_none() {
|
57 - | tmp.message = _error_message;
|
58 - | }
|
59 - | tmp
|
60 - | })
|
61 - | }
|
62 - | _ => crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError::generic(generic),
|
63 - | })
|
64 - | }
|
65 - |
|
66 - | #[allow(clippy::unnecessary_wraps)]
|
67 - | pub fn de_delete_configuration_recorder_http_response(
|
68 - | _response_status: u16,
|
69 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
70 - | _response_body: &[u8],
|
71 - | ) -> std::result::Result<
|
72 - | crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderOutput,
|
73 - | crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderError,
|
74 - | > {
|
75 - | Ok({
|
76 - | #[allow(unused_mut)]
|
77 - | let mut output = crate::operation::delete_configuration_recorder::builders::DeleteConfigurationRecorderOutputBuilder::default();
|
78 - | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
79 - | output.build()
|
80 - | })
|
81 - | }
|
82 - |
|
83 - | pub fn ser_delete_configuration_recorder_input(
|
84 - | input: &crate::operation::delete_configuration_recorder::DeleteConfigurationRecorderInput,
|
85 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
86 - | let mut out = String::new();
|
87 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
88 - | crate::protocol_serde::shape_delete_configuration_recorder_input::ser_delete_configuration_recorder_input_input(&mut object, input)?;
|
89 - | object.finish();
|
90 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
91 - | }
|