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