public ProgressEvent handleRequest()

in aws-batch-schedulingpolicy/src/main/java/software/amazon/batch/schedulingpolicy/UpdateHandler.java [26:56]


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

        logger.log("Update handler for SchedulingPolicy invoked.");

        if (this.client == null) {
            this.client = ClientBuilder.getClient();
        }

        final ResourceModel model = request.getDesiredResourceState();
        logger.log("SchedulingPolicy model for update request: " + model.toString());

        try {
            UpdateSchedulingPolicyResponse updateSchedulingPolicyResponse =
                    proxy.injectCredentialsAndInvokeV2(Translator.toUpdateSchedulingPolicyRequest(model),
                            this.client::updateSchedulingPolicy);

            TagUtils.handleTagging(model, request.getDesiredResourceTags(),
                    request.getPreviousResourceTags(), proxy, this.client, logger);

            logger.log(String.format("%s [%s] updated successfully", ResourceModel.TYPE_NAME, model.getArn()));
            logger.log("Update scheduling policy final result: " + updateSchedulingPolicyResponse.toString());
        } catch (final BatchException e) {
            Exceptions.handleBatchExceptions(request, callbackContext, e);
        }

        return ProgressEvent.defaultSuccessHandler(model);
    }