1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_create_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::create_custom_key_store::CreateCustomKeyStoreOutput,
|
9 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError,
|
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::create_custom_key_store::CreateCustomKeyStoreError::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::create_custom_key_store::CreateCustomKeyStoreError::unhandled(generic)),
|
19 - | };
|
20 - |
|
21 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
22 - | Err(match error_code {
|
23 - | "CloudHsmClusterInUseException" => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CloudHsmClusterInUseException({
|
24 - | #[allow(unused_mut)]
|
25 - | let mut tmp = {
|
26 - | #[allow(unused_mut)]
|
27 - | let mut output = crate::types::error::builders::CloudHsmClusterInUseExceptionBuilder::default();
|
28 - | output = crate::protocol_serde::shape_cloud_hsm_cluster_in_use_exception::de_cloud_hsm_cluster_in_use_exception_json_err(
|
29 - | _response_body,
|
30 - | output,
|
31 - | )
|
32 - | .map_err(crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
33 - | let output = output.meta(generic);
|
34 - | output.build()
|
35 - | };
|
36 - | if tmp.message.is_none() {
|
37 - | tmp.message = _error_message;
|
38 - | }
|
39 - | tmp
|
40 - | }),
|
41 - | "CloudHsmClusterInvalidConfigurationException" => {
|
42 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CloudHsmClusterInvalidConfigurationException({
|
43 - | #[allow(unused_mut)]
|
44 - | let mut tmp = {
|
45 - | #[allow(unused_mut)]
|
46 - | let mut output = crate::types::error::builders::CloudHsmClusterInvalidConfigurationExceptionBuilder::default();
|
47 - | 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::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
48 - | let output = output.meta(generic);
|
49 - | output.build()
|
50 - | };
|
51 - | if tmp.message.is_none() {
|
52 - | tmp.message = _error_message;
|
53 - | }
|
54 - | tmp
|
55 - | })
|
56 - | }
|
57 - | "CloudHsmClusterNotActiveException" => {
|
58 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CloudHsmClusterNotActiveException({
|
59 - | #[allow(unused_mut)]
|
60 - | let mut tmp = {
|
61 - | #[allow(unused_mut)]
|
62 - | let mut output = crate::types::error::builders::CloudHsmClusterNotActiveExceptionBuilder::default();
|
63 - | output = crate::protocol_serde::shape_cloud_hsm_cluster_not_active_exception::de_cloud_hsm_cluster_not_active_exception_json_err(
|
64 - | _response_body,
|
65 - | output,
|
66 - | )
|
67 - | .map_err(crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
68 - | let output = output.meta(generic);
|
69 - | output.build()
|
70 - | };
|
71 - | if tmp.message.is_none() {
|
72 - | tmp.message = _error_message;
|
73 - | }
|
74 - | tmp
|
75 - | })
|
76 - | }
|
77 - | "CloudHsmClusterNotFoundException" => {
|
78 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CloudHsmClusterNotFoundException({
|
79 - | #[allow(unused_mut)]
|
80 - | let mut tmp = {
|
81 - | #[allow(unused_mut)]
|
82 - | let mut output = crate::types::error::builders::CloudHsmClusterNotFoundExceptionBuilder::default();
|
83 - | output = crate::protocol_serde::shape_cloud_hsm_cluster_not_found_exception::de_cloud_hsm_cluster_not_found_exception_json_err(
|
84 - | _response_body,
|
85 - | output,
|
86 - | )
|
87 - | .map_err(crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
88 - | let output = output.meta(generic);
|
89 - | output.build()
|
90 - | };
|
91 - | if tmp.message.is_none() {
|
92 - | tmp.message = _error_message;
|
93 - | }
|
94 - | tmp
|
95 - | })
|
96 - | }
|
97 - | "CustomKeyStoreNameInUseException" => {
|
98 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CustomKeyStoreNameInUseException({
|
99 - | #[allow(unused_mut)]
|
100 - | let mut tmp = {
|
101 - | #[allow(unused_mut)]
|
102 - | let mut output = crate::types::error::builders::CustomKeyStoreNameInUseExceptionBuilder::default();
|
103 - | output = crate::protocol_serde::shape_custom_key_store_name_in_use_exception::de_custom_key_store_name_in_use_exception_json_err(
|
104 - | _response_body,
|
105 - | output,
|
106 - | )
|
107 - | .map_err(crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
108 - | let output = output.meta(generic);
|
109 - | output.build()
|
110 - | };
|
111 - | if tmp.message.is_none() {
|
112 - | tmp.message = _error_message;
|
113 - | }
|
114 - | tmp
|
115 - | })
|
116 - | }
|
117 - | "IncorrectTrustAnchorException" => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::IncorrectTrustAnchorException({
|
118 - | #[allow(unused_mut)]
|
119 - | let mut tmp = {
|
120 - | #[allow(unused_mut)]
|
121 - | let mut output = crate::types::error::builders::IncorrectTrustAnchorExceptionBuilder::default();
|
122 - | output = crate::protocol_serde::shape_incorrect_trust_anchor_exception::de_incorrect_trust_anchor_exception_json_err(
|
123 - | _response_body,
|
124 - | output,
|
125 - | )
|
126 - | .map_err(crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
127 - | let output = output.meta(generic);
|
128 - | output.build()
|
129 - | };
|
130 - | if tmp.message.is_none() {
|
131 - | tmp.message = _error_message;
|
132 - | }
|
133 - | tmp
|
134 - | }),
|
135 - | "KMSInternalException" => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::KmsInternalException({
|
136 - | #[allow(unused_mut)]
|
137 - | let mut tmp = {
|
138 - | #[allow(unused_mut)]
|
139 - | let mut output = crate::types::error::builders::KmsInternalExceptionBuilder::default();
|
140 - | output = crate::protocol_serde::shape_kms_internal_exception::de_kms_internal_exception_json_err(_response_body, output)
|
141 - | .map_err(crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
142 - | let output = output.meta(generic);
|
143 - | output.build()
|
144 - | };
|
145 - | if tmp.message.is_none() {
|
146 - | tmp.message = _error_message;
|
147 - | }
|
148 - | tmp
|
149 - | }),
|
150 - | "LimitExceededException" => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::LimitExceededException({
|
151 - | #[allow(unused_mut)]
|
152 - | let mut tmp = {
|
153 - | #[allow(unused_mut)]
|
154 - | let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
|
155 - | output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
|
156 - | .map_err(crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
157 - | let output = output.meta(generic);
|
158 - | output.build()
|
159 - | };
|
160 - | if tmp.message.is_none() {
|
161 - | tmp.message = _error_message;
|
162 - | }
|
163 - | tmp
|
164 - | }),
|
165 - | "XksProxyIncorrectAuthenticationCredentialException" => {
|
166 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyIncorrectAuthenticationCredentialException({
|
167 - | #[allow(unused_mut)]
|
168 - | let mut tmp = {
|
169 - | #[allow(unused_mut)]
|
170 - | let mut output = crate::types::error::builders::XksProxyIncorrectAuthenticationCredentialExceptionBuilder::default();
|
171 - | 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::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
172 - | let output = output.meta(generic);
|
173 - | output.build()
|
174 - | };
|
175 - | if tmp.message.is_none() {
|
176 - | tmp.message = _error_message;
|
177 - | }
|
178 - | tmp
|
179 - | })
|
180 - | }
|
181 - | "XksProxyInvalidConfigurationException" => {
|
182 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyInvalidConfigurationException({
|
183 - | #[allow(unused_mut)]
|
184 - | let mut tmp = {
|
185 - | #[allow(unused_mut)]
|
186 - | let mut output = crate::types::error::builders::XksProxyInvalidConfigurationExceptionBuilder::default();
|
187 - | 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::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
188 - | let output = output.meta(generic);
|
189 - | output.build()
|
190 - | };
|
191 - | if tmp.message.is_none() {
|
192 - | tmp.message = _error_message;
|
193 - | }
|
194 - | tmp
|
195 - | })
|
196 - | }
|
197 - | "XksProxyInvalidResponseException" => {
|
198 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyInvalidResponseException({
|
199 - | #[allow(unused_mut)]
|
200 - | let mut tmp = {
|
201 - | #[allow(unused_mut)]
|
202 - | let mut output = crate::types::error::builders::XksProxyInvalidResponseExceptionBuilder::default();
|
203 - | output = crate::protocol_serde::shape_xks_proxy_invalid_response_exception::de_xks_proxy_invalid_response_exception_json_err(
|
204 - | _response_body,
|
205 - | output,
|
206 - | )
|
207 - | .map_err(crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
208 - | let output = output.meta(generic);
|
209 - | output.build()
|
210 - | };
|
211 - | if tmp.message.is_none() {
|
212 - | tmp.message = _error_message;
|
213 - | }
|
214 - | tmp
|
215 - | })
|
216 - | }
|
217 - | "XksProxyUriEndpointInUseException" => {
|
218 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyUriEndpointInUseException({
|
219 - | #[allow(unused_mut)]
|
220 - | let mut tmp = {
|
221 - | #[allow(unused_mut)]
|
222 - | let mut output = crate::types::error::builders::XksProxyUriEndpointInUseExceptionBuilder::default();
|
223 - | output =
|
224 - | crate::protocol_serde::shape_xks_proxy_uri_endpoint_in_use_exception::de_xks_proxy_uri_endpoint_in_use_exception_json_err(
|
225 - | _response_body,
|
226 - | output,
|
227 - | )
|
228 - | .map_err(crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
229 - | let output = output.meta(generic);
|
230 - | output.build()
|
231 - | };
|
232 - | if tmp.message.is_none() {
|
233 - | tmp.message = _error_message;
|
234 - | }
|
235 - | tmp
|
236 - | })
|
237 - | }
|
238 - | "XksProxyUriInUseException" => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyUriInUseException({
|
239 - | #[allow(unused_mut)]
|
240 - | let mut tmp = {
|
241 - | #[allow(unused_mut)]
|
242 - | let mut output = crate::types::error::builders::XksProxyUriInUseExceptionBuilder::default();
|
243 - | output =
|
244 - | crate::protocol_serde::shape_xks_proxy_uri_in_use_exception::de_xks_proxy_uri_in_use_exception_json_err(_response_body, output)
|
245 - | .map_err(crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
246 - | let output = output.meta(generic);
|
247 - | output.build()
|
248 - | };
|
249 - | if tmp.message.is_none() {
|
250 - | tmp.message = _error_message;
|
251 - | }
|
252 - | tmp
|
253 - | }),
|
254 - | "XksProxyUriUnreachableException" => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyUriUnreachableException({
|
255 - | #[allow(unused_mut)]
|
256 - | let mut tmp = {
|
257 - | #[allow(unused_mut)]
|
258 - | let mut output = crate::types::error::builders::XksProxyUriUnreachableExceptionBuilder::default();
|
259 - | output = crate::protocol_serde::shape_xks_proxy_uri_unreachable_exception::de_xks_proxy_uri_unreachable_exception_json_err(
|
260 - | _response_body,
|
261 - | output,
|
262 - | )
|
263 - | .map_err(crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
264 - | let output = output.meta(generic);
|
265 - | output.build()
|
266 - | };
|
267 - | if tmp.message.is_none() {
|
268 - | tmp.message = _error_message;
|
269 - | }
|
270 - | tmp
|
271 - | }),
|
272 - | "XksProxyVpcEndpointServiceInUseException" => {
|
273 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyVpcEndpointServiceInUseException({
|
274 - | #[allow(unused_mut)]
|
275 - | let mut tmp = {
|
276 - | #[allow(unused_mut)]
|
277 - | let mut output = crate::types::error::builders::XksProxyVpcEndpointServiceInUseExceptionBuilder::default();
|
278 - | 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::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
279 - | let output = output.meta(generic);
|
280 - | output.build()
|
281 - | };
|
282 - | if tmp.message.is_none() {
|
283 - | tmp.message = _error_message;
|
284 - | }
|
285 - | tmp
|
286 - | })
|
287 - | }
|
288 - | "XksProxyVpcEndpointServiceInvalidConfigurationException" => {
|
289 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyVpcEndpointServiceInvalidConfigurationException({
|
290 - | #[allow(unused_mut)]
|
291 - | let mut tmp = {
|
292 - | #[allow(unused_mut)]
|
293 - | let mut output = crate::types::error::builders::XksProxyVpcEndpointServiceInvalidConfigurationExceptionBuilder::default();
|
294 - | 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::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
295 - | let output = output.meta(generic);
|
296 - | output.build()
|
297 - | };
|
298 - | if tmp.message.is_none() {
|
299 - | tmp.message = _error_message;
|
300 - | }
|
301 - | tmp
|
302 - | })
|
303 - | }
|
304 - | "XksProxyVpcEndpointServiceNotFoundException" => {
|
305 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyVpcEndpointServiceNotFoundException({
|
306 - | #[allow(unused_mut)]
|
307 - | let mut tmp = {
|
308 - | #[allow(unused_mut)]
|
309 - | let mut output = crate::types::error::builders::XksProxyVpcEndpointServiceNotFoundExceptionBuilder::default();
|
310 - | 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::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
311 - | let output = output.meta(generic);
|
312 - | output.build()
|
313 - | };
|
314 - | if tmp.message.is_none() {
|
315 - | tmp.message = _error_message;
|
316 - | }
|
317 - | tmp
|
318 - | })
|
319 - | }
|
320 - | _ => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::generic(generic),
|
321 - | })
|
322 - | }
|
323 - |
|
324 - | #[allow(clippy::unnecessary_wraps)]
|
325 - | pub fn de_create_custom_key_store_http_response(
|
326 - | _response_status: u16,
|
327 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
328 - | _response_body: &[u8],
|
329 - | ) -> std::result::Result<
|
330 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreOutput,
|
331 - | crate::operation::create_custom_key_store::CreateCustomKeyStoreError,
|
332 - | > {
|
333 - | Ok({
|
334 - | #[allow(unused_mut)]
|
335 - | let mut output = crate::operation::create_custom_key_store::builders::CreateCustomKeyStoreOutputBuilder::default();
|
336 - | output = crate::protocol_serde::shape_create_custom_key_store::de_create_custom_key_store(_response_body, output)
|
337 - | .map_err(crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled)?;
|
338 - | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
339 - | output.build()
|
340 - | })
|
341 - | }
|
342 - |
|
343 - | pub fn ser_create_custom_key_store_input(
|
344 - | input: &crate::operation::create_custom_key_store::CreateCustomKeyStoreInput,
|
345 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
346 - | let mut out = String::new();
|
347 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
348 - | crate::protocol_serde::shape_create_custom_key_store_input::ser_create_custom_key_store_input_input(&mut object, input)?;
|
349 - | object.finish();
|
350 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
351 - | }
|
352 - |
|
353 - | pub(crate) fn de_create_custom_key_store(
|
354 - | _value: &[u8],
|
355 - | mut builder: crate::operation::create_custom_key_store::builders::CreateCustomKeyStoreOutputBuilder,
|
356 - | ) -> ::std::result::Result<
|
357 - | crate::operation::create_custom_key_store::builders::CreateCustomKeyStoreOutputBuilder,
|
358 - | ::aws_smithy_json::deserialize::error::DeserializeError,
|
359 - | > {
|
360 - | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
|
361 - | let tokens = &mut tokens_owned;
|
362 - | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
363 - | loop {
|
364 - | match tokens.next().transpose()? {
|
365 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
366 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
367 - | "CustomKeyStoreId" => {
|
368 - | builder = builder.set_custom_key_store_id(
|
369 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
370 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
371 - | .transpose()?,
|
372 - | );
|
373 - | }
|
374 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
375 - | },
|
376 - | other => {
|
377 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
378 - | "expected object key or end object, found: {other:?}"
|
379 - | )))
|
380 - | }
|
381 - | }
|
382 - | }
|
383 - | if tokens.next().is_some() {
|
384 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
385 - | "found more JSON tokens after completing parsing",
|
386 - | ));
|
387 - | }
|
388 - | Ok(builder)
|
389 - | }
|