in aws-events-apidestination/src/main/java/software/amazon/events/apidestination/DeleteHandler.java [49:63]
private DeleteApiDestinationResponse deleteResource(DeleteApiDestinationRequest awsRequest, ProxyClient<EventBridgeClient> proxyClient) {
DeleteApiDestinationResponse awsResponse;
try {
awsResponse = proxyClient.injectCredentialsAndInvokeV2(awsRequest, proxyClient.client()::deleteApiDestination);
} catch (final ResourceNotFoundException e) {
// Api destination does not exist
throw new CfnNotFoundException(e);
} catch (final AwsServiceException e) {
throw new CfnGeneralServiceException(ResourceModel.TYPE_NAME, e);
}
logger.log(String.format("%s successfully deleted.", ResourceModel.TYPE_NAME));
return awsResponse;
}