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