1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_put_configuration_aggregator_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::put_configuration_aggregator::PutConfigurationAggregatorOutput,
|
9 - | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError,
|
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::put_configuration_aggregator::PutConfigurationAggregatorError::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::put_configuration_aggregator::PutConfigurationAggregatorError::unhandled(generic)),
|
19 - | };
|
20 - |
|
21 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
22 - | Err(match error_code {
|
23 - | "InvalidParameterValueException" => {
|
24 - | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::InvalidParameterValueException({
|
25 - | #[allow(unused_mut)]
|
26 - | let mut tmp = {
|
27 - | #[allow(unused_mut)]
|
28 - | let mut output = crate::types::error::builders::InvalidParameterValueExceptionBuilder::default();
|
29 - | output = crate::protocol_serde::shape_invalid_parameter_value_exception::de_invalid_parameter_value_exception_json_err(
|
30 - | _response_body,
|
31 - | output,
|
32 - | )
|
33 - | .map_err(crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::unhandled)?;
|
34 - | let output = output.meta(generic);
|
35 - | output.build()
|
36 - | };
|
37 - | if tmp.message.is_none() {
|
38 - | tmp.message = _error_message;
|
39 - | }
|
40 - | tmp
|
41 - | })
|
42 - | }
|
43 - | "InvalidRoleException" => crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::InvalidRoleException({
|
44 - | #[allow(unused_mut)]
|
45 - | let mut tmp = {
|
46 - | #[allow(unused_mut)]
|
47 - | let mut output = crate::types::error::builders::InvalidRoleExceptionBuilder::default();
|
48 - | output = crate::protocol_serde::shape_invalid_role_exception::de_invalid_role_exception_json_err(_response_body, output)
|
49 - | .map_err(crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::unhandled)?;
|
50 - | let output = output.meta(generic);
|
51 - | output.build()
|
52 - | };
|
53 - | if tmp.message.is_none() {
|
54 - | tmp.message = _error_message;
|
55 - | }
|
56 - | tmp
|
57 - | }),
|
58 - | "LimitExceededException" => crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::LimitExceededException({
|
59 - | #[allow(unused_mut)]
|
60 - | let mut tmp = {
|
61 - | #[allow(unused_mut)]
|
62 - | let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
|
63 - | output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
|
64 - | .map_err(crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::unhandled)?;
|
65 - | let output = output.meta(generic);
|
66 - | output.build()
|
67 - | };
|
68 - | if tmp.message.is_none() {
|
69 - | tmp.message = _error_message;
|
70 - | }
|
71 - | tmp
|
72 - | }),
|
73 - | "NoAvailableOrganizationException" => {
|
74 - | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::NoAvailableOrganizationException({
|
75 - | #[allow(unused_mut)]
|
76 - | let mut tmp = {
|
77 - | #[allow(unused_mut)]
|
78 - | let mut output = crate::types::error::builders::NoAvailableOrganizationExceptionBuilder::default();
|
79 - | output = crate::protocol_serde::shape_no_available_organization_exception::de_no_available_organization_exception_json_err(
|
80 - | _response_body,
|
81 - | output,
|
82 - | )
|
83 - | .map_err(crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::unhandled)?;
|
84 - | let output = output.meta(generic);
|
85 - | output.build()
|
86 - | };
|
87 - | if tmp.message.is_none() {
|
88 - | tmp.message = _error_message;
|
89 - | }
|
90 - | tmp
|
91 - | })
|
92 - | }
|
93 - | "OrganizationAccessDeniedException" => {
|
94 - | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::OrganizationAccessDeniedException({
|
95 - | #[allow(unused_mut)]
|
96 - | let mut tmp = {
|
97 - | #[allow(unused_mut)]
|
98 - | let mut output = crate::types::error::builders::OrganizationAccessDeniedExceptionBuilder::default();
|
99 - | output = crate::protocol_serde::shape_organization_access_denied_exception::de_organization_access_denied_exception_json_err(
|
100 - | _response_body,
|
101 - | output,
|
102 - | )
|
103 - | .map_err(crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::unhandled)?;
|
104 - | let output = output.meta(generic);
|
105 - | output.build()
|
106 - | };
|
107 - | if tmp.message.is_none() {
|
108 - | tmp.message = _error_message;
|
109 - | }
|
110 - | tmp
|
111 - | })
|
112 - | }
|
113 - | "OrganizationAllFeaturesNotEnabledException" => {
|
114 - | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::OrganizationAllFeaturesNotEnabledException({
|
115 - | #[allow(unused_mut)]
|
116 - | let mut tmp = {
|
117 - | #[allow(unused_mut)]
|
118 - | let mut output = crate::types::error::builders::OrganizationAllFeaturesNotEnabledExceptionBuilder::default();
|
119 - | output = crate::protocol_serde::shape_organization_all_features_not_enabled_exception::de_organization_all_features_not_enabled_exception_json_err(_response_body, output).map_err(crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::unhandled)?;
|
120 - | let output = output.meta(generic);
|
121 - | output.build()
|
122 - | };
|
123 - | if tmp.message.is_none() {
|
124 - | tmp.message = _error_message;
|
125 - | }
|
126 - | tmp
|
127 - | })
|
128 - | }
|
129 - | _ => crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::generic(generic),
|
130 - | })
|
131 - | }
|
132 - |
|
133 - | #[allow(clippy::unnecessary_wraps)]
|
134 - | pub fn de_put_configuration_aggregator_http_response(
|
135 - | _response_status: u16,
|
136 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
137 - | _response_body: &[u8],
|
138 - | ) -> std::result::Result<
|
139 - | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorOutput,
|
140 - | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError,
|
141 - | > {
|
142 - | Ok({
|
143 - | #[allow(unused_mut)]
|
144 - | let mut output = crate::operation::put_configuration_aggregator::builders::PutConfigurationAggregatorOutputBuilder::default();
|
145 - | output = crate::protocol_serde::shape_put_configuration_aggregator::de_put_configuration_aggregator(_response_body, output)
|
146 - | .map_err(crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::unhandled)?;
|
147 - | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
148 - | output.build()
|
149 - | })
|
150 - | }
|
151 - |
|
152 - | pub fn ser_put_configuration_aggregator_input(
|
153 - | input: &crate::operation::put_configuration_aggregator::PutConfigurationAggregatorInput,
|
154 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
155 - | let mut out = String::new();
|
156 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
157 - | crate::protocol_serde::shape_put_configuration_aggregator_input::ser_put_configuration_aggregator_input_input(&mut object, input)?;
|
158 - | object.finish();
|
159 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
160 - | }
|
161 - |
|
162 - | pub(crate) fn de_put_configuration_aggregator(
|
163 - | _value: &[u8],
|
164 - | mut builder: crate::operation::put_configuration_aggregator::builders::PutConfigurationAggregatorOutputBuilder,
|
165 - | ) -> ::std::result::Result<
|
166 - | crate::operation::put_configuration_aggregator::builders::PutConfigurationAggregatorOutputBuilder,
|
167 - | ::aws_smithy_json::deserialize::error::DeserializeError,
|
168 - | > {
|
169 - | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
|
170 - | let tokens = &mut tokens_owned;
|
171 - | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
172 - | loop {
|
173 - | match tokens.next().transpose()? {
|
174 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
175 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
176 - | "ConfigurationAggregator" => {
|
177 - | builder = builder.set_configuration_aggregator(
|
178 - | crate::protocol_serde::shape_configuration_aggregator::de_configuration_aggregator(tokens, _value)?,
|
179 - | );
|
180 - | }
|
181 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
182 - | },
|
183 - | other => {
|
184 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
185 - | "expected object key or end object, found: {other:?}"
|
186 - | )))
|
187 - | }
|
188 - | }
|
189 - | }
|
190 - | if tokens.next().is_some() {
|
191 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
192 - | "found more JSON tokens after completing parsing",
|
193 - | ));
|
194 - | }
|
195 - | Ok(builder)
|
196 - | }
|