1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | #[allow(clippy::unnecessary_wraps)]
|
3 3 | pub fn de_attach_group_policy_http_error(
|
4 4 | _response_status: u16,
|
5 5 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 6 | _response_body: &[u8],
|
7 7 | ) -> std::result::Result<crate::operation::attach_group_policy::AttachGroupPolicyOutput, crate::operation::attach_group_policy::AttachGroupPolicyError>
|
8 8 | {
|
9 9 | #[allow(unused_mut)]
|
10 10 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
11 11 | .map_err(crate::operation::attach_group_policy::AttachGroupPolicyError::unhandled)?;
|
12 12 | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
13 13 | let generic = generic_builder.build();
|
14 14 | let error_code = match generic.code() {
|
15 15 | Some(code) => code,
|
16 16 | None => return Err(crate::operation::attach_group_policy::AttachGroupPolicyError::unhandled(generic)),
|
17 17 | };
|
18 18 |
|
19 19 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
20 20 | Err(match error_code {
|
21 21 | "InvalidInput" => crate::operation::attach_group_policy::AttachGroupPolicyError::InvalidInputException({
|
22 22 | #[allow(unused_mut)]
|
23 23 | let mut tmp = {
|
24 24 | #[allow(unused_mut)]
|
25 25 | let mut output = crate::types::error::builders::InvalidInputExceptionBuilder::default();
|
26 26 | output = crate::protocol_serde::shape_invalid_input_exception::de_invalid_input_exception_xml_err(_response_body, output)
|
27 27 | .map_err(crate::operation::attach_group_policy::AttachGroupPolicyError::unhandled)?;
|
28 28 | let output = output.meta(generic);
|
29 29 | output.build()
|
30 30 | };
|
31 - | if tmp.message.is_none() {
|
32 - | tmp.message = _error_message;
|
33 - | }
|
34 31 | tmp
|
35 32 | }),
|
36 33 | "LimitExceeded" => crate::operation::attach_group_policy::AttachGroupPolicyError::LimitExceededException({
|
37 34 | #[allow(unused_mut)]
|
38 35 | let mut tmp = {
|
39 36 | #[allow(unused_mut)]
|
40 37 | let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
|
41 38 | output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_xml_err(_response_body, output)
|
42 39 | .map_err(crate::operation::attach_group_policy::AttachGroupPolicyError::unhandled)?;
|
43 40 | let output = output.meta(generic);
|
44 41 | output.build()
|
45 42 | };
|
46 - | if tmp.message.is_none() {
|
47 - | tmp.message = _error_message;
|
48 - | }
|
49 43 | tmp
|
50 44 | }),
|
51 45 | "NoSuchEntity" => crate::operation::attach_group_policy::AttachGroupPolicyError::NoSuchEntityException({
|
52 46 | #[allow(unused_mut)]
|
53 47 | let mut tmp = {
|
54 48 | #[allow(unused_mut)]
|
55 49 | let mut output = crate::types::error::builders::NoSuchEntityExceptionBuilder::default();
|
56 50 | output = crate::protocol_serde::shape_no_such_entity_exception::de_no_such_entity_exception_xml_err(_response_body, output)
|
57 51 | .map_err(crate::operation::attach_group_policy::AttachGroupPolicyError::unhandled)?;
|
58 52 | let output = output.meta(generic);
|
59 53 | output.build()
|
60 54 | };
|
61 - | if tmp.message.is_none() {
|
62 - | tmp.message = _error_message;
|
63 - | }
|
64 55 | tmp
|
65 56 | }),
|
66 57 | "PolicyNotAttachable" => crate::operation::attach_group_policy::AttachGroupPolicyError::PolicyNotAttachableException({
|
67 58 | #[allow(unused_mut)]
|
68 59 | let mut tmp = {
|
69 60 | #[allow(unused_mut)]
|
70 61 | let mut output = crate::types::error::builders::PolicyNotAttachableExceptionBuilder::default();
|
71 62 | output =
|
72 63 | crate::protocol_serde::shape_policy_not_attachable_exception::de_policy_not_attachable_exception_xml_err(_response_body, output)
|
73 64 | .map_err(crate::operation::attach_group_policy::AttachGroupPolicyError::unhandled)?;
|
74 65 | let output = output.meta(generic);
|
75 66 | output.build()
|
76 67 | };
|
77 - | if tmp.message.is_none() {
|
78 - | tmp.message = _error_message;
|
79 - | }
|
80 68 | tmp
|
81 69 | }),
|
82 70 | "ServiceFailure" => crate::operation::attach_group_policy::AttachGroupPolicyError::ServiceFailureException({
|
83 71 | #[allow(unused_mut)]
|
84 72 | let mut tmp = {
|
85 73 | #[allow(unused_mut)]
|
86 74 | let mut output = crate::types::error::builders::ServiceFailureExceptionBuilder::default();
|
87 75 | output = crate::protocol_serde::shape_service_failure_exception::de_service_failure_exception_xml_err(_response_body, output)
|
88 76 | .map_err(crate::operation::attach_group_policy::AttachGroupPolicyError::unhandled)?;
|
89 77 | let output = output.meta(generic);
|
90 78 | output.build()
|
91 79 | };
|
92 - | if tmp.message.is_none() {
|
93 - | tmp.message = _error_message;
|
94 - | }
|
95 80 | tmp
|
96 81 | }),
|
97 82 | _ => crate::operation::attach_group_policy::AttachGroupPolicyError::generic(generic),
|
98 83 | })
|
99 84 | }
|
100 85 |
|
101 86 | #[allow(clippy::unnecessary_wraps)]
|
102 87 | pub fn de_attach_group_policy_http_response(
|
103 88 | _response_status: u16,
|
104 89 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|