aws_sdk_kms/protocol_serde/
shape_update_custom_key_store.rs
1#[allow(clippy::unnecessary_wraps)]
3pub fn de_update_custom_key_store_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::update_custom_key_store::UpdateCustomKeyStoreOutput,
9 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError,
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::update_custom_key_store::UpdateCustomKeyStoreError::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::update_custom_key_store::UpdateCustomKeyStoreError::unhandled(generic)),
19 };
20
21 let _error_message = generic.message().map(|msg| msg.to_owned());
22 Err(match error_code {
23 "CloudHsmClusterInvalidConfigurationException" => {
24 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CloudHsmClusterInvalidConfigurationException({
25 #[allow(unused_mut)]
26 let mut tmp = {
27 #[allow(unused_mut)]
28 let mut output = crate::types::error::builders::CloudHsmClusterInvalidConfigurationExceptionBuilder::default();
29 output = crate::protocol_serde::shape_cloud_hsm_cluster_invalid_configuration_exception::de_cloud_hsm_cluster_invalid_configuration_exception_json_err(_response_body, output).map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
30 let output = output.meta(generic);
31 output.build()
32 };
33 if tmp.message.is_none() {
34 tmp.message = _error_message;
35 }
36 tmp
37 })
38 }
39 "CloudHsmClusterNotActiveException" => {
40 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CloudHsmClusterNotActiveException({
41 #[allow(unused_mut)]
42 let mut tmp = {
43 #[allow(unused_mut)]
44 let mut output = crate::types::error::builders::CloudHsmClusterNotActiveExceptionBuilder::default();
45 output = crate::protocol_serde::shape_cloud_hsm_cluster_not_active_exception::de_cloud_hsm_cluster_not_active_exception_json_err(
46 _response_body,
47 output,
48 )
49 .map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
50 let output = output.meta(generic);
51 output.build()
52 };
53 if tmp.message.is_none() {
54 tmp.message = _error_message;
55 }
56 tmp
57 })
58 }
59 "CloudHsmClusterNotFoundException" => {
60 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CloudHsmClusterNotFoundException({
61 #[allow(unused_mut)]
62 let mut tmp = {
63 #[allow(unused_mut)]
64 let mut output = crate::types::error::builders::CloudHsmClusterNotFoundExceptionBuilder::default();
65 output = crate::protocol_serde::shape_cloud_hsm_cluster_not_found_exception::de_cloud_hsm_cluster_not_found_exception_json_err(
66 _response_body,
67 output,
68 )
69 .map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
70 let output = output.meta(generic);
71 output.build()
72 };
73 if tmp.message.is_none() {
74 tmp.message = _error_message;
75 }
76 tmp
77 })
78 }
79 "CloudHsmClusterNotRelatedException" => {
80 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CloudHsmClusterNotRelatedException({
81 #[allow(unused_mut)]
82 let mut tmp = {
83 #[allow(unused_mut)]
84 let mut output = crate::types::error::builders::CloudHsmClusterNotRelatedExceptionBuilder::default();
85 output =
86 crate::protocol_serde::shape_cloud_hsm_cluster_not_related_exception::de_cloud_hsm_cluster_not_related_exception_json_err(
87 _response_body,
88 output,
89 )
90 .map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
91 let output = output.meta(generic);
92 output.build()
93 };
94 if tmp.message.is_none() {
95 tmp.message = _error_message;
96 }
97 tmp
98 })
99 }
100 "CustomKeyStoreInvalidStateException" => {
101 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CustomKeyStoreInvalidStateException({
102 #[allow(unused_mut)]
103 let mut tmp = {
104 #[allow(unused_mut)]
105 let mut output = crate::types::error::builders::CustomKeyStoreInvalidStateExceptionBuilder::default();
106 output =
107 crate::protocol_serde::shape_custom_key_store_invalid_state_exception::de_custom_key_store_invalid_state_exception_json_err(
108 _response_body,
109 output,
110 )
111 .map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
112 let output = output.meta(generic);
113 output.build()
114 };
115 if tmp.message.is_none() {
116 tmp.message = _error_message;
117 }
118 tmp
119 })
120 }
121 "CustomKeyStoreNameInUseException" => {
122 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CustomKeyStoreNameInUseException({
123 #[allow(unused_mut)]
124 let mut tmp = {
125 #[allow(unused_mut)]
126 let mut output = crate::types::error::builders::CustomKeyStoreNameInUseExceptionBuilder::default();
127 output = crate::protocol_serde::shape_custom_key_store_name_in_use_exception::de_custom_key_store_name_in_use_exception_json_err(
128 _response_body,
129 output,
130 )
131 .map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
132 let output = output.meta(generic);
133 output.build()
134 };
135 if tmp.message.is_none() {
136 tmp.message = _error_message;
137 }
138 tmp
139 })
140 }
141 "CustomKeyStoreNotFoundException" => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CustomKeyStoreNotFoundException({
142 #[allow(unused_mut)]
143 let mut tmp = {
144 #[allow(unused_mut)]
145 let mut output = crate::types::error::builders::CustomKeyStoreNotFoundExceptionBuilder::default();
146 output = crate::protocol_serde::shape_custom_key_store_not_found_exception::de_custom_key_store_not_found_exception_json_err(
147 _response_body,
148 output,
149 )
150 .map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
151 let output = output.meta(generic);
152 output.build()
153 };
154 if tmp.message.is_none() {
155 tmp.message = _error_message;
156 }
157 tmp
158 }),
159 "KMSInternalException" => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::KmsInternalException({
160 #[allow(unused_mut)]
161 let mut tmp = {
162 #[allow(unused_mut)]
163 let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
164 output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
165 .map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
166 let output = output.meta(generic);
167 output.build()
168 };
169 if tmp.message.is_none() {
170 tmp.message = _error_message;
171 }
172 tmp
173 }),
174 "XksProxyIncorrectAuthenticationCredentialException" => {
175 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyIncorrectAuthenticationCredentialException({
176 #[allow(unused_mut)]
177 let mut tmp = {
178 #[allow(unused_mut)]
179 let mut output = crate::types::error::builders::XksProxyIncorrectAuthenticationCredentialExceptionBuilder::default();
180 output = crate::protocol_serde::shape_xks_proxy_incorrect_authentication_credential_exception::de_xks_proxy_incorrect_authentication_credential_exception_json_err(_response_body, output).map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
181 let output = output.meta(generic);
182 output.build()
183 };
184 if tmp.message.is_none() {
185 tmp.message = _error_message;
186 }
187 tmp
188 })
189 }
190 "XksProxyInvalidConfigurationException" => {
191 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyInvalidConfigurationException({
192 #[allow(unused_mut)]
193 let mut tmp = {
194 #[allow(unused_mut)]
195 let mut output = crate::types::error::builders::XksProxyInvalidConfigurationExceptionBuilder::default();
196 output = crate::protocol_serde::shape_xks_proxy_invalid_configuration_exception::de_xks_proxy_invalid_configuration_exception_json_err(_response_body, output).map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
197 let output = output.meta(generic);
198 output.build()
199 };
200 if tmp.message.is_none() {
201 tmp.message = _error_message;
202 }
203 tmp
204 })
205 }
206 "XksProxyInvalidResponseException" => {
207 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyInvalidResponseException({
208 #[allow(unused_mut)]
209 let mut tmp = {
210 #[allow(unused_mut)]
211 let mut output = crate::types::error::builders::XksProxyInvalidResponseExceptionBuilder::default();
212 output = crate::protocol_serde::shape_xks_proxy_invalid_response_exception::de_xks_proxy_invalid_response_exception_json_err(
213 _response_body,
214 output,
215 )
216 .map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
217 let output = output.meta(generic);
218 output.build()
219 };
220 if tmp.message.is_none() {
221 tmp.message = _error_message;
222 }
223 tmp
224 })
225 }
226 "XksProxyUriEndpointInUseException" => {
227 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyUriEndpointInUseException({
228 #[allow(unused_mut)]
229 let mut tmp = {
230 #[allow(unused_mut)]
231 let mut output = crate::types::error::builders::XksProxyUriEndpointInUseExceptionBuilder::default();
232 output =
233 crate::protocol_serde::shape_xks_proxy_uri_endpoint_in_use_exception::de_xks_proxy_uri_endpoint_in_use_exception_json_err(
234 _response_body,
235 output,
236 )
237 .map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
238 let output = output.meta(generic);
239 output.build()
240 };
241 if tmp.message.is_none() {
242 tmp.message = _error_message;
243 }
244 tmp
245 })
246 }
247 "XksProxyUriInUseException" => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyUriInUseException({
248 #[allow(unused_mut)]
249 let mut tmp = {
250 #[allow(unused_mut)]
251 let mut output = crate::types::error::builders::XksProxyUriInUseExceptionBuilder::default();
252 output =
253 crate::protocol_serde::shape_xks_proxy_uri_in_use_exception::de_xks_proxy_uri_in_use_exception_json_err(_response_body, output)
254 .map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
255 let output = output.meta(generic);
256 output.build()
257 };
258 if tmp.message.is_none() {
259 tmp.message = _error_message;
260 }
261 tmp
262 }),
263 "XksProxyUriUnreachableException" => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyUriUnreachableException({
264 #[allow(unused_mut)]
265 let mut tmp = {
266 #[allow(unused_mut)]
267 let mut output = crate::types::error::builders::XksProxyUriUnreachableExceptionBuilder::default();
268 output = crate::protocol_serde::shape_xks_proxy_uri_unreachable_exception::de_xks_proxy_uri_unreachable_exception_json_err(
269 _response_body,
270 output,
271 )
272 .map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
273 let output = output.meta(generic);
274 output.build()
275 };
276 if tmp.message.is_none() {
277 tmp.message = _error_message;
278 }
279 tmp
280 }),
281 "XksProxyVpcEndpointServiceInUseException" => {
282 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyVpcEndpointServiceInUseException({
283 #[allow(unused_mut)]
284 let mut tmp = {
285 #[allow(unused_mut)]
286 let mut output = crate::types::error::builders::XksProxyVpcEndpointServiceInUseExceptionBuilder::default();
287 output = crate::protocol_serde::shape_xks_proxy_vpc_endpoint_service_in_use_exception::de_xks_proxy_vpc_endpoint_service_in_use_exception_json_err(_response_body, output).map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
288 let output = output.meta(generic);
289 output.build()
290 };
291 if tmp.message.is_none() {
292 tmp.message = _error_message;
293 }
294 tmp
295 })
296 }
297 "XksProxyVpcEndpointServiceInvalidConfigurationException" => {
298 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyVpcEndpointServiceInvalidConfigurationException({
299 #[allow(unused_mut)]
300 let mut tmp = {
301 #[allow(unused_mut)]
302 let mut output = crate::types::error::builders::XksProxyVpcEndpointServiceInvalidConfigurationExceptionBuilder::default();
303 output = crate::protocol_serde::shape_xks_proxy_vpc_endpoint_service_invalid_configuration_exception::de_xks_proxy_vpc_endpoint_service_invalid_configuration_exception_json_err(_response_body, output).map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
304 let output = output.meta(generic);
305 output.build()
306 };
307 if tmp.message.is_none() {
308 tmp.message = _error_message;
309 }
310 tmp
311 })
312 }
313 "XksProxyVpcEndpointServiceNotFoundException" => {
314 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyVpcEndpointServiceNotFoundException({
315 #[allow(unused_mut)]
316 let mut tmp = {
317 #[allow(unused_mut)]
318 let mut output = crate::types::error::builders::XksProxyVpcEndpointServiceNotFoundExceptionBuilder::default();
319 output = crate::protocol_serde::shape_xks_proxy_vpc_endpoint_service_not_found_exception::de_xks_proxy_vpc_endpoint_service_not_found_exception_json_err(_response_body, output).map_err(crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::unhandled)?;
320 let output = output.meta(generic);
321 output.build()
322 };
323 if tmp.message.is_none() {
324 tmp.message = _error_message;
325 }
326 tmp
327 })
328 }
329 _ => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::generic(generic),
330 })
331}
332
333#[allow(clippy::unnecessary_wraps)]
334pub fn de_update_custom_key_store_http_response(
335 _response_status: u16,
336 _response_headers: &::aws_smithy_runtime_api::http::Headers,
337 _response_body: &[u8],
338) -> std::result::Result<
339 crate::operation::update_custom_key_store::UpdateCustomKeyStoreOutput,
340 crate::operation::update_custom_key_store::UpdateCustomKeyStoreError,
341> {
342 Ok({
343 #[allow(unused_mut)]
344 let mut output = crate::operation::update_custom_key_store::builders::UpdateCustomKeyStoreOutputBuilder::default();
345 output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
346 output.build()
347 })
348}
349
350pub fn ser_update_custom_key_store_input(
351 input: &crate::operation::update_custom_key_store::UpdateCustomKeyStoreInput,
352) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
353 let mut out = String::new();
354 let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
355 crate::protocol_serde::shape_update_custom_key_store_input::ser_update_custom_key_store_input_input(&mut object, input)?;
356 object.finish();
357 Ok(::aws_smithy_types::body::SdkBody::from(out))
358}