144 150 | crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError,
|
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 GetAggregateResourceConfigResponseDeserializer;
|
153 159 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetAggregateResourceConfigResponseDeserializer {
|
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_get_aggregate_resource_config::de_get_aggregate_resource_config_http_error(status, headers, body)
|
166 - | } else {
|
167 - | crate::protocol_serde::shape_get_aggregate_resource_config::de_get_aggregate_resource_config_http_response(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::get_aggregate_resource_config::GetAggregateResourceConfigError::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 + | "NoSuchConfigurationAggregatorException" => {
|
194 + | crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::NoSuchConfigurationAggregatorException({
|
195 + | let mut tmp = match protocol
|
196 + | .deserialize_response(response, crate::types::error::NoSuchConfigurationAggregatorException::SCHEMA, _cfg)
|
197 + | .and_then(|mut deser| {
|
198 + | crate::types::error::NoSuchConfigurationAggregatorException::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 + | "OversizedConfigurationItemException" => {
|
220 + | crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::OversizedConfigurationItemException({
|
221 + | let mut tmp = match protocol
|
222 + | .deserialize_response(response, crate::types::error::OversizedConfigurationItemException::SCHEMA, _cfg)
|
223 + | .and_then(|mut deser| {
|
224 + | crate::types::error::OversizedConfigurationItemException::deserialize_with_response(
|
225 + | &mut *deser,
|
226 + | response.headers(),
|
227 + | response.status().into(),
|
228 + | body,
|
229 + | )
|
230 + | }) {
|
231 + | ::std::result::Result::Ok(val) => val,
|
232 + | ::std::result::Result::Err(e) => {
|
233 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
234 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
235 + | ))
|
236 + | }
|
168 237 | };
|
169 - | crate::protocol_serde::type_erase_result(parse_result)
|
238 + | tmp.meta = generic;
|
239 + | if tmp.message.is_none() {
|
240 + | tmp.message = _error_message;
|
241 + | }
|
242 + | tmp
|
243 + | })
|
244 + | }
|
245 + | "ResourceNotDiscoveredException" => {
|
246 + | crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::ResourceNotDiscoveredException({
|
247 + | let mut tmp = match protocol
|
248 + | .deserialize_response(response, crate::types::error::ResourceNotDiscoveredException::SCHEMA, _cfg)
|
249 + | .and_then(|mut deser| {
|
250 + | crate::types::error::ResourceNotDiscoveredException::deserialize_with_response(
|
251 + | &mut *deser,
|
252 + | response.headers(),
|
253 + | response.status().into(),
|
254 + | body,
|
255 + | )
|
256 + | }) {
|
257 + | ::std::result::Result::Ok(val) => val,
|
258 + | ::std::result::Result::Err(e) => {
|
259 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
260 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
261 + | ))
|
262 + | }
|
263 + | };
|
264 + | tmp.meta = generic;
|
265 + | if tmp.message.is_none() {
|
266 + | tmp.message = _error_message;
|
267 + | }
|
268 + | tmp
|
269 + | })
|
270 + | }
|
271 + | "ValidationException" => crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::ValidationException({
|
272 + | let mut tmp = match protocol
|
273 + | .deserialize_response(response, crate::types::error::ValidationException::SCHEMA, _cfg)
|
274 + | .and_then(|mut deser| {
|
275 + | crate::types::error::ValidationException::deserialize_with_response(
|
276 + | &mut *deser,
|
277 + | response.headers(),
|
278 + | response.status().into(),
|
279 + | body,
|
280 + | )
|
281 + | }) {
|
282 + | ::std::result::Result::Ok(val) => val,
|
283 + | ::std::result::Result::Err(e) => {
|
284 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
285 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
286 + | ))
|
287 + | }
|
288 + | };
|
289 + | tmp.meta = generic;
|
290 + | if tmp.message.is_none() {
|
291 + | tmp.message = _error_message;
|
292 + | }
|
293 + | tmp
|
294 + | }),
|
295 + | _ => crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigError::generic(generic),
|
296 + | };
|
297 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
298 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
299 + | ))
|
300 + | } else {
|
301 + | let protocol = _cfg
|
302 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
303 + | .expect("a SharedClientProtocol is required");
|
304 + | let mut deser = protocol
|
305 + | .deserialize_response(response, GetAggregateResourceConfig::OUTPUT_SCHEMA, _cfg)
|
306 + | .map_err(|e| {
|
307 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
308 + | })?;
|
309 + | let body = response.body().bytes().expect("body loaded");
|
310 + | let output = crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigOutput::deserialize_with_response(
|
311 + | &mut *deser,
|
312 + | response.headers(),
|
313 + | response.status().into(),
|
314 + | body,
|
315 + | )
|
316 + | .map_err(|e| {
|
317 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
318 + | })?;
|
319 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
320 + | }
|
170 321 | }
|
171 322 | }
|
172 323 | #[derive(Debug)]
|
173 324 | struct GetAggregateResourceConfigRequestSerializer;
|
174 325 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetAggregateResourceConfigRequestSerializer {
|
175 326 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
176 327 | fn serialize_input(
|
177 328 | &self,
|
178 329 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
179 330 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
180 331 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
181 332 | let input = input
|
182 333 | .downcast::<crate::operation::get_aggregate_resource_config::GetAggregateResourceConfigInput>()
|
183 334 | .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::get_aggregate_resource_config::GetAggregateResourceConfigInput,
|
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::get_aggregate_resource_config::GetAggregateResourceConfigInput,
|
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.GetAggregateResourceConfig",
|
213 - | );
|
214 - | builder
|
215 - | };
|
216 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
217 - | crate::protocol_serde::shape_get_aggregate_resource_config::ser_get_aggregate_resource_config_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())
|
335 + | let protocol = _cfg
|
336 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
337 + | .expect("a SharedClientProtocol is required");
|
338 + | let mut request = protocol
|
339 + | .serialize_request(&input, GetAggregateResourceConfig::INPUT_SCHEMA, "", _cfg)
|
340 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
341 + |
|
342 + | return ::std::result::Result::Ok(request);
|
224 343 | }
|
225 344 | }
|
226 345 | #[derive(Debug)]
|
227 346 | struct GetAggregateResourceConfigEndpointParamsInterceptor;
|
228 347 |
|
229 348 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetAggregateResourceConfigEndpointParamsInterceptor {
|
230 349 | fn name(&self) -> &'static str {
|
231 350 | "GetAggregateResourceConfigEndpointParamsInterceptor"
|
232 351 | }
|
233 352 |
|