144 150 | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError,
|
145 151 | >::new());
|
146 152 |
|
147 153 | ::std::borrow::Cow::Owned(rcb)
|
148 154 | }
|
149 155 | }
|
150 156 |
|
151 157 | #[derive(Debug)]
|
152 158 | struct PutConfigurationAggregatorResponseDeserializer;
|
153 159 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PutConfigurationAggregatorResponseDeserializer {
|
154 - | fn deserialize_nonstreaming(
|
160 + | fn deserialize_nonstreaming_with_config(
|
155 161 | &self,
|
156 162 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
163 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
157 164 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
158 165 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
159 - | let headers = response.headers();
|
160 - | let body = response.body().bytes().expect("body loaded");
|
161 166 | #[allow(unused_mut)]
|
162 167 | let mut force_error = false;
|
163 168 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
164 - | let parse_result = if !success && status != 200 || force_error {
|
165 - | crate::protocol_serde::shape_put_configuration_aggregator::de_put_configuration_aggregator_http_error(status, headers, body)
|
169 + | if !success && status != 200 || force_error {
|
170 + | let headers = response.headers();
|
171 + | let body = response.body().bytes().expect("body loaded");
|
172 + | #[allow(unused_mut)]
|
173 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
174 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
175 + | })?;
|
176 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
177 + | let generic = generic_builder.build();
|
178 + | let error_code = match generic.code() {
|
179 + | ::std::option::Option::Some(code) => code,
|
180 + | ::std::option::Option::None => {
|
181 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
182 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
183 + | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::unhandled(generic),
|
184 + | ),
|
185 + | ))
|
186 + | }
|
187 + | };
|
188 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
189 + | let protocol = _cfg
|
190 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
191 + | .expect("a SharedClientProtocol is required");
|
192 + | let err = match error_code {
|
193 + | "InvalidParameterValueException" => {
|
194 + | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::InvalidParameterValueException({
|
195 + | let mut tmp = match protocol
|
196 + | .deserialize_response(response, crate::types::error::InvalidParameterValueException::SCHEMA, _cfg)
|
197 + | .and_then(|mut deser| {
|
198 + | crate::types::error::InvalidParameterValueException::deserialize_with_response(
|
199 + | &mut *deser,
|
200 + | response.headers(),
|
201 + | response.status().into(),
|
202 + | body,
|
203 + | )
|
204 + | }) {
|
205 + | ::std::result::Result::Ok(val) => val,
|
206 + | ::std::result::Result::Err(e) => {
|
207 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
208 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
209 + | ))
|
210 + | }
|
211 + | };
|
212 + | tmp.meta = generic;
|
213 + | if tmp.message.is_none() {
|
214 + | tmp.message = _error_message;
|
215 + | }
|
216 + | tmp
|
217 + | })
|
218 + | }
|
219 + | "InvalidRoleException" => crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::InvalidRoleException({
|
220 + | let mut tmp = match protocol
|
221 + | .deserialize_response(response, crate::types::error::InvalidRoleException::SCHEMA, _cfg)
|
222 + | .and_then(|mut deser| {
|
223 + | crate::types::error::InvalidRoleException::deserialize_with_response(
|
224 + | &mut *deser,
|
225 + | response.headers(),
|
226 + | response.status().into(),
|
227 + | body,
|
228 + | )
|
229 + | }) {
|
230 + | ::std::result::Result::Ok(val) => val,
|
231 + | ::std::result::Result::Err(e) => {
|
232 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
233 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
234 + | ))
|
235 + | }
|
236 + | };
|
237 + | tmp.meta = generic;
|
238 + | if tmp.message.is_none() {
|
239 + | tmp.message = _error_message;
|
240 + | }
|
241 + | tmp
|
242 + | }),
|
243 + | "LimitExceededException" => {
|
244 + | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::LimitExceededException({
|
245 + | let mut tmp = match protocol
|
246 + | .deserialize_response(response, crate::types::error::LimitExceededException::SCHEMA, _cfg)
|
247 + | .and_then(|mut deser| {
|
248 + | crate::types::error::LimitExceededException::deserialize_with_response(
|
249 + | &mut *deser,
|
250 + | response.headers(),
|
251 + | response.status().into(),
|
252 + | body,
|
253 + | )
|
254 + | }) {
|
255 + | ::std::result::Result::Ok(val) => val,
|
256 + | ::std::result::Result::Err(e) => {
|
257 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
258 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
259 + | ))
|
260 + | }
|
261 + | };
|
262 + | tmp.meta = generic;
|
263 + | if tmp.message.is_none() {
|
264 + | tmp.message = _error_message;
|
265 + | }
|
266 + | tmp
|
267 + | })
|
268 + | }
|
269 + | "NoAvailableOrganizationException" => {
|
270 + | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::NoAvailableOrganizationException({
|
271 + | let mut tmp = match protocol
|
272 + | .deserialize_response(response, crate::types::error::NoAvailableOrganizationException::SCHEMA, _cfg)
|
273 + | .and_then(|mut deser| {
|
274 + | crate::types::error::NoAvailableOrganizationException::deserialize_with_response(
|
275 + | &mut *deser,
|
276 + | response.headers(),
|
277 + | response.status().into(),
|
278 + | body,
|
279 + | )
|
280 + | }) {
|
281 + | ::std::result::Result::Ok(val) => val,
|
282 + | ::std::result::Result::Err(e) => {
|
283 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
284 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
285 + | ))
|
286 + | }
|
287 + | };
|
288 + | tmp.meta = generic;
|
289 + | if tmp.message.is_none() {
|
290 + | tmp.message = _error_message;
|
291 + | }
|
292 + | tmp
|
293 + | })
|
294 + | }
|
295 + | "OrganizationAccessDeniedException" => {
|
296 + | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::OrganizationAccessDeniedException({
|
297 + | let mut tmp = match protocol
|
298 + | .deserialize_response(response, crate::types::error::OrganizationAccessDeniedException::SCHEMA, _cfg)
|
299 + | .and_then(|mut deser| {
|
300 + | crate::types::error::OrganizationAccessDeniedException::deserialize_with_response(
|
301 + | &mut *deser,
|
302 + | response.headers(),
|
303 + | response.status().into(),
|
304 + | body,
|
305 + | )
|
306 + | }) {
|
307 + | ::std::result::Result::Ok(val) => val,
|
308 + | ::std::result::Result::Err(e) => {
|
309 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
310 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
311 + | ))
|
312 + | }
|
313 + | };
|
314 + | tmp.meta = generic;
|
315 + | if tmp.message.is_none() {
|
316 + | tmp.message = _error_message;
|
317 + | }
|
318 + | tmp
|
319 + | })
|
320 + | }
|
321 + | "OrganizationAllFeaturesNotEnabledException" => {
|
322 + | crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::OrganizationAllFeaturesNotEnabledException({
|
323 + | let mut tmp = match protocol
|
324 + | .deserialize_response(response, crate::types::error::OrganizationAllFeaturesNotEnabledException::SCHEMA, _cfg)
|
325 + | .and_then(|mut deser| {
|
326 + | crate::types::error::OrganizationAllFeaturesNotEnabledException::deserialize_with_response(
|
327 + | &mut *deser,
|
328 + | response.headers(),
|
329 + | response.status().into(),
|
330 + | body,
|
331 + | )
|
332 + | }) {
|
333 + | ::std::result::Result::Ok(val) => val,
|
334 + | ::std::result::Result::Err(e) => {
|
335 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
336 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
337 + | ))
|
338 + | }
|
339 + | };
|
340 + | tmp.meta = generic;
|
341 + | if tmp.message.is_none() {
|
342 + | tmp.message = _error_message;
|
343 + | }
|
344 + | tmp
|
345 + | })
|
346 + | }
|
347 + | _ => crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError::generic(generic),
|
348 + | };
|
349 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
350 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
351 + | ))
|
166 352 | } else {
|
167 - | crate::protocol_serde::shape_put_configuration_aggregator::de_put_configuration_aggregator_http_response(status, headers, body)
|
168 - | };
|
169 - | crate::protocol_serde::type_erase_result(parse_result)
|
353 + | let protocol = _cfg
|
354 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
355 + | .expect("a SharedClientProtocol is required");
|
356 + | let mut deser = protocol
|
357 + | .deserialize_response(response, PutConfigurationAggregator::OUTPUT_SCHEMA, _cfg)
|
358 + | .map_err(|e| {
|
359 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
360 + | })?;
|
361 + | let body = response.body().bytes().expect("body loaded");
|
362 + | let output = crate::operation::put_configuration_aggregator::PutConfigurationAggregatorOutput::deserialize_with_response(
|
363 + | &mut *deser,
|
364 + | response.headers(),
|
365 + | response.status().into(),
|
366 + | body,
|
367 + | )
|
368 + | .map_err(|e| {
|
369 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
370 + | })?;
|
371 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
372 + | }
|
170 373 | }
|
171 374 | }
|
172 375 | #[derive(Debug)]
|
173 376 | struct PutConfigurationAggregatorRequestSerializer;
|
174 377 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for PutConfigurationAggregatorRequestSerializer {
|
175 378 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
176 379 | fn serialize_input(
|
177 380 | &self,
|
178 381 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
179 382 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
180 383 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
181 384 | let input = input
|
182 385 | .downcast::<crate::operation::put_configuration_aggregator::PutConfigurationAggregatorInput>()
|
183 386 | .expect("correct type");
|
184 - | let _header_serialization_settings = _cfg
|
185 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
186 - | .cloned()
|
187 - | .unwrap_or_default();
|
188 - | let mut request_builder = {
|
189 - | #[allow(clippy::uninlined_format_args)]
|
190 - | fn uri_base(
|
191 - | _input: &crate::operation::put_configuration_aggregator::PutConfigurationAggregatorInput,
|
192 - | output: &mut ::std::string::String,
|
193 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
194 - | use ::std::fmt::Write as _;
|
195 - | ::std::write!(output, "/").expect("formatting should succeed");
|
196 - | ::std::result::Result::Ok(())
|
197 - | }
|
198 - | #[allow(clippy::unnecessary_wraps)]
|
199 - | fn update_http_builder(
|
200 - | input: &crate::operation::put_configuration_aggregator::PutConfigurationAggregatorInput,
|
201 - | builder: ::http_1x::request::Builder,
|
202 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
203 - | let mut uri = ::std::string::String::new();
|
204 - | uri_base(input, &mut uri)?;
|
205 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
206 - | }
|
207 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
208 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
|
209 - | builder = _header_serialization_settings.set_default_header(
|
210 - | builder,
|
211 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
212 - | "StarlingDoveService.PutConfigurationAggregator",
|
213 - | );
|
214 - | builder
|
215 - | };
|
216 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
217 - | crate::protocol_serde::shape_put_configuration_aggregator::ser_put_configuration_aggregator_input(&input)?,
|
218 - | );
|
219 - | if let Some(content_length) = body.content_length() {
|
220 - | let content_length = content_length.to_string();
|
221 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
222 - | }
|
223 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
387 + | let protocol = _cfg
|
388 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
389 + | .expect("a SharedClientProtocol is required");
|
390 + | let mut request = protocol
|
391 + | .serialize_request(&input, PutConfigurationAggregator::INPUT_SCHEMA, "", _cfg)
|
392 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
393 + |
|
394 + | return ::std::result::Result::Ok(request);
|
224 395 | }
|
225 396 | }
|
226 397 | #[derive(Debug)]
|
227 398 | struct PutConfigurationAggregatorEndpointParamsInterceptor;
|
228 399 |
|
229 400 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PutConfigurationAggregatorEndpointParamsInterceptor {
|
230 401 | fn name(&self) -> &'static str {
|
231 402 | "PutConfigurationAggregatorEndpointParamsInterceptor"
|
232 403 | }
|
233 404 |
|