144 150 | crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigError,
|
145 151 | >::new());
|
146 152 |
|
147 153 | ::std::borrow::Cow::Owned(rcb)
|
148 154 | }
|
149 155 | }
|
150 156 |
|
151 157 | #[derive(Debug)]
|
152 158 | struct DeleteFunctionCodeSigningConfigResponseDeserializer;
|
153 159 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteFunctionCodeSigningConfigResponseDeserializer {
|
154 - | fn deserialize_nonstreaming(
|
160 + | fn deserialize_nonstreaming_with_config(
|
155 161 | &self,
|
156 162 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
163 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
157 164 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
158 165 | 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 166 | #[allow(unused_mut)]
|
162 167 | let mut force_error = false;
|
163 168 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
164 - | let parse_result = if !success && status != 204 || force_error {
|
165 - | crate::protocol_serde::shape_delete_function_code_signing_config::de_delete_function_code_signing_config_http_error(status, headers, body)
|
166 - | } else {
|
167 - | crate::protocol_serde::shape_delete_function_code_signing_config::de_delete_function_code_signing_config_http_response(
|
168 - | status, headers, body,
|
169 + | if !success && status != 204 || force_error {
|
170 + | let headers = response.headers();
|
171 + | let body = response.body().bytes().expect("body loaded");
|
172 + | #[allow(unused_mut)]
|
173 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
174 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
175 + | })?;
|
176 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
177 + | let generic = generic_builder.build();
|
178 + | let error_code = match generic.code() {
|
179 + | ::std::option::Option::Some(code) => code,
|
180 + | ::std::option::Option::None => {
|
181 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
182 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
183 + | crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigError::unhandled(generic),
|
184 + | ),
|
185 + | ))
|
186 + | }
|
187 + | };
|
188 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
189 + | let protocol = _cfg
|
190 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
191 + | .expect("a SharedClientProtocol is required");
|
192 + | let err = match error_code {
|
193 + | "CodeSigningConfigNotFoundException" => {
|
194 + | crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigError::CodeSigningConfigNotFoundException({
|
195 + | let mut tmp = match protocol
|
196 + | .deserialize_response(response, crate::types::error::CodeSigningConfigNotFoundException::SCHEMA, _cfg)
|
197 + | .and_then(|mut deser| {
|
198 + | crate::types::error::CodeSigningConfigNotFoundException::deserialize_with_response(
|
199 + | &mut *deser,
|
200 + | response.headers(),
|
201 + | response.status().into(),
|
202 + | body,
|
203 + | )
|
204 + | }) {
|
205 + | ::std::result::Result::Ok(val) => val,
|
206 + | ::std::result::Result::Err(e) => {
|
207 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
208 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
209 + | ))
|
210 + | }
|
211 + | };
|
212 + | tmp.meta = generic;
|
213 + | if tmp.message.is_none() {
|
214 + | tmp.message = _error_message;
|
215 + | }
|
216 + | tmp
|
217 + | })
|
218 + | }
|
219 + | "InvalidParameterValueException" => {
|
220 + | crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigError::InvalidParameterValueException({
|
221 + | let mut tmp = match protocol
|
222 + | .deserialize_response(response, crate::types::error::InvalidParameterValueException::SCHEMA, _cfg)
|
223 + | .and_then(|mut deser| {
|
224 + | crate::types::error::InvalidParameterValueException::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 + | }
|
245 + | "ResourceConflictException" => {
|
246 + | crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigError::ResourceConflictException({
|
247 + | let mut tmp = match protocol
|
248 + | .deserialize_response(response, crate::types::error::ResourceConflictException::SCHEMA, _cfg)
|
249 + | .and_then(|mut deser| {
|
250 + | crate::types::error::ResourceConflictException::deserialize_with_response(
|
251 + | &mut *deser,
|
252 + | response.headers(),
|
253 + | response.status().into(),
|
254 + | body,
|
255 + | )
|
256 + | }) {
|
257 + | ::std::result::Result::Ok(val) => val,
|
258 + | ::std::result::Result::Err(e) => {
|
259 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
260 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
261 + | ))
|
262 + | }
|
263 + | };
|
264 + | tmp.meta = generic;
|
265 + | if tmp.message.is_none() {
|
266 + | tmp.message = _error_message;
|
267 + | }
|
268 + | tmp
|
269 + | })
|
270 + | }
|
271 + | "ResourceNotFoundException" => {
|
272 + | crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigError::ResourceNotFoundException({
|
273 + | let mut tmp = match protocol
|
274 + | .deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
|
275 + | .and_then(|mut deser| {
|
276 + | crate::types::error::ResourceNotFoundException::deserialize_with_response(
|
277 + | &mut *deser,
|
278 + | response.headers(),
|
279 + | response.status().into(),
|
280 + | body,
|
281 + | )
|
282 + | }) {
|
283 + | ::std::result::Result::Ok(val) => val,
|
284 + | ::std::result::Result::Err(e) => {
|
285 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
286 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
287 + | ))
|
288 + | }
|
289 + | };
|
290 + | tmp.meta = generic;
|
291 + | if tmp.message.is_none() {
|
292 + | tmp.message = _error_message;
|
293 + | }
|
294 + | tmp
|
295 + | })
|
296 + | }
|
297 + | "ServiceException" => {
|
298 + | crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigError::ServiceException({
|
299 + | let mut tmp = match protocol
|
300 + | .deserialize_response(response, crate::types::error::ServiceException::SCHEMA, _cfg)
|
301 + | .and_then(|mut deser| {
|
302 + | crate::types::error::ServiceException::deserialize_with_response(
|
303 + | &mut *deser,
|
304 + | response.headers(),
|
305 + | response.status().into(),
|
306 + | body,
|
307 + | )
|
308 + | }) {
|
309 + | ::std::result::Result::Ok(val) => val,
|
310 + | ::std::result::Result::Err(e) => {
|
311 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
312 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
313 + | ))
|
314 + | }
|
315 + | };
|
316 + | tmp.meta = generic;
|
317 + | if tmp.message.is_none() {
|
318 + | tmp.message = _error_message;
|
319 + | }
|
320 + | tmp
|
321 + | })
|
322 + | }
|
323 + | "TooManyRequestsException" => {
|
324 + | crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigError::TooManyRequestsException({
|
325 + | let mut tmp = match protocol
|
326 + | .deserialize_response(response, crate::types::error::TooManyRequestsException::SCHEMA, _cfg)
|
327 + | .and_then(|mut deser| {
|
328 + | crate::types::error::TooManyRequestsException::deserialize_with_response(
|
329 + | &mut *deser,
|
330 + | response.headers(),
|
331 + | response.status().into(),
|
332 + | body,
|
169 333 | )
|
334 + | }) {
|
335 + | ::std::result::Result::Ok(val) => val,
|
336 + | ::std::result::Result::Err(e) => {
|
337 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
338 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
339 + | ))
|
340 + | }
|
341 + | };
|
342 + | tmp.meta = generic;
|
343 + | if tmp.message.is_none() {
|
344 + | tmp.message = _error_message;
|
345 + | }
|
346 + | tmp
|
347 + | })
|
348 + | }
|
349 + | _ => crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigError::generic(generic),
|
170 350 | };
|
171 - | crate::protocol_serde::type_erase_result(parse_result)
|
351 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
352 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
353 + | ))
|
354 + | } else {
|
355 + | let protocol = _cfg
|
356 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
357 + | .expect("a SharedClientProtocol is required");
|
358 + | let mut deser = protocol
|
359 + | .deserialize_response(response, DeleteFunctionCodeSigningConfig::OUTPUT_SCHEMA, _cfg)
|
360 + | .map_err(|e| {
|
361 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
362 + | })?;
|
363 + | let body = response.body().bytes().expect("body loaded");
|
364 + | let output = crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigOutput::deserialize_with_response(
|
365 + | &mut *deser,
|
366 + | response.headers(),
|
367 + | response.status().into(),
|
368 + | body,
|
369 + | )
|
370 + | .map_err(|e| {
|
371 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
372 + | })?;
|
373 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
374 + | }
|
172 375 | }
|
173 376 | }
|
174 377 | #[derive(Debug)]
|
175 378 | struct DeleteFunctionCodeSigningConfigRequestSerializer;
|
176 379 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DeleteFunctionCodeSigningConfigRequestSerializer {
|
177 380 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
178 381 | fn serialize_input(
|
179 382 | &self,
|
180 383 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
181 384 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
182 385 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
183 386 | let input = input
|
184 387 | .downcast::<crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigInput>()
|
185 388 | .expect("correct type");
|
186 - | let _header_serialization_settings = _cfg
|
187 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
188 - | .cloned()
|
189 - | .unwrap_or_default();
|
190 - | let mut request_builder = {
|
191 - | #[allow(clippy::uninlined_format_args)]
|
192 - | fn uri_base(
|
193 - | _input: &crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigInput,
|
194 - | output: &mut ::std::string::String,
|
195 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
196 - | use ::std::fmt::Write as _;
|
197 - | let input_1 = &_input.function_name;
|
198 - | let input_1 = input_1
|
199 - | .as_ref()
|
200 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?;
|
201 - | let function_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
|
202 - | if function_name.is_empty() {
|
203 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
204 - | "function_name",
|
205 - | "cannot be empty or unset",
|
206 - | ));
|
207 - | }
|
208 - | ::std::write!(
|
209 - | output,
|
210 - | "/2020-06-30/functions/{FunctionName}/code-signing-config",
|
211 - | FunctionName = function_name
|
212 - | )
|
213 - | .expect("formatting should succeed");
|
214 - | ::std::result::Result::Ok(())
|
215 - | }
|
216 - | #[allow(clippy::unnecessary_wraps)]
|
217 - | fn update_http_builder(
|
218 - | input: &crate::operation::delete_function_code_signing_config::DeleteFunctionCodeSigningConfigInput,
|
219 - | builder: ::http_1x::request::Builder,
|
220 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
221 - | let mut uri = ::std::string::String::new();
|
222 - | uri_base(input, &mut uri)?;
|
223 - | ::std::result::Result::Ok(builder.method("DELETE").uri(uri))
|
224 - | }
|
225 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
226 - | builder
|
227 - | };
|
228 - | let body = ::aws_smithy_types::body::SdkBody::from("");
|
389 + | let protocol = _cfg
|
390 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
391 + | .expect("a SharedClientProtocol is required");
|
392 + | let mut request = protocol
|
393 + | .serialize_request(&input, DeleteFunctionCodeSigningConfig::INPUT_SCHEMA, "", _cfg)
|
394 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
229 395 |
|
230 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
396 + | return ::std::result::Result::Ok(request);
|
231 397 | }
|
232 398 | }
|
233 399 | #[derive(Debug)]
|
234 400 | struct DeleteFunctionCodeSigningConfigEndpointParamsInterceptor;
|
235 401 |
|
236 402 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteFunctionCodeSigningConfigEndpointParamsInterceptor {
|
237 403 | fn name(&self) -> &'static str {
|
238 404 | "DeleteFunctionCodeSigningConfigEndpointParamsInterceptor"
|
239 405 | }
|
240 406 |
|