147 153 | ::std::borrow::Cow::Owned(rcb)
|
148 154 | }
|
149 155 | }
|
150 156 |
|
151 157 | #[derive(Debug)]
|
152 158 | struct SelectAggregateResourceConfigResponseDeserializer;
|
153 159 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SelectAggregateResourceConfigResponseDeserializer {
|
154 160 | fn deserialize_nonstreaming(
|
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_select_aggregate_resource_config::de_select_aggregate_resource_config_http_error(status, headers, body)
|
166 - | } else {
|
167 - | crate::protocol_serde::shape_select_aggregate_resource_config::de_select_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::select_aggregate_resource_config::SelectAggregateResourceConfigError::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 + | "InvalidExpressionException" => {
|
194 + | crate::operation::select_aggregate_resource_config::SelectAggregateResourceConfigError::InvalidExpressionException({
|
195 + | let mut tmp = match protocol
|
196 + | .deserialize_response(response, crate::types::error::InvalidExpressionException::SCHEMA, _cfg)
|
197 + | .and_then(|mut deser| {
|
198 + | crate::types::error::InvalidExpressionException::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 + | }
|
168 211 | };
|
169 - | crate::protocol_serde::type_erase_result(parse_result)
|
212 + | tmp.meta = generic;
|
213 + | if tmp.message.is_none() {
|
214 + | tmp.message = _error_message;
|
215 + | }
|
216 + | tmp
|
217 + | })
|
218 + | }
|
219 + | "InvalidLimitException" => {
|
220 + | crate::operation::select_aggregate_resource_config::SelectAggregateResourceConfigError::InvalidLimitException({
|
221 + | let mut tmp = match protocol
|
222 + | .deserialize_response(response, crate::types::error::InvalidLimitException::SCHEMA, _cfg)
|
223 + | .and_then(|mut deser| {
|
224 + | crate::types::error::InvalidLimitException::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 + | }
|
237 + | };
|
238 + | tmp.meta = generic;
|
239 + | if tmp.message.is_none() {
|
240 + | tmp.message = _error_message;
|
241 + | }
|
242 + | tmp
|
243 + | })
|
244 + | }
|
245 + | "InvalidNextTokenException" => {
|
246 + | crate::operation::select_aggregate_resource_config::SelectAggregateResourceConfigError::InvalidNextTokenException({
|
247 + | let mut tmp = match protocol
|
248 + | .deserialize_response(response, crate::types::error::InvalidNextTokenException::SCHEMA, _cfg)
|
249 + | .and_then(|mut deser| {
|
250 + | crate::types::error::InvalidNextTokenException::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 + | "NoSuchConfigurationAggregatorException" => {
|
272 + | crate::operation::select_aggregate_resource_config::SelectAggregateResourceConfigError::NoSuchConfigurationAggregatorException({
|
273 + | let mut tmp = match protocol
|
274 + | .deserialize_response(response, crate::types::error::NoSuchConfigurationAggregatorException::SCHEMA, _cfg)
|
275 + | .and_then(|mut deser| {
|
276 + | crate::types::error::NoSuchConfigurationAggregatorException::deserialize_with_response(
|
277 + | &mut *deser,
|
278 + | response.headers(),
|
279 + | response.status().into(),
|
280 + | body,
|
281 + | )
|
282 + | }) {
|
283 + | ::std::result::Result::Ok(val) => val,
|
284 + | ::std::result::Result::Err(e) => {
|
285 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
286 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
287 + | ))
|
288 + | }
|
289 + | };
|
290 + | tmp.meta = generic;
|
291 + | if tmp.message.is_none() {
|
292 + | tmp.message = _error_message;
|
293 + | }
|
294 + | tmp
|
295 + | })
|
296 + | }
|
297 + | _ => crate::operation::select_aggregate_resource_config::SelectAggregateResourceConfigError::generic(generic),
|
298 + | };
|
299 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
300 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
301 + | ))
|
302 + | } else {
|
303 + | let protocol = _cfg
|
304 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
305 + | .expect("a SharedClientProtocol is required");
|
306 + | let mut deser = protocol
|
307 + | .deserialize_response(response, SelectAggregateResourceConfig::OUTPUT_SCHEMA, _cfg)
|
308 + | .map_err(|e| {
|
309 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
310 + | })?;
|
311 + | let body = response.body().bytes().expect("body loaded");
|
312 + | let output = crate::operation::select_aggregate_resource_config::SelectAggregateResourceConfigOutput::deserialize_with_response(
|
313 + | &mut *deser,
|
314 + | response.headers(),
|
315 + | response.status().into(),
|
316 + | body,
|
317 + | )
|
318 + | .map_err(|e| {
|
319 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
320 + | })?;
|
321 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
322 + | }
|
170 323 | }
|
171 324 | }
|
172 325 | #[derive(Debug)]
|
173 326 | struct SelectAggregateResourceConfigRequestSerializer;
|
174 327 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SelectAggregateResourceConfigRequestSerializer {
|
175 328 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
176 329 | fn serialize_input(
|
177 330 | &self,
|
178 331 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
179 332 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
180 333 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
181 334 | let input = input
|
182 335 | .downcast::<crate::operation::select_aggregate_resource_config::SelectAggregateResourceConfigInput>()
|
183 336 | .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::select_aggregate_resource_config::SelectAggregateResourceConfigInput,
|
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::select_aggregate_resource_config::SelectAggregateResourceConfigInput,
|
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.SelectAggregateResourceConfig",
|
213 - | );
|
214 - | builder
|
215 - | };
|
216 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
217 - | crate::protocol_serde::shape_select_aggregate_resource_config::ser_select_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())
|
337 + | let protocol = _cfg
|
338 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
339 + | .expect("a SharedClientProtocol is required");
|
340 + | let mut request = protocol
|
341 + | .serialize_request(&input, SelectAggregateResourceConfig::INPUT_SCHEMA, "", _cfg)
|
342 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
343 + |
|
344 + | return ::std::result::Result::Ok(request);
|
224 345 | }
|
225 346 | }
|
226 347 | #[derive(Debug)]
|
227 348 | struct SelectAggregateResourceConfigEndpointParamsInterceptor;
|
228 349 |
|
229 350 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SelectAggregateResourceConfigEndpointParamsInterceptor {
|
230 351 | fn name(&self) -> &'static str {
|
231 352 | "SelectAggregateResourceConfigEndpointParamsInterceptor"
|
232 353 | }
|
233 354 |
|