File tree Expand file tree Collapse file tree 2 files changed +57
-1
lines changed
aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events Expand file tree Collapse file tree 2 files changed +57
-1
lines changed Original file line number Diff line number Diff line change
1
+ package com .amazonaws .services .lambda .runtime .events ;
2
+
3
+ import lombok .AllArgsConstructor ;
4
+ import lombok .Builder ;
5
+ import lombok .Data ;
6
+ import lombok .NoArgsConstructor ;
7
+
8
+ import java .util .List ;
9
+ import java .util .Map ;
10
+
11
+ /**
12
+ * Event to represent the payload which is sent to Lambda by S3 Batch to perform a custom
13
+ * action when using invocation schema version 2.0.
14
+ *
15
+ * https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-invoke-lambda.html
16
+ */
17
+
18
+ @ Data
19
+ @ Builder (setterPrefix = "with" )
20
+ @ NoArgsConstructor
21
+ @ AllArgsConstructor
22
+ public class S3BatchEventV2 {
23
+
24
+ private String invocationSchemaVersion ;
25
+ private String invocationId ;
26
+ private Job job ;
27
+ private List <Task > tasks ;
28
+
29
+ @ Data
30
+ @ Builder (setterPrefix = "with" )
31
+ @ NoArgsConstructor
32
+ @ AllArgsConstructor
33
+ public static class Job {
34
+
35
+ private String id ;
36
+ private Map <String , String > userArguments ;
37
+ }
38
+
39
+ @ Data
40
+ @ Builder (setterPrefix = "with" )
41
+ @ NoArgsConstructor
42
+ @ AllArgsConstructor
43
+ public static class Task {
44
+
45
+ private String taskId ;
46
+ private String s3Key ;
47
+ private String s3VersionId ;
48
+ private String s3BucketName ;
49
+ }
50
+ }
Original file line number Diff line number Diff line change @@ -62,4 +62,10 @@ public static S3BatchResponseBuilder fromS3BatchEvent(S3BatchEvent s3BatchEvent)
62
62
.withInvocationId (s3BatchEvent .getInvocationId ())
63
63
.withInvocationSchemaVersion (s3BatchEvent .getInvocationSchemaVersion ());
64
64
}
65
- }
65
+
66
+ public static S3BatchResponseBuilder fromS3BatchEvent (S3BatchEventV2 s3BatchEvent ) {
67
+ return S3BatchResponse .builder ()
68
+ .withInvocationId (s3BatchEvent .getInvocationId ())
69
+ .withInvocationSchemaVersion (s3BatchEvent .getInvocationSchemaVersion ());
70
+ }
71
+ }
You can’t perform that action at this time.
0 commit comments