130 134 | ::std::borrow::Cow::Owned(rcb)
|
131 135 | }
|
132 136 | }
|
133 137 |
|
134 138 | #[derive(Debug)]
|
135 139 | struct VerifyResponseDeserializer;
|
136 140 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for VerifyResponseDeserializer {
|
137 141 | fn deserialize_nonstreaming(
|
138 142 | &self,
|
139 143 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
144 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
140 145 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
141 146 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
142 - | let headers = response.headers();
|
143 - | let body = response.body().bytes().expect("body loaded");
|
144 147 | #[allow(unused_mut)]
|
145 148 | let mut force_error = false;
|
146 149 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
147 - | let parse_result = if !success && status != 200 || force_error {
|
148 - | crate::protocol_serde::shape_verify::de_verify_http_error(status, headers, body)
|
150 + | if !success && status != 200 || force_error {
|
151 + | let headers = response.headers();
|
152 + | let body = response.body().bytes().expect("body loaded");
|
153 + | #[allow(unused_mut)]
|
154 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
155 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
156 + | })?;
|
157 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
158 + | let generic = generic_builder.build();
|
159 + | let error_code = match generic.code() {
|
160 + | ::std::option::Option::Some(code) => code,
|
161 + | ::std::option::Option::None => {
|
162 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
163 + | ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::verify::VerifyError::unhandled(generic)),
|
164 + | ))
|
165 + | }
|
166 + | };
|
167 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
168 + | let protocol = _cfg
|
169 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
170 + | .expect("a SharedClientProtocol is required");
|
171 + | let err = match error_code {
|
172 + | "DependencyTimeoutException" => crate::operation::verify::VerifyError::DependencyTimeoutException({
|
173 + | let mut tmp = match protocol
|
174 + | .deserialize_response(response, crate::types::error::DependencyTimeoutException::SCHEMA, _cfg)
|
175 + | .and_then(|mut deser| {
|
176 + | crate::types::error::DependencyTimeoutException::deserialize_with_response(
|
177 + | &mut *deser,
|
178 + | response.headers(),
|
179 + | response.status().into(),
|
180 + | body,
|
181 + | )
|
182 + | }) {
|
183 + | ::std::result::Result::Ok(val) => val,
|
184 + | ::std::result::Result::Err(e) => {
|
185 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
186 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
187 + | ))
|
188 + | }
|
189 + | };
|
190 + | tmp.meta = generic;
|
191 + | if tmp.message.is_none() {
|
192 + | tmp.message = _error_message;
|
193 + | }
|
194 + | tmp
|
195 + | }),
|
196 + | "DisabledException" => crate::operation::verify::VerifyError::DisabledException({
|
197 + | let mut tmp = match protocol
|
198 + | .deserialize_response(response, crate::types::error::DisabledException::SCHEMA, _cfg)
|
199 + | .and_then(|mut deser| {
|
200 + | crate::types::error::DisabledException::deserialize_with_response(
|
201 + | &mut *deser,
|
202 + | response.headers(),
|
203 + | response.status().into(),
|
204 + | body,
|
205 + | )
|
206 + | }) {
|
207 + | ::std::result::Result::Ok(val) => val,
|
208 + | ::std::result::Result::Err(e) => {
|
209 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
210 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
211 + | ))
|
212 + | }
|
213 + | };
|
214 + | tmp.meta = generic;
|
215 + | if tmp.message.is_none() {
|
216 + | tmp.message = _error_message;
|
217 + | }
|
218 + | tmp
|
219 + | }),
|
220 + | "DryRunOperationException" => crate::operation::verify::VerifyError::DryRunOperationException({
|
221 + | let mut tmp = match protocol
|
222 + | .deserialize_response(response, crate::types::error::DryRunOperationException::SCHEMA, _cfg)
|
223 + | .and_then(|mut deser| {
|
224 + | crate::types::error::DryRunOperationException::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 + | "InvalidGrantTokenException" => crate::operation::verify::VerifyError::InvalidGrantTokenException({
|
245 + | let mut tmp = match protocol
|
246 + | .deserialize_response(response, crate::types::error::InvalidGrantTokenException::SCHEMA, _cfg)
|
247 + | .and_then(|mut deser| {
|
248 + | crate::types::error::InvalidGrantTokenException::deserialize_with_response(
|
249 + | &mut *deser,
|
250 + | response.headers(),
|
251 + | response.status().into(),
|
252 + | body,
|
253 + | )
|
254 + | }) {
|
255 + | ::std::result::Result::Ok(val) => val,
|
256 + | ::std::result::Result::Err(e) => {
|
257 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
258 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
259 + | ))
|
260 + | }
|
261 + | };
|
262 + | tmp.meta = generic;
|
263 + | if tmp.message.is_none() {
|
264 + | tmp.message = _error_message;
|
265 + | }
|
266 + | tmp
|
267 + | }),
|
268 + | "InvalidKeyUsageException" => crate::operation::verify::VerifyError::InvalidKeyUsageException({
|
269 + | let mut tmp = match protocol
|
270 + | .deserialize_response(response, crate::types::error::InvalidKeyUsageException::SCHEMA, _cfg)
|
271 + | .and_then(|mut deser| {
|
272 + | crate::types::error::InvalidKeyUsageException::deserialize_with_response(
|
273 + | &mut *deser,
|
274 + | response.headers(),
|
275 + | response.status().into(),
|
276 + | body,
|
277 + | )
|
278 + | }) {
|
279 + | ::std::result::Result::Ok(val) => val,
|
280 + | ::std::result::Result::Err(e) => {
|
281 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
282 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
283 + | ))
|
284 + | }
|
285 + | };
|
286 + | tmp.meta = generic;
|
287 + | if tmp.message.is_none() {
|
288 + | tmp.message = _error_message;
|
289 + | }
|
290 + | tmp
|
291 + | }),
|
292 + | "KeyUnavailableException" => crate::operation::verify::VerifyError::KeyUnavailableException({
|
293 + | let mut tmp = match protocol
|
294 + | .deserialize_response(response, crate::types::error::KeyUnavailableException::SCHEMA, _cfg)
|
295 + | .and_then(|mut deser| {
|
296 + | crate::types::error::KeyUnavailableException::deserialize_with_response(
|
297 + | &mut *deser,
|
298 + | response.headers(),
|
299 + | response.status().into(),
|
300 + | body,
|
301 + | )
|
302 + | }) {
|
303 + | ::std::result::Result::Ok(val) => val,
|
304 + | ::std::result::Result::Err(e) => {
|
305 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
306 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
307 + | ))
|
308 + | }
|
309 + | };
|
310 + | tmp.meta = generic;
|
311 + | if tmp.message.is_none() {
|
312 + | tmp.message = _error_message;
|
313 + | }
|
314 + | tmp
|
315 + | }),
|
316 + | "KMSInternalException" => crate::operation::verify::VerifyError::KmsInternalException({
|
317 + | let mut tmp = match protocol
|
318 + | .deserialize_response(response, crate::types::error::KmsInternalException::SCHEMA, _cfg)
|
319 + | .and_then(|mut deser| {
|
320 + | crate::types::error::KmsInternalException::deserialize_with_response(
|
321 + | &mut *deser,
|
322 + | response.headers(),
|
323 + | response.status().into(),
|
324 + | body,
|
325 + | )
|
326 + | }) {
|
327 + | ::std::result::Result::Ok(val) => val,
|
328 + | ::std::result::Result::Err(e) => {
|
329 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
330 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
331 + | ))
|
332 + | }
|
333 + | };
|
334 + | tmp.meta = generic;
|
335 + | if tmp.message.is_none() {
|
336 + | tmp.message = _error_message;
|
337 + | }
|
338 + | tmp
|
339 + | }),
|
340 + | "KMSInvalidSignatureException" => crate::operation::verify::VerifyError::KmsInvalidSignatureException({
|
341 + | let mut tmp = match protocol
|
342 + | .deserialize_response(response, crate::types::error::KmsInvalidSignatureException::SCHEMA, _cfg)
|
343 + | .and_then(|mut deser| {
|
344 + | crate::types::error::KmsInvalidSignatureException::deserialize_with_response(
|
345 + | &mut *deser,
|
346 + | response.headers(),
|
347 + | response.status().into(),
|
348 + | body,
|
349 + | )
|
350 + | }) {
|
351 + | ::std::result::Result::Ok(val) => val,
|
352 + | ::std::result::Result::Err(e) => {
|
353 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
354 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
355 + | ))
|
356 + | }
|
357 + | };
|
358 + | tmp.meta = generic;
|
359 + | if tmp.message.is_none() {
|
360 + | tmp.message = _error_message;
|
361 + | }
|
362 + | tmp
|
363 + | }),
|
364 + | "KMSInvalidStateException" => crate::operation::verify::VerifyError::KmsInvalidStateException({
|
365 + | let mut tmp = match protocol
|
366 + | .deserialize_response(response, crate::types::error::KmsInvalidStateException::SCHEMA, _cfg)
|
367 + | .and_then(|mut deser| {
|
368 + | crate::types::error::KmsInvalidStateException::deserialize_with_response(
|
369 + | &mut *deser,
|
370 + | response.headers(),
|
371 + | response.status().into(),
|
372 + | body,
|
373 + | )
|
374 + | }) {
|
375 + | ::std::result::Result::Ok(val) => val,
|
376 + | ::std::result::Result::Err(e) => {
|
377 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
378 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
379 + | ))
|
380 + | }
|
381 + | };
|
382 + | tmp.meta = generic;
|
383 + | if tmp.message.is_none() {
|
384 + | tmp.message = _error_message;
|
385 + | }
|
386 + | tmp
|
387 + | }),
|
388 + | "NotFoundException" => crate::operation::verify::VerifyError::NotFoundException({
|
389 + | let mut tmp = match protocol
|
390 + | .deserialize_response(response, crate::types::error::NotFoundException::SCHEMA, _cfg)
|
391 + | .and_then(|mut deser| {
|
392 + | crate::types::error::NotFoundException::deserialize_with_response(
|
393 + | &mut *deser,
|
394 + | response.headers(),
|
395 + | response.status().into(),
|
396 + | body,
|
397 + | )
|
398 + | }) {
|
399 + | ::std::result::Result::Ok(val) => val,
|
400 + | ::std::result::Result::Err(e) => {
|
401 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
402 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
403 + | ))
|
404 + | }
|
405 + | };
|
406 + | tmp.meta = generic;
|
407 + | if tmp.message.is_none() {
|
408 + | tmp.message = _error_message;
|
409 + | }
|
410 + | tmp
|
411 + | }),
|
412 + | _ => crate::operation::verify::VerifyError::generic(generic),
|
413 + | };
|
414 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
415 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
416 + | ))
|
149 417 | } else {
|
150 - | crate::protocol_serde::shape_verify::de_verify_http_response(status, headers, body)
|
151 - | };
|
152 - | crate::protocol_serde::type_erase_result(parse_result)
|
418 + | let protocol = _cfg
|
419 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
420 + | .expect("a SharedClientProtocol is required");
|
421 + | let mut deser = protocol.deserialize_response(response, Verify::OUTPUT_SCHEMA, _cfg).map_err(|e| {
|
422 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
423 + | })?;
|
424 + | let body = response.body().bytes().expect("body loaded");
|
425 + | let output =
|
426 + | crate::operation::verify::VerifyOutput::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body)
|
427 + | .map_err(|e| {
|
428 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
|
429 + | e,
|
430 + | ))
|
431 + | })?;
|
432 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
433 + | }
|
153 434 | }
|
154 435 | }
|
155 436 | #[derive(Debug)]
|
156 437 | struct VerifyRequestSerializer;
|
157 438 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for VerifyRequestSerializer {
|
158 439 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
159 440 | fn serialize_input(
|
160 441 | &self,
|
161 442 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
162 443 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
163 444 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
164 445 | let input = input.downcast::<crate::operation::verify::VerifyInput>().expect("correct type");
|
165 - | let _header_serialization_settings = _cfg
|
166 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
167 - | .cloned()
|
168 - | .unwrap_or_default();
|
169 - | let mut request_builder = {
|
170 - | #[allow(clippy::uninlined_format_args)]
|
171 - | fn uri_base(
|
172 - | _input: &crate::operation::verify::VerifyInput,
|
173 - | output: &mut ::std::string::String,
|
174 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
175 - | use ::std::fmt::Write as _;
|
176 - | ::std::write!(output, "/").expect("formatting should succeed");
|
177 - | ::std::result::Result::Ok(())
|
178 - | }
|
179 - | #[allow(clippy::unnecessary_wraps)]
|
180 - | fn update_http_builder(
|
181 - | input: &crate::operation::verify::VerifyInput,
|
182 - | builder: ::http_1x::request::Builder,
|
183 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
184 - | let mut uri = ::std::string::String::new();
|
185 - | uri_base(input, &mut uri)?;
|
186 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
187 - | }
|
188 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
189 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
|
190 - | builder = _header_serialization_settings.set_default_header(
|
191 - | builder,
|
192 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
193 - | "TrentService.Verify",
|
194 - | );
|
195 - | builder
|
196 - | };
|
197 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_verify::ser_verify_input(&input)?);
|
198 - | if let Some(content_length) = body.content_length() {
|
199 - | let content_length = content_length.to_string();
|
200 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
201 - | }
|
202 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
446 + | let protocol = _cfg
|
447 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
448 + | .expect("a SharedClientProtocol is required");
|
449 + | let mut request = protocol
|
450 + | .serialize_request(&input, Verify::INPUT_SCHEMA, "", _cfg)
|
451 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
452 + |
|
453 + | return ::std::result::Result::Ok(request);
|
203 454 | }
|
204 455 | }
|
205 456 | #[derive(Debug)]
|
206 457 | struct VerifyEndpointParamsInterceptor;
|
207 458 |
|
208 459 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for VerifyEndpointParamsInterceptor {
|
209 460 | fn name(&self) -> &'static str {
|
210 461 | "VerifyEndpointParamsInterceptor"
|
211 462 | }
|
212 463 |
|