in aws-timestream-database/src/main/java/software/amazon/timestream/database/DeleteHandler.java [39:71]
public ProgressEvent<ResourceModel, CallbackContext> handleRequest(
final AmazonWebServicesClientProxy proxy,
final ResourceHandlerRequest<ResourceModel> request,
final CallbackContext callbackContext,
final Logger logger) {
timestreamClient = TimestreamClientFactory.get(proxy, logger);
this.proxy = proxy;
final ResourceModel model = request.getDesiredResourceState();
final DeleteDatabaseRequest deleteDatabaseRequest =
new DeleteDatabaseRequest().withDatabaseName(model.getDatabaseName());
try {
this.proxy.injectCredentialsAndInvoke(deleteDatabaseRequest, timestreamClient::deleteDatabase);
} catch (final ResourceNotFoundException ex) {
throw new CfnNotFoundException(ResourceModel.TYPE_NAME, model.getDatabaseName(), ex);
} catch (ConflictException ex) {
throw new CfnResourceConflictException(ResourceModel.TYPE_NAME, model.getDatabaseName(), CONFLICT_REASON, ex);
} catch (ValidationException | InvalidEndpointException ex) {
throw new CfnInvalidRequestException(request.toString(), ex);
} catch(InternalServerException ex) {
throw new CfnInternalFailureException(ex);
} catch (ThrottlingException ex) {
throw new CfnThrottlingException(DELETE_DATABASE, ex);
} catch (AccessDeniedException ex) {
throw new CfnAccessDeniedException(DELETE_DATABASE, ex);
}
return ProgressEvent.<ResourceModel, CallbackContext>builder()
.status(OperationStatus.SUCCESS)
.build();
}