147 151 | ::std::borrow::Cow::Owned(rcb)
|
148 152 | }
|
149 153 | }
|
150 154 |
|
151 155 | #[derive(Debug)]
|
152 156 | struct ListScheduledQueriesResponseDeserializer;
|
153 157 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListScheduledQueriesResponseDeserializer {
|
154 158 | fn deserialize_nonstreaming(
|
155 159 | &self,
|
156 160 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
161 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
157 162 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
158 163 | 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 164 | #[allow(unused_mut)]
|
162 165 | let mut force_error = false;
|
163 166 | ::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_list_scheduled_queries::de_list_scheduled_queries_http_error(status, headers, body)
|
167 + | if !success && status != 200 || force_error {
|
168 + | let headers = response.headers();
|
169 + | let body = response.body().bytes().expect("body loaded");
|
170 + | #[allow(unused_mut)]
|
171 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
172 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
173 + | })?;
|
174 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
175 + | let generic = generic_builder.build();
|
176 + | let error_code = match generic.code() {
|
177 + | ::std::option::Option::Some(code) => code,
|
178 + | ::std::option::Option::None => {
|
179 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
180 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
181 + | crate::operation::list_scheduled_queries::ListScheduledQueriesError::unhandled(generic),
|
182 + | ),
|
183 + | ))
|
184 + | }
|
185 + | };
|
186 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
187 + | let protocol = _cfg
|
188 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
189 + | .expect("a SharedClientProtocol is required");
|
190 + | let err = match error_code {
|
191 + | "AccessDeniedException" => crate::operation::list_scheduled_queries::ListScheduledQueriesError::AccessDeniedException({
|
192 + | let mut tmp = match protocol
|
193 + | .deserialize_response(response, crate::types::error::AccessDeniedException::SCHEMA, _cfg)
|
194 + | .and_then(|mut deser| {
|
195 + | crate::types::error::AccessDeniedException::deserialize_with_response(
|
196 + | &mut *deser,
|
197 + | response.headers(),
|
198 + | response.status().into(),
|
199 + | body,
|
200 + | )
|
201 + | }) {
|
202 + | ::std::result::Result::Ok(val) => val,
|
203 + | ::std::result::Result::Err(e) => {
|
204 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
205 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
206 + | ))
|
207 + | }
|
208 + | };
|
209 + | tmp.meta = generic;
|
210 + | if tmp.message.is_none() {
|
211 + | tmp.message = _error_message;
|
212 + | }
|
213 + | tmp
|
214 + | }),
|
215 + | "InternalServerException" => crate::operation::list_scheduled_queries::ListScheduledQueriesError::InternalServerException({
|
216 + | let mut tmp = match protocol
|
217 + | .deserialize_response(response, crate::types::error::InternalServerException::SCHEMA, _cfg)
|
218 + | .and_then(|mut deser| {
|
219 + | crate::types::error::InternalServerException::deserialize_with_response(
|
220 + | &mut *deser,
|
221 + | response.headers(),
|
222 + | response.status().into(),
|
223 + | body,
|
224 + | )
|
225 + | }) {
|
226 + | ::std::result::Result::Ok(val) => val,
|
227 + | ::std::result::Result::Err(e) => {
|
228 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
229 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
230 + | ))
|
231 + | }
|
232 + | };
|
233 + | tmp.meta = generic;
|
234 + | if tmp.message.is_none() {
|
235 + | tmp.message = _error_message;
|
236 + | }
|
237 + | tmp
|
238 + | }),
|
239 + | "InvalidEndpointException" => crate::operation::list_scheduled_queries::ListScheduledQueriesError::InvalidEndpointException({
|
240 + | let mut tmp = match protocol
|
241 + | .deserialize_response(response, crate::types::error::InvalidEndpointException::SCHEMA, _cfg)
|
242 + | .and_then(|mut deser| {
|
243 + | crate::types::error::InvalidEndpointException::deserialize_with_response(
|
244 + | &mut *deser,
|
245 + | response.headers(),
|
246 + | response.status().into(),
|
247 + | body,
|
248 + | )
|
249 + | }) {
|
250 + | ::std::result::Result::Ok(val) => val,
|
251 + | ::std::result::Result::Err(e) => {
|
252 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
253 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
254 + | ))
|
255 + | }
|
256 + | };
|
257 + | tmp.meta = generic;
|
258 + | if tmp.message.is_none() {
|
259 + | tmp.message = _error_message;
|
260 + | }
|
261 + | tmp
|
262 + | }),
|
263 + | "ThrottlingException" => crate::operation::list_scheduled_queries::ListScheduledQueriesError::ThrottlingException({
|
264 + | let mut tmp = match protocol
|
265 + | .deserialize_response(response, crate::types::error::ThrottlingException::SCHEMA, _cfg)
|
266 + | .and_then(|mut deser| {
|
267 + | crate::types::error::ThrottlingException::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 + | "ValidationException" => crate::operation::list_scheduled_queries::ListScheduledQueriesError::ValidationException({
|
288 + | let mut tmp = match protocol
|
289 + | .deserialize_response(response, crate::types::error::ValidationException::SCHEMA, _cfg)
|
290 + | .and_then(|mut deser| {
|
291 + | crate::types::error::ValidationException::deserialize_with_response(
|
292 + | &mut *deser,
|
293 + | response.headers(),
|
294 + | response.status().into(),
|
295 + | body,
|
296 + | )
|
297 + | }) {
|
298 + | ::std::result::Result::Ok(val) => val,
|
299 + | ::std::result::Result::Err(e) => {
|
300 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
301 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
302 + | ))
|
303 + | }
|
304 + | };
|
305 + | tmp.meta = generic;
|
306 + | if tmp.message.is_none() {
|
307 + | tmp.message = _error_message;
|
308 + | }
|
309 + | tmp
|
310 + | }),
|
311 + | _ => crate::operation::list_scheduled_queries::ListScheduledQueriesError::generic(generic),
|
312 + | };
|
313 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
314 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
315 + | ))
|
166 316 | } else {
|
167 - | crate::protocol_serde::shape_list_scheduled_queries::de_list_scheduled_queries_http_response(status, headers, body)
|
168 - | };
|
169 - | crate::protocol_serde::type_erase_result(parse_result)
|
317 + | let protocol = _cfg
|
318 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
319 + | .expect("a SharedClientProtocol is required");
|
320 + | let mut deser = protocol
|
321 + | .deserialize_response(response, ListScheduledQueries::OUTPUT_SCHEMA, _cfg)
|
322 + | .map_err(|e| {
|
323 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
324 + | })?;
|
325 + | let body = response.body().bytes().expect("body loaded");
|
326 + | let output = crate::operation::list_scheduled_queries::ListScheduledQueriesOutput::deserialize_with_response(
|
327 + | &mut *deser,
|
328 + | response.headers(),
|
329 + | response.status().into(),
|
330 + | body,
|
331 + | )
|
332 + | .map_err(|e| {
|
333 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
334 + | })?;
|
335 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
336 + | }
|
170 337 | }
|
171 338 | }
|
172 339 | #[derive(Debug)]
|
173 340 | struct ListScheduledQueriesRequestSerializer;
|
174 341 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListScheduledQueriesRequestSerializer {
|
175 342 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
176 343 | fn serialize_input(
|
177 344 | &self,
|
178 345 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
179 346 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
180 347 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
181 348 | let input = input
|
182 349 | .downcast::<crate::operation::list_scheduled_queries::ListScheduledQueriesInput>()
|
183 350 | .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::list_scheduled_queries::ListScheduledQueriesInput,
|
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::list_scheduled_queries::ListScheduledQueriesInput,
|
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.0");
|
209 - | builder = _header_serialization_settings.set_default_header(
|
210 - | builder,
|
211 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
212 - | "Timestream_20181101.ListScheduledQueries",
|
213 - | );
|
214 - | builder
|
215 - | };
|
216 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_list_scheduled_queries::ser_list_scheduled_queries_input(
|
217 - | &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())
|
351 + | let protocol = _cfg
|
352 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
353 + | .expect("a SharedClientProtocol is required");
|
354 + | let mut request = protocol
|
355 + | .serialize_request(&input, ListScheduledQueries::INPUT_SCHEMA, "", _cfg)
|
356 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
357 + |
|
358 + | return ::std::result::Result::Ok(request);
|
224 359 | }
|
225 360 | }
|
226 361 | #[derive(Debug)]
|
227 362 | struct ListScheduledQueriesEndpointParamsInterceptor;
|
228 363 |
|
229 364 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListScheduledQueriesEndpointParamsInterceptor {
|
230 365 | fn name(&self) -> &'static str {
|
231 366 | "ListScheduledQueriesEndpointParamsInterceptor"
|
232 367 | }
|
233 368 |
|