3 3 | pub fn de_get_aggregate_resource_config_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<
|
8 8 | crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigOutput,
|
9 9 | crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError,
|
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_aggregate_resource_config::GetAggregateResourceConfigError::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_aggregate_resource_config::GetAggregateResourceConfigError::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 | "NoSuchConfigurationAggregatorException" => {
|
24 24 | crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::NoSuchConfigurationAggregatorException({
|
25 25 | #[allow(unused_mut)]
|
26 26 | let mut tmp = {
|
27 27 | #[allow(unused_mut)]
|
28 28 | let mut output = crate::types::error::builders::NoSuchConfigurationAggregatorExceptionBuilder::default();
|
29 29 | output = crate::protocol_serde::shape_no_such_configuration_aggregator_exception::de_no_such_configuration_aggregator_exception_json_err(_response_body, output).map_err(crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::unhandled)?;
|
30 30 | let output = output.meta(generic);
|
31 31 | output.build()
|
32 32 | };
|
33 - | if tmp.message.is_none() {
|
34 - | tmp.message = _error_message;
|
35 - | }
|
36 33 | tmp
|
37 34 | })
|
38 35 | }
|
39 36 | "OversizedConfigurationItemException" => {
|
40 37 | crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::OversizedConfigurationItemException({
|
41 38 | #[allow(unused_mut)]
|
42 39 | let mut tmp = {
|
43 40 | #[allow(unused_mut)]
|
44 41 | let mut output = crate::types::error::builders::OversizedConfigurationItemExceptionBuilder::default();
|
45 42 | output = crate::protocol_serde::shape_oversized_configuration_item_exception::de_oversized_configuration_item_exception_json_err(
|
46 43 | _response_body,
|
47 44 | output,
|
48 45 | )
|
49 46 | .map_err(crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::unhandled)?;
|
50 47 | let output = output.meta(generic);
|
51 48 | output.build()
|
52 49 | };
|
53 - | if tmp.message.is_none() {
|
54 - | tmp.message = _error_message;
|
55 - | }
|
56 50 | tmp
|
57 51 | })
|
58 52 | }
|
59 53 | "ResourceNotDiscoveredException" => {
|
60 54 | crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::ResourceNotDiscoveredException({
|
61 55 | #[allow(unused_mut)]
|
62 56 | let mut tmp = {
|
63 57 | #[allow(unused_mut)]
|
64 58 | let mut output = crate::types::error::builders::ResourceNotDiscoveredExceptionBuilder::default();
|
65 59 | output = crate::protocol_serde::shape_resource_not_discovered_exception::de_resource_not_discovered_exception_json_err(
|
66 60 | _response_body,
|
67 61 | output,
|
68 62 | )
|
69 63 | .map_err(crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::unhandled)?;
|
70 64 | let output = output.meta(generic);
|
71 65 | output.build()
|
72 66 | };
|
73 - | if tmp.message.is_none() {
|
74 - | tmp.message = _error_message;
|
75 - | }
|
76 67 | tmp
|
77 68 | })
|
78 69 | }
|
79 70 | "ValidationException" => crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::ValidationException({
|
80 71 | #[allow(unused_mut)]
|
81 72 | let mut tmp = {
|
82 73 | #[allow(unused_mut)]
|
83 74 | let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
|
84 75 | output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
|
85 76 | .map_err(crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::unhandled)?;
|
86 77 | let output = output.meta(generic);
|
87 78 | output.build()
|
88 79 | };
|
89 - | if tmp.message.is_none() {
|
90 - | tmp.message = _error_message;
|
91 - | }
|
92 80 | tmp
|
93 81 | }),
|
94 82 | _ => crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::generic(generic),
|
95 83 | })
|
96 84 | }
|
97 85 |
|
98 86 | #[allow(clippy::unnecessary_wraps)]
|
99 87 | pub fn de_get_aggregate_resource_config_http_response(
|
100 88 | _response_status: u16,
|
101 89 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
102 90 | _response_body: &[u8],
|
103 91 | ) -> std::result::Result<
|
104 92 | crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigOutput,
|
105 93 | crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError,
|
106 94 | > {
|
107 95 | Ok({
|
108 96 | #[allow(unused_mut)]
|
109 97 | let mut output = crate::operation::get_aggregate_resource_config::builders::GetAggregateResourceConfigOutputBuilder::default();
|
110 98 | output = crate::protocol_serde::shape_get_aggregate_resource_config::de_get_aggregate_resource_config(_response_body, output)
|
111 99 | .map_err(crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::unhandled)?;
|
112 100 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
113 101 | output.build()
|
114 102 | })
|
115 103 | }
|
116 104 |
|
117 105 | pub fn ser_get_aggregate_resource_config_input(
|
118 106 | input: &crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigInput,
|
119 107 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
120 108 | let mut out = String::new();
|
121 109 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|