7 7 | ) -> std::result::Result<
|
8 8 | crate::operation::get_resource_config_history::GetResourceConfigHistoryOutput,
|
9 9 | crate::operation::get_resource_config_history::GetResourceConfigHistoryError,
|
10 10 | > {
|
11 11 | #[allow(unused_mut)]
|
12 12 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 13 | .map_err(crate::operation::get_resource_config_history::GetResourceConfigHistoryError::unhandled)?;
|
14 14 | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
15 15 | let generic = generic_builder.build();
|
16 16 | let error_code = match generic.code() {
|
17 17 | Some(code) => code,
|
18 18 | None => {
|
19 19 | return Err(crate::operation::get_resource_config_history::GetResourceConfigHistoryError::unhandled(
|
20 20 | generic,
|
21 21 | ))
|
22 22 | }
|
23 23 | };
|
24 24 |
|
25 25 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
26 26 | Err(match error_code {
|
27 27 | "InvalidLimitException" => crate::operation::get_resource_config_history::GetResourceConfigHistoryError::InvalidLimitException({
|
28 28 | #[allow(unused_mut)]
|
29 29 | let mut tmp = {
|
30 30 | #[allow(unused_mut)]
|
31 31 | let mut output = crate::types::error::builders::InvalidLimitExceptionBuilder::default();
|
32 32 | output = crate::protocol_serde::shape_invalid_limit_exception::de_invalid_limit_exception_json_err(_response_body, output)
|
33 33 | .map_err(crate::operation::get_resource_config_history::GetResourceConfigHistoryError::unhandled)?;
|
34 34 | let output = output.meta(generic);
|
35 35 | output.build()
|
36 36 | };
|
37 - | if tmp.message.is_none() {
|
38 - | tmp.message = _error_message;
|
39 - | }
|
40 37 | tmp
|
41 38 | }),
|
42 39 | "InvalidNextTokenException" => crate::operation::get_resource_config_history::GetResourceConfigHistoryError::InvalidNextTokenException({
|
43 40 | #[allow(unused_mut)]
|
44 41 | let mut tmp = {
|
45 42 | #[allow(unused_mut)]
|
46 43 | let mut output = crate::types::error::builders::InvalidNextTokenExceptionBuilder::default();
|
47 44 | output = crate::protocol_serde::shape_invalid_next_token_exception::de_invalid_next_token_exception_json_err(_response_body, output)
|
48 45 | .map_err(crate::operation::get_resource_config_history::GetResourceConfigHistoryError::unhandled)?;
|
49 46 | let output = output.meta(generic);
|
50 47 | output.build()
|
51 48 | };
|
52 - | if tmp.message.is_none() {
|
53 - | tmp.message = _error_message;
|
54 - | }
|
55 49 | tmp
|
56 50 | }),
|
57 51 | "InvalidTimeRangeException" => crate::operation::get_resource_config_history::GetResourceConfigHistoryError::InvalidTimeRangeException({
|
58 52 | #[allow(unused_mut)]
|
59 53 | let mut tmp = {
|
60 54 | #[allow(unused_mut)]
|
61 55 | let mut output = crate::types::error::builders::InvalidTimeRangeExceptionBuilder::default();
|
62 56 | output = crate::protocol_serde::shape_invalid_time_range_exception::de_invalid_time_range_exception_json_err(_response_body, output)
|
63 57 | .map_err(crate::operation::get_resource_config_history::GetResourceConfigHistoryError::unhandled)?;
|
64 58 | let output = output.meta(generic);
|
65 59 | output.build()
|
66 60 | };
|
67 - | if tmp.message.is_none() {
|
68 - | tmp.message = _error_message;
|
69 - | }
|
70 61 | tmp
|
71 62 | }),
|
72 63 | "NoAvailableConfigurationRecorderException" => {
|
73 64 | crate::operation::get_resource_config_history::GetResourceConfigHistoryError::NoAvailableConfigurationRecorderException({
|
74 65 | #[allow(unused_mut)]
|
75 66 | let mut tmp = {
|
76 67 | #[allow(unused_mut)]
|
77 68 | let mut output = crate::types::error::builders::NoAvailableConfigurationRecorderExceptionBuilder::default();
|
78 69 | output = crate::protocol_serde::shape_no_available_configuration_recorder_exception::de_no_available_configuration_recorder_exception_json_err(_response_body, output).map_err(crate::operation::get_resource_config_history::GetResourceConfigHistoryError::unhandled)?;
|
79 70 | let output = output.meta(generic);
|
80 71 | output.build()
|
81 72 | };
|
82 - | if tmp.message.is_none() {
|
83 - | tmp.message = _error_message;
|
84 - | }
|
85 73 | tmp
|
86 74 | })
|
87 75 | }
|
88 76 | "ResourceNotDiscoveredException" => {
|
89 77 | crate::operation::get_resource_config_history::GetResourceConfigHistoryError::ResourceNotDiscoveredException({
|
90 78 | #[allow(unused_mut)]
|
91 79 | let mut tmp = {
|
92 80 | #[allow(unused_mut)]
|
93 81 | let mut output = crate::types::error::builders::ResourceNotDiscoveredExceptionBuilder::default();
|
94 82 | output = crate::protocol_serde::shape_resource_not_discovered_exception::de_resource_not_discovered_exception_json_err(
|
95 83 | _response_body,
|
96 84 | output,
|
97 85 | )
|
98 86 | .map_err(crate::operation::get_resource_config_history::GetResourceConfigHistoryError::unhandled)?;
|
99 87 | let output = output.meta(generic);
|
100 88 | output.build()
|
101 89 | };
|
102 - | if tmp.message.is_none() {
|
103 - | tmp.message = _error_message;
|
104 - | }
|
105 90 | tmp
|
106 91 | })
|
107 92 | }
|
108 93 | "ValidationException" => crate::operation::get_resource_config_history::GetResourceConfigHistoryError::ValidationException({
|
109 94 | #[allow(unused_mut)]
|
110 95 | let mut tmp = {
|
111 96 | #[allow(unused_mut)]
|
112 97 | let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
|
113 98 | output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
|
114 99 | .map_err(crate::operation::get_resource_config_history::GetResourceConfigHistoryError::unhandled)?;
|
115 100 | let output = output.meta(generic);
|
116 101 | output.build()
|
117 102 | };
|
118 - | if tmp.message.is_none() {
|
119 - | tmp.message = _error_message;
|
120 - | }
|
121 103 | tmp
|
122 104 | }),
|
123 105 | _ => crate::operation::get_resource_config_history::GetResourceConfigHistoryError::generic(generic),
|
124 106 | })
|
125 107 | }
|
126 108 |
|
127 109 | #[allow(clippy::unnecessary_wraps)]
|
128 110 | pub fn de_get_resource_config_history_http_response(
|
129 111 | _response_status: u16,
|
130 112 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
131 113 | _response_body: &[u8],
|
132 114 | ) -> std::result::Result<
|
133 115 | crate::operation::get_resource_config_history::GetResourceConfigHistoryOutput,
|
134 116 | crate::operation::get_resource_config_history::GetResourceConfigHistoryError,
|
135 117 | > {
|
136 118 | Ok({
|
137 119 | #[allow(unused_mut)]
|
138 120 | let mut output = crate::operation::get_resource_config_history::builders::GetResourceConfigHistoryOutputBuilder::default();
|
139 121 | output = crate::protocol_serde::shape_get_resource_config_history::de_get_resource_config_history(_response_body, output)
|
140 122 | .map_err(crate::operation::get_resource_config_history::GetResourceConfigHistoryError::unhandled)?;
|
141 123 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
142 124 | output.build()
|
143 125 | })
|
144 126 | }
|
145 127 |
|
146 128 | pub fn ser_get_resource_config_history_input(
|
147 129 | input: &crate::operation::get_resource_config_history::GetResourceConfigHistoryInput,
|
148 130 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
149 131 | let mut out = String::new();
|
150 132 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|