public ProgressEvent handleRequest()

in aws-wafv2-webaclassociation/src/main/java/com/amazonaws/wafv2/webaclassociation/ReadHandler.java [27:55]


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

        final ResourceModel model = request.getDesiredResourceState();
        log(logger, model, "invoked");
        try {
            final GetWebAclForResourceResponse response = getWebAclAssociationExceptionWrapper(proxy, model).execute();
            log(logger, model, "read successfully");
            // propogate input values to make CFN happy, since these two make up the resource primary key.
            final ResourceModel result = ResourceModel.builder()
                    .resourceArn(model.getResourceArn())
                    .webACLArn(model.getWebACLArn())
                    .build();
            return ProgressEvent.<ResourceModel, CallbackContext>builder()
                    .resourceModel(result)
                    .status(OperationStatus.SUCCESS)
                    .build();
        } catch (RuntimeException e) {
            log(logger, model, String.format("[%s]: %s",  e.getClass().getSimpleName(), e.getMessage()));
            return ProgressEvent.<ResourceModel, CallbackContext>builder()
                    .status(OperationStatus.FAILED)
                    .errorCode(ExceptionTranslationWrapper.translateExceptionIntoErrorCode(e))
                    .message(e.getMessage())
                    .build();
        }
    }