6 6 | _response_body: &[u8],
|
7 7 | ) -> std::result::Result<
|
8 8 | crate::operation::get_credential_report::GetCredentialReportOutput,
|
9 9 | crate::operation::get_credential_report::GetCredentialReportError,
|
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_credential_report::GetCredentialReportError::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 => return Err(crate::operation::get_credential_report::GetCredentialReportError::unhandled(generic)),
|
19 19 | };
|
20 20 |
|
21 21 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
22 22 | Err(match error_code {
|
23 23 | "ReportExpired" => crate::operation::get_credential_report::GetCredentialReportError::CredentialReportExpiredException({
|
24 24 | #[allow(unused_mut)]
|
25 25 | let mut tmp = {
|
26 26 | #[allow(unused_mut)]
|
27 27 | let mut output = crate::types::error::builders::CredentialReportExpiredExceptionBuilder::default();
|
28 28 | output = crate::protocol_serde::shape_credential_report_expired_exception::de_credential_report_expired_exception_xml_err(
|
29 29 | _response_body,
|
30 30 | output,
|
31 31 | )
|
32 32 | .map_err(crate::operation::get_credential_report::GetCredentialReportError::unhandled)?;
|
33 33 | let output = output.meta(generic);
|
34 34 | output.build()
|
35 35 | };
|
36 - | if tmp.message.is_none() {
|
37 - | tmp.message = _error_message;
|
38 - | }
|
39 36 | tmp
|
40 37 | }),
|
41 38 | "ReportNotPresent" => crate::operation::get_credential_report::GetCredentialReportError::CredentialReportNotPresentException({
|
42 39 | #[allow(unused_mut)]
|
43 40 | let mut tmp = {
|
44 41 | #[allow(unused_mut)]
|
45 42 | let mut output = crate::types::error::builders::CredentialReportNotPresentExceptionBuilder::default();
|
46 43 | output = crate::protocol_serde::shape_credential_report_not_present_exception::de_credential_report_not_present_exception_xml_err(
|
47 44 | _response_body,
|
48 45 | output,
|
49 46 | )
|
50 47 | .map_err(crate::operation::get_credential_report::GetCredentialReportError::unhandled)?;
|
51 48 | let output = output.meta(generic);
|
52 49 | output.build()
|
53 50 | };
|
54 - | if tmp.message.is_none() {
|
55 - | tmp.message = _error_message;
|
56 - | }
|
57 51 | tmp
|
58 52 | }),
|
59 53 | "ReportInProgress" => crate::operation::get_credential_report::GetCredentialReportError::CredentialReportNotReadyException({
|
60 54 | #[allow(unused_mut)]
|
61 55 | let mut tmp = {
|
62 56 | #[allow(unused_mut)]
|
63 57 | let mut output = crate::types::error::builders::CredentialReportNotReadyExceptionBuilder::default();
|
64 58 | output = crate::protocol_serde::shape_credential_report_not_ready_exception::de_credential_report_not_ready_exception_xml_err(
|
65 59 | _response_body,
|
66 60 | output,
|
67 61 | )
|
68 62 | .map_err(crate::operation::get_credential_report::GetCredentialReportError::unhandled)?;
|
69 63 | let output = output.meta(generic);
|
70 64 | output.build()
|
71 65 | };
|
72 - | if tmp.message.is_none() {
|
73 - | tmp.message = _error_message;
|
74 - | }
|
75 66 | tmp
|
76 67 | }),
|
77 68 | "ServiceFailure" => crate::operation::get_credential_report::GetCredentialReportError::ServiceFailureException({
|
78 69 | #[allow(unused_mut)]
|
79 70 | let mut tmp = {
|
80 71 | #[allow(unused_mut)]
|
81 72 | let mut output = crate::types::error::builders::ServiceFailureExceptionBuilder::default();
|
82 73 | output = crate::protocol_serde::shape_service_failure_exception::de_service_failure_exception_xml_err(_response_body, output)
|
83 74 | .map_err(crate::operation::get_credential_report::GetCredentialReportError::unhandled)?;
|
84 75 | let output = output.meta(generic);
|
85 76 | output.build()
|
86 77 | };
|
87 - | if tmp.message.is_none() {
|
88 - | tmp.message = _error_message;
|
89 - | }
|
90 78 | tmp
|
91 79 | }),
|
92 80 | _ => crate::operation::get_credential_report::GetCredentialReportError::generic(generic),
|
93 81 | })
|
94 82 | }
|
95 83 |
|
96 84 | #[allow(clippy::unnecessary_wraps)]
|
97 85 | pub fn de_get_credential_report_http_response(
|
98 86 | _response_status: u16,
|
99 87 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
100 88 | _response_body: &[u8],
|
101 89 | ) -> std::result::Result<
|
102 90 | crate::operation::get_credential_report::GetCredentialReportOutput,
|
103 91 | crate::operation::get_credential_report::GetCredentialReportError,
|
104 92 | > {
|
105 93 | Ok({
|
106 94 | #[allow(unused_mut)]
|
107 95 | let mut output = crate::operation::get_credential_report::builders::GetCredentialReportOutputBuilder::default();
|
108 96 | output = crate::protocol_serde::shape_get_credential_report::de_get_credential_report(_response_body, output)
|
109 97 | .map_err(crate::operation::get_credential_report::GetCredentialReportError::unhandled)?;
|
110 98 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
111 99 | output.build()
|
112 100 | })
|
113 101 | }
|
114 102 |
|
115 103 | #[allow(unused_mut)]
|
116 104 | pub fn de_get_credential_report(
|
117 105 | inp: &[u8],
|
118 106 | mut builder: crate::operation::get_credential_report::builders::GetCredentialReportOutputBuilder,
|
119 107 | ) -> std::result::Result<crate::operation::get_credential_report::builders::GetCredentialReportOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError>
|