34 34 | },
|
35 35 | )?,
|
36 36 | );
|
37 37 | output = output.set_status_code(Some(_response_status as _));
|
38 38 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
39 39 | output
|
40 40 | .build()
|
41 41 | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?
|
42 42 | })
|
43 43 | }
|
44 - |
|
45 - | #[allow(clippy::unnecessary_wraps)]
|
46 - | pub fn de_invoke_with_response_stream_http_error(
|
47 - | _response_status: u16,
|
48 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
49 - | _response_body: &[u8],
|
50 - | ) -> std::result::Result<
|
51 - | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamOutput,
|
52 - | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError,
|
53 - | > {
|
54 - | #[allow(unused_mut)]
|
55 - | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
56 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
57 - | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
58 - | let generic = generic_builder.build();
|
59 - | let error_code = match generic.code() {
|
60 - | Some(code) => code,
|
61 - | None => {
|
62 - | return Err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled(
|
63 - | generic,
|
64 - | ))
|
65 - | }
|
66 - | };
|
67 - |
|
68 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
69 - | Err(match error_code {
|
70 - | "EC2AccessDeniedException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::Ec2AccessDeniedException({
|
71 - | #[allow(unused_mut)]
|
72 - | let mut tmp = {
|
73 - | #[allow(unused_mut)]
|
74 - | let mut output = crate::types::error::builders::Ec2AccessDeniedExceptionBuilder::default();
|
75 - | output = crate::protocol_serde::shape_ec2_access_denied_exception::de_ec2_access_denied_exception_json_err(_response_body, output)
|
76 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
77 - | let output = output.meta(generic);
|
78 - | output.build()
|
79 - | };
|
80 - | if tmp.message.is_none() {
|
81 - | tmp.message = _error_message;
|
82 - | }
|
83 - | tmp
|
84 - | }),
|
85 - | "EC2ThrottledException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::Ec2ThrottledException({
|
86 - | #[allow(unused_mut)]
|
87 - | let mut tmp = {
|
88 - | #[allow(unused_mut)]
|
89 - | let mut output = crate::types::error::builders::Ec2ThrottledExceptionBuilder::default();
|
90 - | output = crate::protocol_serde::shape_ec2_throttled_exception::de_ec2_throttled_exception_json_err(_response_body, output)
|
91 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
92 - | let output = output.meta(generic);
|
93 - | output.build()
|
94 - | };
|
95 - | if tmp.message.is_none() {
|
96 - | tmp.message = _error_message;
|
97 - | }
|
98 - | tmp
|
99 - | }),
|
100 - | "EC2UnexpectedException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::Ec2UnexpectedException({
|
101 - | #[allow(unused_mut)]
|
102 - | let mut tmp = {
|
103 - | #[allow(unused_mut)]
|
104 - | let mut output = crate::types::error::builders::Ec2UnexpectedExceptionBuilder::default();
|
105 - | output = crate::protocol_serde::shape_ec2_unexpected_exception::de_ec2_unexpected_exception_json_err(_response_body, output)
|
106 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
107 - | let output = output.meta(generic);
|
108 - | output.build()
|
109 - | };
|
110 - | if tmp.message.is_none() {
|
111 - | tmp.message = _error_message;
|
112 - | }
|
113 - | tmp
|
114 - | }),
|
115 - | "EFSIOException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::EfsioException({
|
116 - | #[allow(unused_mut)]
|
117 - | let mut tmp = {
|
118 - | #[allow(unused_mut)]
|
119 - | let mut output = crate::types::error::builders::EfsioExceptionBuilder::default();
|
120 - | output = crate::protocol_serde::shape_efsio_exception::de_efsio_exception_json_err(_response_body, output)
|
121 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
122 - | let output = output.meta(generic);
|
123 - | output.build()
|
124 - | };
|
125 - | if tmp.message.is_none() {
|
126 - | tmp.message = _error_message;
|
127 - | }
|
128 - | tmp
|
129 - | }),
|
130 - | "EFSMountConnectivityException" => {
|
131 - | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::EfsMountConnectivityException({
|
132 - | #[allow(unused_mut)]
|
133 - | let mut tmp = {
|
134 - | #[allow(unused_mut)]
|
135 - | let mut output = crate::types::error::builders::EfsMountConnectivityExceptionBuilder::default();
|
136 - | output = crate::protocol_serde::shape_efs_mount_connectivity_exception::de_efs_mount_connectivity_exception_json_err(
|
137 - | _response_body,
|
138 - | output,
|
139 - | )
|
140 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
141 - | let output = output.meta(generic);
|
142 - | output.build()
|
143 - | };
|
144 - | if tmp.message.is_none() {
|
145 - | tmp.message = _error_message;
|
146 - | }
|
147 - | tmp
|
148 - | })
|
149 - | }
|
150 - | "EFSMountFailureException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::EfsMountFailureException({
|
151 - | #[allow(unused_mut)]
|
152 - | let mut tmp = {
|
153 - | #[allow(unused_mut)]
|
154 - | let mut output = crate::types::error::builders::EfsMountFailureExceptionBuilder::default();
|
155 - | output = crate::protocol_serde::shape_efs_mount_failure_exception::de_efs_mount_failure_exception_json_err(_response_body, output)
|
156 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::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 - | "EFSMountTimeoutException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::EfsMountTimeoutException({
|
166 - | #[allow(unused_mut)]
|
167 - | let mut tmp = {
|
168 - | #[allow(unused_mut)]
|
169 - | let mut output = crate::types::error::builders::EfsMountTimeoutExceptionBuilder::default();
|
170 - | output = crate::protocol_serde::shape_efs_mount_timeout_exception::de_efs_mount_timeout_exception_json_err(_response_body, output)
|
171 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::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 - | "ENILimitReachedException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::EniLimitReachedException({
|
181 - | #[allow(unused_mut)]
|
182 - | let mut tmp = {
|
183 - | #[allow(unused_mut)]
|
184 - | let mut output = crate::types::error::builders::EniLimitReachedExceptionBuilder::default();
|
185 - | output = crate::protocol_serde::shape_eni_limit_reached_exception::de_eni_limit_reached_exception_json_err(_response_body, output)
|
186 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
187 - | let output = output.meta(generic);
|
188 - | output.build()
|
189 - | };
|
190 - | if tmp.message.is_none() {
|
191 - | tmp.message = _error_message;
|
192 - | }
|
193 - | tmp
|
194 - | }),
|
195 - | "InvalidParameterValueException" => {
|
196 - | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::InvalidParameterValueException({
|
197 - | #[allow(unused_mut)]
|
198 - | let mut tmp = {
|
199 - | #[allow(unused_mut)]
|
200 - | let mut output = crate::types::error::builders::InvalidParameterValueExceptionBuilder::default();
|
201 - | output = crate::protocol_serde::shape_invalid_parameter_value_exception::de_invalid_parameter_value_exception_json_err(
|
202 - | _response_body,
|
203 - | output,
|
204 - | )
|
205 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
206 - | let output = output.meta(generic);
|
207 - | output.build()
|
208 - | };
|
209 - | if tmp.message.is_none() {
|
210 - | tmp.message = _error_message;
|
211 - | }
|
212 - | tmp
|
213 - | })
|
214 - | }
|
215 - | "InvalidRequestContentException" => {
|
216 - | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::InvalidRequestContentException({
|
217 - | #[allow(unused_mut)]
|
218 - | let mut tmp = {
|
219 - | #[allow(unused_mut)]
|
220 - | let mut output = crate::types::error::builders::InvalidRequestContentExceptionBuilder::default();
|
221 - | output = crate::protocol_serde::shape_invalid_request_content_exception::de_invalid_request_content_exception_json_err(
|
222 - | _response_body,
|
223 - | output,
|
224 - | )
|
225 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
226 - | let output = output.meta(generic);
|
227 - | output.build()
|
228 - | };
|
229 - | if tmp.message.is_none() {
|
230 - | tmp.message = _error_message;
|
231 - | }
|
232 - | tmp
|
233 - | })
|
234 - | }
|
235 - | "InvalidRuntimeException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::InvalidRuntimeException({
|
236 - | #[allow(unused_mut)]
|
237 - | let mut tmp = {
|
238 - | #[allow(unused_mut)]
|
239 - | let mut output = crate::types::error::builders::InvalidRuntimeExceptionBuilder::default();
|
240 - | output = crate::protocol_serde::shape_invalid_runtime_exception::de_invalid_runtime_exception_json_err(_response_body, output)
|
241 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
242 - | let output = output.meta(generic);
|
243 - | output.build()
|
244 - | };
|
245 - | if tmp.message.is_none() {
|
246 - | tmp.message = _error_message;
|
247 - | }
|
248 - | tmp
|
249 - | }),
|
250 - | "InvalidSecurityGroupIDException" => {
|
251 - | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::InvalidSecurityGroupIdException({
|
252 - | #[allow(unused_mut)]
|
253 - | let mut tmp = {
|
254 - | #[allow(unused_mut)]
|
255 - | let mut output = crate::types::error::builders::InvalidSecurityGroupIdExceptionBuilder::default();
|
256 - | output = crate::protocol_serde::shape_invalid_security_group_id_exception::de_invalid_security_group_id_exception_json_err(
|
257 - | _response_body,
|
258 - | output,
|
259 - | )
|
260 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
261 - | let output = output.meta(generic);
|
262 - | output.build()
|
263 - | };
|
264 - | if tmp.message.is_none() {
|
265 - | tmp.message = _error_message;
|
266 - | }
|
267 - | tmp
|
268 - | })
|
269 - | }
|
270 - | "InvalidSubnetIDException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::InvalidSubnetIdException({
|
271 - | #[allow(unused_mut)]
|
272 - | let mut tmp = {
|
273 - | #[allow(unused_mut)]
|
274 - | let mut output = crate::types::error::builders::InvalidSubnetIdExceptionBuilder::default();
|
275 - | output = crate::protocol_serde::shape_invalid_subnet_id_exception::de_invalid_subnet_id_exception_json_err(_response_body, output)
|
276 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
277 - | let output = output.meta(generic);
|
278 - | output.build()
|
279 - | };
|
280 - | if tmp.message.is_none() {
|
281 - | tmp.message = _error_message;
|
282 - | }
|
283 - | tmp
|
284 - | }),
|
285 - | "InvalidZipFileException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::InvalidZipFileException({
|
286 - | #[allow(unused_mut)]
|
287 - | let mut tmp = {
|
288 - | #[allow(unused_mut)]
|
289 - | let mut output = crate::types::error::builders::InvalidZipFileExceptionBuilder::default();
|
290 - | output = crate::protocol_serde::shape_invalid_zip_file_exception::de_invalid_zip_file_exception_json_err(_response_body, output)
|
291 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
292 - | let output = output.meta(generic);
|
293 - | output.build()
|
294 - | };
|
295 - | if tmp.message.is_none() {
|
296 - | tmp.message = _error_message;
|
297 - | }
|
298 - | tmp
|
299 - | }),
|
300 - | "KMSAccessDeniedException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::KmsAccessDeniedException({
|
301 - | #[allow(unused_mut)]
|
302 - | let mut tmp = {
|
303 - | #[allow(unused_mut)]
|
304 - | let mut output = crate::types::error::builders::KmsAccessDeniedExceptionBuilder::default();
|
305 - | output = crate::protocol_serde::shape_kms_access_denied_exception::de_kms_access_denied_exception_json_err(_response_body, output)
|
306 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
307 - | let output = output.meta(generic);
|
308 - | output.build()
|
309 - | };
|
310 - | if tmp.message.is_none() {
|
311 - | tmp.message = _error_message;
|
312 - | }
|
313 - | tmp
|
314 - | }),
|
315 - | "KMSDisabledException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::KmsDisabledException({
|
316 - | #[allow(unused_mut)]
|
317 - | let mut tmp = {
|
318 - | #[allow(unused_mut)]
|
319 - | let mut output = crate::types::error::builders::KmsDisabledExceptionBuilder::default();
|
320 - | output = crate::protocol_serde::shape_kms_disabled_exception::de_kms_disabled_exception_json_err(_response_body, output)
|
321 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
322 - | let output = output.meta(generic);
|
323 - | output.build()
|
324 - | };
|
325 - | if tmp.message.is_none() {
|
326 - | tmp.message = _error_message;
|
327 - | }
|
328 - | tmp
|
329 - | }),
|
330 - | "KMSInvalidStateException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::KmsInvalidStateException({
|
331 - | #[allow(unused_mut)]
|
332 - | let mut tmp = {
|
333 - | #[allow(unused_mut)]
|
334 - | let mut output = crate::types::error::builders::KmsInvalidStateExceptionBuilder::default();
|
335 - | output = crate::protocol_serde::shape_kms_invalid_state_exception::de_kms_invalid_state_exception_json_err(_response_body, output)
|
336 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
337 - | let output = output.meta(generic);
|
338 - | output.build()
|
339 - | };
|
340 - | if tmp.message.is_none() {
|
341 - | tmp.message = _error_message;
|
342 - | }
|
343 - | tmp
|
344 - | }),
|
345 - | "KMSNotFoundException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::KmsNotFoundException({
|
346 - | #[allow(unused_mut)]
|
347 - | let mut tmp = {
|
348 - | #[allow(unused_mut)]
|
349 - | let mut output = crate::types::error::builders::KmsNotFoundExceptionBuilder::default();
|
350 - | output = crate::protocol_serde::shape_kms_not_found_exception::de_kms_not_found_exception_json_err(_response_body, output)
|
351 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
352 - | let output = output.meta(generic);
|
353 - | output.build()
|
354 - | };
|
355 - | if tmp.message.is_none() {
|
356 - | tmp.message = _error_message;
|
357 - | }
|
358 - | tmp
|
359 - | }),
|
360 - | "RecursiveInvocationException" => {
|
361 - | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::RecursiveInvocationException({
|
362 - | #[allow(unused_mut)]
|
363 - | let mut tmp = {
|
364 - | #[allow(unused_mut)]
|
365 - | let mut output = crate::types::error::builders::RecursiveInvocationExceptionBuilder::default();
|
366 - | output = crate::protocol_serde::shape_recursive_invocation_exception::de_recursive_invocation_exception_json_err(
|
367 - | _response_body,
|
368 - | output,
|
369 - | )
|
370 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
371 - | let output = output.meta(generic);
|
372 - | output.build()
|
373 - | };
|
374 - | if tmp.message.is_none() {
|
375 - | tmp.message = _error_message;
|
376 - | }
|
377 - | tmp
|
378 - | })
|
379 - | }
|
380 - | "RequestTooLargeException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::RequestTooLargeException({
|
381 - | #[allow(unused_mut)]
|
382 - | let mut tmp = {
|
383 - | #[allow(unused_mut)]
|
384 - | let mut output = crate::types::error::builders::RequestTooLargeExceptionBuilder::default();
|
385 - | output = crate::protocol_serde::shape_request_too_large_exception::de_request_too_large_exception_json_err(_response_body, output)
|
386 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
387 - | let output = output.meta(generic);
|
388 - | output.build()
|
389 - | };
|
390 - | if tmp.message.is_none() {
|
391 - | tmp.message = _error_message;
|
392 - | }
|
393 - | tmp
|
394 - | }),
|
395 - | "ResourceConflictException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::ResourceConflictException({
|
396 - | #[allow(unused_mut)]
|
397 - | let mut tmp = {
|
398 - | #[allow(unused_mut)]
|
399 - | let mut output = crate::types::error::builders::ResourceConflictExceptionBuilder::default();
|
400 - | output = crate::protocol_serde::shape_resource_conflict_exception::de_resource_conflict_exception_json_err(_response_body, output)
|
401 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
402 - | let output = output.meta(generic);
|
403 - | output.build()
|
404 - | };
|
405 - | if tmp.message.is_none() {
|
406 - | tmp.message = _error_message;
|
407 - | }
|
408 - | tmp
|
409 - | }),
|
410 - | "ResourceNotFoundException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::ResourceNotFoundException({
|
411 - | #[allow(unused_mut)]
|
412 - | let mut tmp = {
|
413 - | #[allow(unused_mut)]
|
414 - | let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
|
415 - | output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
416 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
417 - | let output = output.meta(generic);
|
418 - | output.build()
|
419 - | };
|
420 - | if tmp.message.is_none() {
|
421 - | tmp.message = _error_message;
|
422 - | }
|
423 - | tmp
|
424 - | }),
|
425 - | "ResourceNotReadyException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::ResourceNotReadyException({
|
426 - | #[allow(unused_mut)]
|
427 - | let mut tmp = {
|
428 - | #[allow(unused_mut)]
|
429 - | let mut output = crate::types::error::builders::ResourceNotReadyExceptionBuilder::default();
|
430 - | output = crate::protocol_serde::shape_resource_not_ready_exception::de_resource_not_ready_exception_json_err(_response_body, output)
|
431 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
432 - | let output = output.meta(generic);
|
433 - | output.build()
|
434 - | };
|
435 - | if tmp.message.is_none() {
|
436 - | tmp.message = _error_message;
|
437 - | }
|
438 - | tmp
|
439 - | }),
|
440 - | "ServiceException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::ServiceException({
|
441 - | #[allow(unused_mut)]
|
442 - | let mut tmp = {
|
443 - | #[allow(unused_mut)]
|
444 - | let mut output = crate::types::error::builders::ServiceExceptionBuilder::default();
|
445 - | output = crate::protocol_serde::shape_service_exception::de_service_exception_json_err(_response_body, output)
|
446 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
447 - | let output = output.meta(generic);
|
448 - | output.build()
|
449 - | };
|
450 - | if tmp.message.is_none() {
|
451 - | tmp.message = _error_message;
|
452 - | }
|
453 - | tmp
|
454 - | }),
|
455 - | "SnapStartException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::SnapStartException({
|
456 - | #[allow(unused_mut)]
|
457 - | let mut tmp = {
|
458 - | #[allow(unused_mut)]
|
459 - | let mut output = crate::types::error::builders::SnapStartExceptionBuilder::default();
|
460 - | output = crate::protocol_serde::shape_snap_start_exception::de_snap_start_exception_json_err(_response_body, output)
|
461 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
462 - | let output = output.meta(generic);
|
463 - | output.build()
|
464 - | };
|
465 - | if tmp.message.is_none() {
|
466 - | tmp.message = _error_message;
|
467 - | }
|
468 - | tmp
|
469 - | }),
|
470 - | "SnapStartNotReadyException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::SnapStartNotReadyException({
|
471 - | #[allow(unused_mut)]
|
472 - | let mut tmp = {
|
473 - | #[allow(unused_mut)]
|
474 - | let mut output = crate::types::error::builders::SnapStartNotReadyExceptionBuilder::default();
|
475 - | output =
|
476 - | crate::protocol_serde::shape_snap_start_not_ready_exception::de_snap_start_not_ready_exception_json_err(_response_body, output)
|
477 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
478 - | let output = output.meta(generic);
|
479 - | output.build()
|
480 - | };
|
481 - | if tmp.message.is_none() {
|
482 - | tmp.message = _error_message;
|
483 - | }
|
484 - | tmp
|
485 - | }),
|
486 - | "SnapStartTimeoutException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::SnapStartTimeoutException({
|
487 - | #[allow(unused_mut)]
|
488 - | let mut tmp = {
|
489 - | #[allow(unused_mut)]
|
490 - | let mut output = crate::types::error::builders::SnapStartTimeoutExceptionBuilder::default();
|
491 - | output = crate::protocol_serde::shape_snap_start_timeout_exception::de_snap_start_timeout_exception_json_err(_response_body, output)
|
492 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
493 - | let output = output.meta(generic);
|
494 - | output.build()
|
495 - | };
|
496 - | if tmp.message.is_none() {
|
497 - | tmp.message = _error_message;
|
498 - | }
|
499 - | tmp
|
500 - | }),
|
501 - | "SubnetIPAddressLimitReachedException" => {
|
502 - | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::SubnetIpAddressLimitReachedException({
|
503 - | #[allow(unused_mut)]
|
504 - | let mut tmp = {
|
505 - | #[allow(unused_mut)]
|
506 - | let mut output = crate::types::error::builders::SubnetIpAddressLimitReachedExceptionBuilder::default();
|
507 - | output = crate::protocol_serde::shape_subnet_ip_address_limit_reached_exception::de_subnet_ip_address_limit_reached_exception_json_err(_response_body, output).map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
508 - | let output = output.meta(generic);
|
509 - | output.build()
|
510 - | };
|
511 - | if tmp.message.is_none() {
|
512 - | tmp.message = _error_message;
|
513 - | }
|
514 - | tmp
|
515 - | })
|
516 - | }
|
517 - | "TooManyRequestsException" => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::TooManyRequestsException({
|
518 - | #[allow(unused_mut)]
|
519 - | let mut tmp = {
|
520 - | #[allow(unused_mut)]
|
521 - | let mut output = crate::types::error::builders::TooManyRequestsExceptionBuilder::default();
|
522 - | output = crate::protocol_serde::shape_too_many_requests_exception::de_too_many_requests_exception_json_err(_response_body, output)
|
523 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
524 - | output = output.set_retry_after_seconds(
|
525 - | crate::protocol_serde::shape_too_many_requests_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| {
|
526 - | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled(
|
527 - | "Failed to parse retryAfterSeconds from header `Retry-After",
|
528 - | )
|
529 - | })?,
|
530 - | );
|
531 - | let output = output.meta(generic);
|
532 - | output.build()
|
533 - | };
|
534 - | if tmp.message.is_none() {
|
535 - | tmp.message = _error_message;
|
536 - | }
|
537 - | tmp
|
538 - | }),
|
539 - | "UnsupportedMediaTypeException" => {
|
540 - | crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::UnsupportedMediaTypeException({
|
541 - | #[allow(unused_mut)]
|
542 - | let mut tmp = {
|
543 - | #[allow(unused_mut)]
|
544 - | let mut output = crate::types::error::builders::UnsupportedMediaTypeExceptionBuilder::default();
|
545 - | output = crate::protocol_serde::shape_unsupported_media_type_exception::de_unsupported_media_type_exception_json_err(
|
546 - | _response_body,
|
547 - | output,
|
548 - | )
|
549 - | .map_err(crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::unhandled)?;
|
550 - | let output = output.meta(generic);
|
551 - | output.build()
|
552 - | };
|
553 - | if tmp.message.is_none() {
|
554 - | tmp.message = _error_message;
|
555 - | }
|
556 - | tmp
|
557 - | })
|
558 - | }
|
559 - | _ => crate::operation::invoke_with_response_stream::InvokeWithResponseStreamError::generic(generic),
|
560 - | })
|
561 - | }
|
562 - |
|
563 - | pub fn ser_invoke_with_response_stream_headers(
|
564 - | input: &crate::operation::invoke_with_response_stream::InvokeWithResponseStreamInput,
|
565 - | mut builder: ::http_1x::request::Builder,
|
566 - | ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
567 - | if let ::std::option::Option::Some(inner_1) = &input.invocation_type {
|
568 - | let formatted_2 = inner_1.as_str();
|
569 - | let header_value = formatted_2;
|
570 - | let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
|
571 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
572 - | "invocation_type",
|
573 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
574 - | )
|
575 - | })?;
|
576 - | builder = builder.header("X-Amz-Invocation-Type", header_value);
|
577 - | }
|
578 - | if let ::std::option::Option::Some(inner_3) = &input.log_type {
|
579 - | let formatted_4 = inner_3.as_str();
|
580 - | let header_value = formatted_4;
|
581 - | let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
|
582 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
583 - | "log_type",
|
584 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
585 - | )
|
586 - | })?;
|
587 - | builder = builder.header("X-Amz-Log-Type", header_value);
|
588 - | }
|
589 - | if let ::std::option::Option::Some(inner_5) = &input.client_context {
|
590 - | let formatted_6 = inner_5.as_str();
|
591 - | let header_value = formatted_6;
|
592 - | let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
|
593 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
594 - | "client_context",
|
595 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
596 - | )
|
597 - | })?;
|
598 - | builder = builder.header("X-Amz-Client-Context", header_value);
|
599 - | }
|
600 - | Ok(builder)
|
601 - | }
|