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