public ProgressEvent handleRequest()

in aws-logs-resourcepolicy/src/main/java/software/amazon/logs/resourcepolicy/DeleteHandler.java [18:38]


    public ProgressEvent<ResourceModel, CallbackContext> handleRequest(
        final AmazonWebServicesClientProxy proxy,
        final ResourceHandlerRequest<ResourceModel> request,
        final CallbackContext callbackContext,
        final Logger logger) {

        final ResourceModel model = request.getDesiredResourceState();

        DeleteResourcePolicyResponse deleteResourcePolicyResponse;
        try {
            proxy.injectCredentialsAndInvokeV2(Translator.translateToDeleteRequest(model), ClientBuilder.getLogsClient()::deleteResourcePolicy);
        } catch (InvalidParameterException ex) {
            throw new CfnInvalidRequestException(ResourceModel.TYPE_NAME, ex);
        } catch (ResourceNotFoundException ex) {
            throw new CfnNotFoundException(ResourceModel.TYPE_NAME, model.getPrimaryIdentifier().toString());
        } catch (ServiceUnavailableException ex) {
            throw new CfnServiceInternalErrorException(ResourceModel.TYPE_NAME, ex);
        }
        logger.log(String.format("%s [%s] successfully deleted.", ResourceModel.TYPE_NAME, model.getPolicyName()));
        return ProgressEvent.defaultSuccessHandler(null);
    }