in aws-customerprofiles-integration/src/main/java/software/amazon/customerprofiles/integration/DeleteHandler.java [30:67]
public ProgressEvent<ResourceModel, CallbackContext> handleRequest(
final AmazonWebServicesClientProxy proxy,
final ResourceHandlerRequest<ResourceModel> request,
final CallbackContext callbackContext,
final Logger logger) {
if (this.client == null) {
this.client = ClientBuilder.getClient();
}
final ResourceModel model = request.getDesiredResourceState();
final DeleteIntegrationRequest deleteIntegrationRequest = DeleteIntegrationRequest.builder()
.domainName(model.getDomainName())
.uri(model.getUri())
.build();
final DeleteIntegrationResponse deleteIntegrationResponse;
try {
deleteIntegrationResponse = proxy.injectCredentialsAndInvokeV2(deleteIntegrationRequest, client::deleteIntegration);
logger.log(String.format("Integration deleted with domainName = %s, uri = %s",
model.getDomainName(), model.getUri()));
} catch (BadRequestException e) {
throw new CfnInvalidRequestException(e);
} catch (InternalServerException e) {
throw new CfnServiceInternalErrorException(e);
} catch (ResourceNotFoundException e) {
throw new CfnNotFoundException(e);
} catch (Exception e) {
throw new CfnGeneralServiceException(e);
}
return ProgressEvent.<ResourceModel, CallbackContext>builder()
.resourceModel(null)
.status(OperationStatus.SUCCESS)
.message(deleteIntegrationResponse.message())
.build();
}