141 147 | ::std::borrow::Cow::Owned(rcb)
|
142 148 | }
|
143 149 | }
|
144 150 |
|
145 151 | #[derive(Debug)]
|
146 152 | struct DeleteImportedKeyMaterialResponseDeserializer;
|
147 153 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteImportedKeyMaterialResponseDeserializer {
|
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_delete_imported_key_material::de_delete_imported_key_material_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::delete_imported_key_material::DeleteImportedKeyMaterialError::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 + | "DependencyTimeoutException" => {
|
188 + | crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::DependencyTimeoutException({
|
189 + | let mut tmp = match protocol
|
190 + | .deserialize_response(response, crate::types::error::DependencyTimeoutException::SCHEMA, _cfg)
|
191 + | .and_then(|mut deser| {
|
192 + | crate::types::error::DependencyTimeoutException::deserialize_with_response(
|
193 + | &mut *deser,
|
194 + | response.headers(),
|
195 + | response.status().into(),
|
196 + | body,
|
197 + | )
|
198 + | }) {
|
199 + | ::std::result::Result::Ok(val) => val,
|
200 + | ::std::result::Result::Err(e) => {
|
201 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
202 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
203 + | ))
|
204 + | }
|
205 + | };
|
206 + | tmp.meta = generic;
|
207 + | if tmp.message.is_none() {
|
208 + | tmp.message = _error_message;
|
209 + | }
|
210 + | tmp
|
211 + | })
|
212 + | }
|
213 + | "InvalidArnException" => crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::InvalidArnException({
|
214 + | let mut tmp = match protocol
|
215 + | .deserialize_response(response, crate::types::error::InvalidArnException::SCHEMA, _cfg)
|
216 + | .and_then(|mut deser| {
|
217 + | crate::types::error::InvalidArnException::deserialize_with_response(
|
218 + | &mut *deser,
|
219 + | response.headers(),
|
220 + | response.status().into(),
|
221 + | body,
|
222 + | )
|
223 + | }) {
|
224 + | ::std::result::Result::Ok(val) => val,
|
225 + | ::std::result::Result::Err(e) => {
|
226 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
227 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
228 + | ))
|
229 + | }
|
230 + | };
|
231 + | tmp.meta = generic;
|
232 + | if tmp.message.is_none() {
|
233 + | tmp.message = _error_message;
|
234 + | }
|
235 + | tmp
|
236 + | }),
|
237 + | "KMSInternalException" => crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::KmsInternalException({
|
238 + | let mut tmp = match protocol
|
239 + | .deserialize_response(response, crate::types::error::KmsInternalException::SCHEMA, _cfg)
|
240 + | .and_then(|mut deser| {
|
241 + | crate::types::error::KmsInternalException::deserialize_with_response(
|
242 + | &mut *deser,
|
243 + | response.headers(),
|
244 + | response.status().into(),
|
245 + | body,
|
246 + | )
|
247 + | }) {
|
248 + | ::std::result::Result::Ok(val) => val,
|
249 + | ::std::result::Result::Err(e) => {
|
250 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
251 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
252 + | ))
|
253 + | }
|
254 + | };
|
255 + | tmp.meta = generic;
|
256 + | if tmp.message.is_none() {
|
257 + | tmp.message = _error_message;
|
258 + | }
|
259 + | tmp
|
260 + | }),
|
261 + | "KMSInvalidStateException" => {
|
262 + | crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::KmsInvalidStateException({
|
263 + | let mut tmp = match protocol
|
264 + | .deserialize_response(response, crate::types::error::KmsInvalidStateException::SCHEMA, _cfg)
|
265 + | .and_then(|mut deser| {
|
266 + | crate::types::error::KmsInvalidStateException::deserialize_with_response(
|
267 + | &mut *deser,
|
268 + | response.headers(),
|
269 + | response.status().into(),
|
270 + | body,
|
271 + | )
|
272 + | }) {
|
273 + | ::std::result::Result::Ok(val) => val,
|
274 + | ::std::result::Result::Err(e) => {
|
275 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
276 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
277 + | ))
|
278 + | }
|
279 + | };
|
280 + | tmp.meta = generic;
|
281 + | if tmp.message.is_none() {
|
282 + | tmp.message = _error_message;
|
283 + | }
|
284 + | tmp
|
285 + | })
|
286 + | }
|
287 + | "NotFoundException" => crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::NotFoundException({
|
288 + | let mut tmp = match protocol
|
289 + | .deserialize_response(response, crate::types::error::NotFoundException::SCHEMA, _cfg)
|
290 + | .and_then(|mut deser| {
|
291 + | crate::types::error::NotFoundException::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 + | "UnsupportedOperationException" => {
|
312 + | crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::UnsupportedOperationException({
|
313 + | let mut tmp = match protocol
|
314 + | .deserialize_response(response, crate::types::error::UnsupportedOperationException::SCHEMA, _cfg)
|
315 + | .and_then(|mut deser| {
|
316 + | crate::types::error::UnsupportedOperationException::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 + | }
|
337 + | _ => crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialError::generic(generic),
|
338 + | };
|
339 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
340 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
341 + | ))
|
160 342 | } else {
|
161 - | crate::protocol_serde::shape_delete_imported_key_material::de_delete_imported_key_material_http_response(status, headers, body)
|
162 - | };
|
163 - | crate::protocol_serde::type_erase_result(parse_result)
|
343 + | let protocol = _cfg
|
344 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
345 + | .expect("a SharedClientProtocol is required");
|
346 + | let mut deser = protocol
|
347 + | .deserialize_response(response, DeleteImportedKeyMaterial::OUTPUT_SCHEMA, _cfg)
|
348 + | .map_err(|e| {
|
349 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
350 + | })?;
|
351 + | let body = response.body().bytes().expect("body loaded");
|
352 + | let output = crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialOutput::deserialize_with_response(
|
353 + | &mut *deser,
|
354 + | response.headers(),
|
355 + | response.status().into(),
|
356 + | body,
|
357 + | )
|
358 + | .map_err(|e| {
|
359 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
360 + | })?;
|
361 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
362 + | }
|
164 363 | }
|
165 364 | }
|
166 365 | #[derive(Debug)]
|
167 366 | struct DeleteImportedKeyMaterialRequestSerializer;
|
168 367 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DeleteImportedKeyMaterialRequestSerializer {
|
169 368 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
170 369 | fn serialize_input(
|
171 370 | &self,
|
172 371 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
173 372 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
174 373 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
175 374 | let input = input
|
176 375 | .downcast::<crate::operation::delete_imported_key_material::DeleteImportedKeyMaterialInput>()
|
177 376 | .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::delete_imported_key_material::DeleteImportedKeyMaterialInput,
|
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::delete_imported_key_material::DeleteImportedKeyMaterialInput,
|
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 - | "TrentService.DeleteImportedKeyMaterial",
|
207 - | );
|
208 - | builder
|
209 - | };
|
210 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
211 - | crate::protocol_serde::shape_delete_imported_key_material::ser_delete_imported_key_material_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())
|
377 + | let protocol = _cfg
|
378 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
379 + | .expect("a SharedClientProtocol is required");
|
380 + | let mut request = protocol
|
381 + | .serialize_request(&input, DeleteImportedKeyMaterial::INPUT_SCHEMA, "", _cfg)
|
382 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
383 + |
|
384 + | return ::std::result::Result::Ok(request);
|
218 385 | }
|
219 386 | }
|
220 387 | #[derive(Debug)]
|
221 388 | struct DeleteImportedKeyMaterialEndpointParamsInterceptor;
|
222 389 |
|
223 390 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteImportedKeyMaterialEndpointParamsInterceptor {
|
224 391 | fn name(&self) -> &'static str {
|
225 392 | "DeleteImportedKeyMaterialEndpointParamsInterceptor"
|
226 393 | }
|
227 394 |
|