S3 batch by msailes · Pull Request #179 · aws/aws-lambda-java-libs

Since we have the ResultCode enum now, I'm thinking S3BatchOpResponse.treatMissingKeysAs should be of type ResultCode.

private ResultCode treatMissingKeysAs;

The following are ideas that might go too far for this library; let me know what you think.

We could default treatMissingKeysAs to PermanentFailure, as this is likely the value most people will use.

private ResultCode treatMissingKeysAs = ResultCode.PermanentFailure;

We could have a special constructor to seed a response instance. These must be set for the response to be considered valid. If one does not want to use this, they can use the other constructors.

    public S3BatchResponse(final S3BatchEvent request) {
        this.invocationSchemaVersion = request.getInvocationSchemaVersion();
        this.invocationId = request.getInvocationId();
        this.results = Collections.singletonList(
                Result.builder()
                        .withTaskId(request.getTasks().get(0).getTaskId())
                        .build()
        );
    }