diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPreTokenGenerationEventV2.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPreTokenGenerationEventV2.java new file mode 100644 index 00000000..c7250570 --- /dev/null +++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPreTokenGenerationEventV2.java @@ -0,0 +1,134 @@ +/* Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. */ + +package com.amazonaws.services.lambda.runtime.events; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.ToString; + +import java.util.Map; + +/** + * Represent the class for the Cognito User Pool Pre Token Generation Lambda Trigger V2 + *
+ * See Pre Token Generation Lambda Trigger
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@ToString(callSuper = true)
+public class CognitoUserPoolPreTokenGenerationEventV2 extends CognitoUserPoolEvent {
+ /**
+ * The request from the Amazon Cognito service.
+ */
+ private Request request;
+
+ /**
+ * The response from your Lambda trigger.
+ */
+ private Response response;
+
+ @Builder(setterPrefix = "with")
+ public CognitoUserPoolPreTokenGenerationEventV2(
+ String version,
+ String triggerSource,
+ String region,
+ String userPoolId,
+ String userName,
+ CallerContext callerContext,
+ Request request,
+ Response response) {
+ super(version, triggerSource, region, userPoolId, userName, callerContext);
+ this.request = request;
+ this.response = response;
+ }
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ @NoArgsConstructor
+ @ToString(callSuper = true)
+ public static class Request extends CognitoUserPoolEvent.Request {
+
+ private String[] scopes;
+ private GroupConfiguration groupConfiguration;
+ private Map