claimsToAddOrOverride;
+ /**
+ * A list that contains claims to be suppressed from the identity token.
+ */
+ private String[] claimsToSuppress;
+ /**
+ * The output object containing the current group configuration.
+ */
+ private GroupConfiguration groupOverrideDetails;
+ }
+}
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 000000000..9faeb9704
--- /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 clientMetadata;
+
+ @Builder(setterPrefix = "with")
+ public Request(Map userAttributes, String[] scopes, GroupConfiguration groupConfiguration, Map clientMetadata) {
+ super(userAttributes);
+ this.scopes = scopes;
+ this.groupConfiguration = groupConfiguration;
+ this.clientMetadata = clientMetadata;
+ }
+ }
+
+ @Data
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ public static class GroupConfiguration {
+ /**
+ * A list of the group names that are associated with the user that the identity token is issued for.
+ */
+ private String[] groupsToOverride;
+ /**
+ * A list of the current IAM roles associated with these groups.
+ */
+ private String[] iamRolesToOverride;
+ /**
+ * Indicates the preferred IAM role.
+ */
+ private String preferredRole;
+ }
+
+ @Data
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ public static class Response {
+ private ClaimsAndScopeOverrideDetails claimsAndScopeOverrideDetails;
+ }
+
+ @Data
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ public static class ClaimsAndScopeOverrideDetails {
+ private IdTokenGeneration idTokenGeneration;
+ private AccessTokenGeneration accessTokenGeneration;
+ private GroupOverrideDetails groupOverrideDetails;
+ }
+
+ @Data
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ public static class IdTokenGeneration {
+ private Map claimsToAddOrOverride;
+ private String[] claimsToSuppress;
+ }
+
+ @Data
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ public static class AccessTokenGeneration {
+ private Map claimsToAddOrOverride;
+ private String[] claimsToSuppress;
+ private String[] scopesToAdd;
+ private String[] scopesToSuppress;
+ }
+
+ @Data
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ public static class GroupOverrideDetails {
+ private String[] groupsToOverride;
+ private String[] iamRolesToOverride;
+ private String preferredRole;
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolVerifyAuthChallengeResponseEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolVerifyAuthChallengeResponseEvent.java
new file mode 100644
index 000000000..982ff72fd
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolVerifyAuthChallengeResponseEvent.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
+ * the License. A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+package com.amazonaws.services.lambda.runtime.events;
+
+import lombok.*;
+
+import java.util.Map;
+
+/**
+ * Represent the class for the Cognito User Pool Verify Auth Challenge Response Lambda Trigger
+ *
+ * See Verify Auth Challenge Response Lambda Trigger
+ *
+ * @author jvdl
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@ToString(callSuper = true)
+public class CognitoUserPoolVerifyAuthChallengeResponseEvent 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 CognitoUserPoolVerifyAuthChallengeResponseEvent(
+ 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 {
+ /**
+ * One or more key-value pairs that you can provide as custom input to the Lambda function that you specify for the verify auth challenge trigger.
+ */
+ private Map clientMetadata;
+ /**
+ * This parameter comes from the Create Auth Challenge trigger, and is compared against a user's challengeAnswer to determine whether the user passed the challenge.
+ */
+ private Map privateChallengeParameters;
+ /**
+ * The answer from the user's response to the challenge.
+ */
+ private String challengeAnswer;
+ /**
+ * This boolean is populated when PreventUserExistenceErrors is set to ENABLED for your User Pool client
+ */
+ private boolean userNotFound;
+
+ @Builder(setterPrefix = "with")
+ public Request(Map userAttributes,
+ Map clientMetadata,
+ String challengeAnswer,
+ Map privateChallengeParameters,
+ boolean userNotFound) {
+ super(userAttributes);
+ this.clientMetadata = clientMetadata;
+ this.userNotFound = userNotFound;
+ this.challengeAnswer = challengeAnswer;
+ this.privateChallengeParameters = privateChallengeParameters;
+ }
+ }
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class Response {
+ /**
+ * Set to true if the user has successfully completed the challenge, or false otherwise.
+ */
+ private boolean answerCorrect;
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ConnectEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ConnectEvent.java
index 38547ac2a..e94875614 100644
--- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ConnectEvent.java
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ConnectEvent.java
@@ -59,7 +59,7 @@ public static class ContactData implements Serializable, Cloneable {
private String initiationMethod;
private String instanceArn;
private String previousContactId;
- private String queue;
+ private Queue queue;
private SystemEndpoint systemEndpoint;
}
@@ -80,4 +80,13 @@ public static class SystemEndpoint implements Serializable, Cloneable {
private String address;
private String type;
}
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class Queue implements Serializable, Cloneable {
+ private String name;
+ private String ARN;
+ }
+
}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/IamPolicyResponse.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/IamPolicyResponse.java
new file mode 100644
index 000000000..e8d3b13d9
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/IamPolicyResponse.java
@@ -0,0 +1,92 @@
+package com.amazonaws.services.lambda.runtime.events;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The IAM Policy Response required for API Gateway HTTP APIs
+ *
+ * https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html
+ *
+ */
+
+@Data
+@Builder(setterPrefix = "with")
+@NoArgsConstructor
+@AllArgsConstructor
+public class IamPolicyResponse implements Serializable, Cloneable {
+
+ public static final String EXECUTE_API_INVOKE = "execute-api:Invoke";
+ public static final String VERSION_2012_10_17 = "2012-10-17";
+ public static final String ALLOW = "Allow";
+ public static final String DENY = "Deny";
+
+ private String principalId;
+ private PolicyDocument policyDocument;
+ private Map context;
+
+ public Map getPolicyDocument() {
+ Map serializablePolicy = new HashMap<>();
+ serializablePolicy.put("Version", policyDocument.getVersion());
+
+ int numberOfStatements = policyDocument.getStatement().size();
+ Map[] serializableStatementArray = new Map[numberOfStatements];
+ for (int i = 0; i < numberOfStatements; i++) {
+ Statement statement = policyDocument.getStatement().get(i);
+ Map serializableStatement = new HashMap<>();
+ serializableStatement.put("Effect", statement.getEffect());
+ serializableStatement.put("Action", statement.getAction());
+ serializableStatement.put("Resource", statement.getResource().toArray(new String[0]));
+ serializableStatement.put("Condition", statement.getCondition());
+ serializableStatementArray[i] = serializableStatement;
+ }
+ serializablePolicy.put("Statement", serializableStatementArray);
+ return serializablePolicy;
+ }
+
+ public static Statement allowStatement(String resource) {
+ return Statement.builder()
+ .withEffect(ALLOW)
+ .withResource(Collections.singletonList(resource))
+ .withAction(EXECUTE_API_INVOKE)
+ .build();
+ }
+
+ public static Statement denyStatement(String resource) {
+ return Statement.builder()
+ .withEffect(DENY)
+ .withResource(Collections.singletonList(resource))
+ .withAction(EXECUTE_API_INVOKE)
+ .build();
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class PolicyDocument implements Serializable, Cloneable {
+
+ private String version;
+ private List statement;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class Statement implements Serializable, Cloneable {
+
+ private String action;
+ private String effect;
+ private List resource;
+ private Map> condition;
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/IamPolicyResponseV1.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/IamPolicyResponseV1.java
new file mode 100644
index 000000000..a4316536f
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/IamPolicyResponseV1.java
@@ -0,0 +1,93 @@
+package com.amazonaws.services.lambda.runtime.events;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The IAM Policy Response required for API Gateway REST APIs
+ *
+ * https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html
+ *
+ */
+
+@Data
+@Builder(setterPrefix = "with")
+@NoArgsConstructor
+@AllArgsConstructor
+public class IamPolicyResponseV1 implements Serializable, Cloneable {
+
+ public static final String EXECUTE_API_INVOKE = "execute-api:Invoke";
+ public static final String VERSION_2012_10_17 = "2012-10-17";
+ public static final String ALLOW = "Allow";
+ public static final String DENY = "Deny";
+
+ private String principalId;
+ private PolicyDocument policyDocument;
+ private Map context;
+ private String usageIdentifierKey;
+
+ public Map getPolicyDocument() {
+ Map serializablePolicy = new HashMap<>();
+ serializablePolicy.put("Version", policyDocument.getVersion());
+
+ int numberOfStatements = policyDocument.getStatement().size();
+ Map[] serializableStatementArray = new Map[numberOfStatements];
+ for (int i = 0; i < numberOfStatements; i++) {
+ Statement statement = policyDocument.getStatement().get(i);
+ Map serializableStatement = new HashMap<>();
+ serializableStatement.put("Effect", statement.getEffect());
+ serializableStatement.put("Action", statement.getAction());
+ serializableStatement.put("Resource", statement.getResource().toArray(new String[0]));
+ serializableStatement.put("Condition", statement.getCondition());
+ serializableStatementArray[i] = serializableStatement;
+ }
+ serializablePolicy.put("Statement", serializableStatementArray);
+ return serializablePolicy;
+ }
+
+ public static Statement allowStatement(String resource) {
+ return Statement.builder()
+ .withEffect(ALLOW)
+ .withResource(Collections.singletonList(resource))
+ .withAction(EXECUTE_API_INVOKE)
+ .build();
+ }
+
+ public static Statement denyStatement(String resource) {
+ return Statement.builder()
+ .withEffect(DENY)
+ .withResource(Collections.singletonList(resource))
+ .withAction(EXECUTE_API_INVOKE)
+ .build();
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class PolicyDocument implements Serializable, Cloneable {
+
+ private String version;
+ private List statement;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class Statement implements Serializable, Cloneable {
+
+ private String action;
+ private String effect;
+ private List resource;
+ private Map> condition;
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/KafkaEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/KafkaEvent.java
index ed5c2ac84..aa6c00de3 100644
--- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/KafkaEvent.java
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/KafkaEvent.java
@@ -26,8 +26,9 @@
/** Represents a Kafka Event. **/
public class KafkaEvent {
private Map> records;
- private String eventSource;
+ private String eventSource;
private String eventSourceArn;
+ private String bootstrapServers;
@Data
@NoArgsConstructor
@@ -41,6 +42,9 @@ public static class KafkaEventRecord {
private String timestampType;
private String key;
private String value;
+ private List