diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index ab40d21d7..d9fdc8b1d 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -2,5 +2,7 @@
*Description of changes:*
+*Target (OCI, Managed Runtime, both):*
+
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 000000000..88f18ea29
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,10 @@
+version: 2
+updates:
+ - package-ecosystem: "maven"
+ directory: "/aws-lambda-java-runtime-interface"
+ schedule:
+ interval: "weekly"
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "weekly"
\ No newline at end of file
diff --git a/.github/workflows/aws-lambda-java-core.yml b/.github/workflows/aws-lambda-java-core.yml
new file mode 100644
index 000000000..b1bed919f
--- /dev/null
+++ b/.github/workflows/aws-lambda-java-core.yml
@@ -0,0 +1,46 @@
+# This workflow will be triggered if there will be changes to aws-lambda-java-core
+# package and it builds the package and the packages that depend on it.
+
+name: Java CI aws-lambda-java-core
+
+on:
+ push:
+ branches: [ main ]
+ paths:
+ - 'aws-lambda-java-core/**'
+ pull_request:
+ branches: [ '*' ]
+ paths:
+ - 'aws-lambda-java-core/**'
+ - '.github/workflows/aws-lambda-java-core.yml'
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v5
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v4
+ with:
+ java-version: 8
+ distribution: corretto
+
+ # Install base module
+ - name: Install core with Maven
+ run: mvn -B install --file aws-lambda-java-core/pom.xml
+
+ # Package modules that depend on base module
+ - name: Package log4j2 with Maven
+ run: mvn -B package --file aws-lambda-java-log4j2/pom.xml
+
+ # Test Runtime Interface Client
+ - name: Run 'pr' target
+ working-directory: ./aws-lambda-java-runtime-interface-client
+ run: make pr
+ env:
+ IS_JAVA_8: true
diff --git a/.github/workflows/aws-lambda-java-events-sdk-transformer.yml b/.github/workflows/aws-lambda-java-events-sdk-transformer.yml
new file mode 100644
index 000000000..1f1f08870
--- /dev/null
+++ b/.github/workflows/aws-lambda-java-events-sdk-transformer.yml
@@ -0,0 +1,39 @@
+# This workflow will be triggered if there will be changes to
+# aws-lambda-java-events-sdk-transformer package and it builds the package.
+
+name: Java CI aws-lambda-java-events-sdk-transformer
+
+on:
+ push:
+ branches: [ main ]
+ paths:
+ - 'aws-lambda-java-events-sdk-transformer/**'
+ pull_request:
+ branches: [ '*' ]
+ paths:
+ - 'aws-lambda-java-events-sdk-transformer/**'
+ - '.github/workflows/aws-lambda-java-events-sdk-transformer.yml'
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v5
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v4
+ with:
+ java-version: 8
+ distribution: corretto
+
+ # Install base module
+ - name: Install events with Maven
+ run: mvn -B install --file aws-lambda-java-events/pom.xml
+ # Package target module
+ - name: Package events-sdk-transformer with Maven
+ run: mvn -B package --file aws-lambda-java-events-sdk-transformer/pom.xml
+
diff --git a/.github/workflows/aws-lambda-java-events.yml b/.github/workflows/aws-lambda-java-events.yml
new file mode 100644
index 000000000..2d101018d
--- /dev/null
+++ b/.github/workflows/aws-lambda-java-events.yml
@@ -0,0 +1,42 @@
+# This workflow will be triggered if there will be changes to aws-lambda-java-events
+# package and it builds the package and the packages that depend on it.
+
+name: Java CI aws-lambda-java-events
+
+on:
+ push:
+ branches: [ main ]
+ paths:
+ - 'aws-lambda-java-events/**'
+ pull_request:
+ branches: [ '*' ]
+ paths:
+ - 'aws-lambda-java-events/**'
+ - '.github/workflows/aws-lambda-java-events.yml'
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v5
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v4
+ with:
+ java-version: 8
+ distribution: corretto
+
+ # Install base module
+ - name: Install events with Maven
+ run: mvn -B install --file aws-lambda-java-events/pom.xml
+
+ # Package modules that depend on base module
+ - name: Package serialization with Maven
+ run: mvn -B package --file aws-lambda-java-serialization/pom.xml
+ - name: Package events-sdk-transformer with Maven
+ run: mvn -B package --file aws-lambda-java-events-sdk-transformer/pom.xml
+
diff --git a/.github/workflows/aws-lambda-java-log4j2.yml b/.github/workflows/aws-lambda-java-log4j2.yml
new file mode 100644
index 000000000..e9f6a56c1
--- /dev/null
+++ b/.github/workflows/aws-lambda-java-log4j2.yml
@@ -0,0 +1,39 @@
+# This workflow will be triggered if there will be changes to
+# aws-lambda-java-log4j2 package and it builds the package.
+
+name: Java CI aws-lambda-java-log4j2
+
+on:
+ push:
+ branches: [ main ]
+ paths:
+ - 'aws-lambda-java-log4j2/**'
+ pull_request:
+ branches: [ '*' ]
+ paths:
+ - 'aws-lambda-java-log4j2/**'
+ - '.github/workflows/aws-lambda-java-log4j2.yml'
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v5
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v4
+ with:
+ java-version: 8
+ distribution: corretto
+
+ # Install base module
+ - name: Install core with Maven
+ run: mvn -B install --file aws-lambda-java-core/pom.xml
+ # Package target module
+ - name: Package log4j2 with Maven
+ run: mvn -B package --file aws-lambda-java-log4j2/pom.xml
+
diff --git a/.github/workflows/aws-lambda-java-profiler.yml b/.github/workflows/aws-lambda-java-profiler.yml
new file mode 100644
index 000000000..a3afe3729
--- /dev/null
+++ b/.github/workflows/aws-lambda-java-profiler.yml
@@ -0,0 +1,78 @@
+name: Run integration tests for aws-lambda-java-profiler
+
+on:
+ pull_request:
+ branches: [ '*' ]
+ paths:
+ - 'experimental/aws-lambda-java-profiler/**'
+ - '.github/workflows/aws-lambda-java-profiler.yml'
+ push:
+ branches: ['*']
+ paths:
+ - 'experimental/aws-lambda-java-profiler/**'
+ - '.github/workflows/aws-lambda-java-profiler.yml'
+
+jobs:
+
+ build:
+ runs-on: ubuntu-latest
+
+ permissions:
+ id-token: write
+ contents: read
+
+ steps:
+ - uses: actions/checkout@v5
+
+ - name: Set up JDK
+ uses: actions/setup-java@v4
+ with:
+ java-version: 21
+ distribution: corretto
+
+ - name: Issue AWS credentials
+ uses: aws-actions/configure-aws-credentials@v4
+ with:
+ aws-region: ${{ secrets.AWS_REGION_PROFILER_EXTENSION_INTEGRATION_TEST }}
+ role-to-assume: ${{ secrets.AWS_ROLE_PROFILER_EXTENSION_INTEGRATION_TEST }}
+ role-session-name: GitHubActionsRunIntegrationTests
+ role-duration-seconds: 900
+
+ - name: Build layer
+ working-directory: ./experimental/aws-lambda-java-profiler/extension
+ run: ./build_layer.sh
+
+ - name: Publish layer
+ working-directory: ./experimental/aws-lambda-java-profiler
+ run: ./integration_tests/publish_layer.sh
+
+ - name: Create the bucket layer
+ working-directory: ./experimental/aws-lambda-java-profiler
+ run: ./integration_tests/create_bucket.sh
+
+ - name: Create Java function
+ working-directory: ./experimental/aws-lambda-java-profiler
+ run: ./integration_tests/create_function.sh
+
+ - name: Invoke Java function
+ working-directory: ./experimental/aws-lambda-java-profiler
+ run: ./integration_tests/invoke_function.sh
+
+ - name: Invoke Java Custom Options function
+ working-directory: ./experimental/aws-lambda-java-profiler
+ run: ./integration_tests/invoke_function_custom_options.sh
+
+ - name: Download from s3
+ working-directory: ./experimental/aws-lambda-java-profiler
+ run: ./integration_tests/download_from_s3.sh
+
+ - name: Upload profiles
+ uses: actions/upload-artifact@v4
+ with:
+ name: profiles
+ path: /tmp/s3-artifacts
+
+ - name: cleanup
+ if: always()
+ working-directory: ./experimental/aws-lambda-java-profiler
+ run: ./integration_tests/cleanup.sh
\ No newline at end of file
diff --git a/.github/workflows/aws-lambda-java-serialization.yml b/.github/workflows/aws-lambda-java-serialization.yml
new file mode 100644
index 000000000..13b7e08b0
--- /dev/null
+++ b/.github/workflows/aws-lambda-java-serialization.yml
@@ -0,0 +1,43 @@
+# This workflow will be triggered if there will be changes to aws-lambda-java-serialization
+# package and it builds the package and the packages that depend on it.
+
+name: Java CI aws-lambda-java-serialization
+
+on:
+ push:
+ branches: [ main ]
+ paths:
+ - 'aws-lambda-java-serialization/**'
+ pull_request:
+ branches: [ '*' ]
+ paths:
+ - 'aws-lambda-java-serialization/**'
+ - '.github/workflows/aws-lambda-java-serialization.yml'
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v5
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v4
+ with:
+ java-version: 8
+ distribution: corretto
+
+ # Install base module
+ - name: Install events with Maven
+ run: mvn -B install --file aws-lambda-java-events/pom.xml
+
+ # Package and install target module
+ - name: Package serialization with Maven
+ run: mvn -B package install --file aws-lambda-java-serialization/pom.xml
+
+ # Run tests
+ - name: Run tests from aws-lambda-java-tests
+ run: mvn test --file aws-lambda-java-tests/pom.xml
diff --git a/.github/workflows/aws-lambda-java-tests.yml b/.github/workflows/aws-lambda-java-tests.yml
new file mode 100644
index 000000000..720c52c11
--- /dev/null
+++ b/.github/workflows/aws-lambda-java-tests.yml
@@ -0,0 +1,42 @@
+# This workflow will be triggered if there will be changes to aws-lambda-java-tests
+# package and it builds the package and the packages that depend on it.
+
+name: Java CI aws-lambda-java-tests
+
+on:
+ push:
+ branches: [ main ]
+ paths:
+ - 'aws-lambda-java-tests/**'
+ pull_request:
+ branches: [ '*' ]
+ paths:
+ - 'aws-lambda-java-tests/**'
+ - '.github/workflows/aws-lambda-java-tests.yml'
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v5
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v4
+ with:
+ java-version: 8
+ distribution: corretto
+
+ # Install base module
+ - name: Install events with Maven
+ run: mvn -B install --file aws-lambda-java-events/pom.xml
+ - name: Install serialization with Maven
+ run: mvn -B install --file aws-lambda-java-serialization/pom.xml
+
+ # Package target module
+ - name: Package tests with Maven
+ run: mvn -B package --file aws-lambda-java-tests/pom.xml
+
diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml
new file mode 100644
index 000000000..2d97bc868
--- /dev/null
+++ b/.github/workflows/repo-sync.yml
@@ -0,0 +1,39 @@
+name: Repo Sync
+
+on:
+ schedule:
+ - cron: "0 8 * * 1-5" # At 08:00 on every day-of-week from Monday through Friday
+ pull_request:
+ branches: [ '*' ]
+ paths:
+ - '.github/workflows/repo-sync.yml'
+ workflow_dispatch:
+
+permissions:
+ contents: write
+ pull-requests: write
+
+jobs:
+ repo-sync:
+ name: Repo Sync
+ runs-on: ubuntu-latest
+ env:
+ IS_CONFIGURED: ${{ secrets.SOURCE_REPO != '' }}
+ steps:
+ - uses: actions/checkout@v5
+ if: ${{ env.IS_CONFIGURED == 'true' }}
+ - uses: repo-sync/github-sync@v2
+ name: Sync repo to branch
+ if: ${{ env.IS_CONFIGURED == 'true' }}
+ with:
+ source_repo: ${{ secrets.SOURCE_REPO }}
+ source_branch: main
+ destination_branch: ${{ secrets.INTERMEDIATE_BRANCH }}
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ - uses: repo-sync/pull-request@v2
+ name: Create pull request
+ if: ${{ env.IS_CONFIGURED == 'true' }}
+ with:
+ source_branch: ${{ secrets.INTERMEDIATE_BRANCH }}
+ destination_branch: main
+ github_token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/runtime-interface-client_merge_to_main.yml b/.github/workflows/runtime-interface-client_merge_to_main.yml
new file mode 100644
index 000000000..3560207f3
--- /dev/null
+++ b/.github/workflows/runtime-interface-client_merge_to_main.yml
@@ -0,0 +1,95 @@
+# This workflow will be triggered on merge to the main branch if
+# aws-lambda-java-runtime-interface-client package was changed
+#
+# It will publish artifacts to CodeArtifact repository, specified by properties defined in GitHub repo secrets:
+# CODE_ARTIFACT_REPO_ACCOUNT, AWS_REGION, CODE_ARTIFACT_REPO_NAME, CODE_ARTIFACT_DOMAIN
+# and will assume role specified by AWS_ROLE
+#
+# Prerequisite setup:
+# https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services
+
+name: Publish artifact for aws-lambda-java-runtime-interface-client
+
+on:
+ push:
+ branches: [ main ]
+ paths:
+ - 'aws-lambda-java-runtime-interface-client/**'
+ - '.github/workflows/runtime-interface-client_*.yml'
+ workflow_dispatch:
+
+jobs:
+
+ publish:
+ runs-on: ubuntu-latest
+
+ permissions:
+ id-token: write
+ contents: read
+
+ steps:
+ - uses: actions/checkout@v5
+
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v4
+ with:
+ java-version: 8
+ distribution: corretto
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v3
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+ with:
+ install: true
+
+ - name: Available buildx platforms
+ run: echo ${{ steps.buildx.outputs.platforms }}
+
+ - name: Build and install serialization dependency locally
+ working-directory: ./aws-lambda-java-serialization
+ run: mvn clean install
+
+ - name: Test Runtime Interface Client xplatform build - Run 'build' target
+ working-directory: ./aws-lambda-java-runtime-interface-client
+ run: make build
+ env:
+ IS_JAVA_8: true
+
+ - name: Issue AWS credentials
+ if: env.ENABLE_SNAPSHOT != null
+ env:
+ ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }}
+ uses: aws-actions/configure-aws-credentials@v4
+ with:
+ aws-region: ${{ secrets.AWS_REGION }}
+ role-to-assume: ${{ secrets.AWS_ROLE }}
+ role-session-name: GitHubActionsPublishPackage
+ role-duration-seconds: 900
+
+ - name: Prepare codeartifact properties
+ if: env.ENABLE_SNAPSHOT != null
+ env:
+ ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }}
+ working-directory: ./aws-lambda-java-runtime-interface-client/ric-dev-environment
+ run: |
+ cat < codeartifact-properties.mk
+ CODE_ARTIFACT_REPO_ACCOUNT=${{ secrets.AWS_ACCOUNT }}
+ CODE_ARTIFACT_REPO_REGION=${{ env.AWS_REGION }}
+ CODE_ARTIFACT_REPO_NAME=${{ secrets.CODE_ARTIFACT_REPO_NAME }}
+ CODE_ARTIFACT_DOMAIN=${{ secrets.AWS_CODEARTIFACT_DOMAIN }}
+ EOF
+
+ - name: Publish
+ if: env.ENABLE_SNAPSHOT != null
+ working-directory: ./aws-lambda-java-runtime-interface-client
+ env:
+ ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }}
+ run: make publish
+
+ - name: Upload coverage to Codecov
+ if: env.CODECOV_TOKEN != null
+ uses: codecov/codecov-action@v5
+ env:
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
diff --git a/.github/workflows/runtime-interface-client_pr.yml b/.github/workflows/runtime-interface-client_pr.yml
new file mode 100644
index 000000000..dcad4fa0a
--- /dev/null
+++ b/.github/workflows/runtime-interface-client_pr.yml
@@ -0,0 +1,89 @@
+# This workflow will be triggered if there will be changes to
+# aws-lambda-java-runtime-interface-client package and it builds the package.
+
+name: PR to runtime-interface-client
+
+on:
+ pull_request:
+ branches: [ '*' ]
+ paths:
+ - 'aws-lambda-java-runtime-interface-client/**'
+ - '.github/workflows/runtime-interface-client_*.yml'
+
+permissions:
+ contents: read
+
+jobs:
+
+ smoke-test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v5
+
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v4
+ with:
+ java-version: 8
+ distribution: corretto
+
+ - name: Build and install core dependency locally
+ working-directory: ./aws-lambda-java-core
+ run: mvn clean install
+
+ - name: Build and install serialization dependency locally
+ working-directory: ./aws-lambda-java-serialization
+ run: mvn clean install
+
+ - name: Runtime Interface Client smoke tests - Run 'pr' target
+ working-directory: ./aws-lambda-java-runtime-interface-client
+ run: make pr
+ env:
+ IS_JAVA_8: true
+
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v5
+
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v4
+ with:
+ java-version: 8
+ distribution: corretto
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v3
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+ with:
+ install: true
+
+ - name: Available buildx platforms
+ run: echo ${{ steps.buildx.outputs.platforms }}
+
+ - name: Build and install core dependency locally
+ working-directory: ./aws-lambda-java-core
+ run: mvn clean install
+
+ - name: Build and install serialization dependency locally
+ working-directory: ./aws-lambda-java-serialization
+ run: mvn clean install
+
+ - name: Test Runtime Interface Client xplatform build - Run 'build' target
+ working-directory: ./aws-lambda-java-runtime-interface-client
+ run: make build
+ env:
+ IS_JAVA_8: true
+
+ - name: Save the built jar
+ uses: actions/upload-artifact@v4
+ with:
+ name: aws-lambda-java-runtime-interface-client
+ path: ./aws-lambda-java-runtime-interface-client/target/aws-lambda-java-runtime-interface-client-*.jar
+
+ - name: Upload coverage to Codecov
+ if: env.CODECOV_TOKEN != null
+ uses: codecov/codecov-action@v5
+ env:
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml
new file mode 100644
index 000000000..aebb708a7
--- /dev/null
+++ b/.github/workflows/samples.yml
@@ -0,0 +1,79 @@
+# This workflow will be triggered if there will be changes to aws-lambda-java-core
+# package and it builds the package and the packages that depend on it.
+
+name: Java CI samples
+
+on:
+ push:
+ branches: [ main ]
+ paths:
+ - 'samples/**'
+ pull_request:
+ branches: [ '*' ]
+ paths:
+ - 'samples/**'
+ - '.github/workflows/samples.yml'
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v5
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v4
+ with:
+ java-version: 8
+ distribution: corretto
+
+ # Install events module
+ - name: Install events with Maven
+ run: mvn -B install --file aws-lambda-java-events/pom.xml
+ # Install serialization module
+ - name: Install serialization with Maven
+ run: mvn -B install --file aws-lambda-java-serialization/pom.xml
+ # Install tests module
+ - name: Install tests with Maven
+ run: mvn -B install --file aws-lambda-java-tests/pom.xml
+
+ # Install samples
+ - name: Install Kinesis Firehose Sample with Maven
+ run: mvn -B install --file samples/kinesis-firehose-event-handler/pom.xml
+
+ custom-serialization:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v5
+ # Set up both Java 8 and 21
+ - name: Set up Java 8 and 21
+ uses: actions/setup-java@v4
+ with:
+ java-version: |
+ 8
+ 21
+ distribution: corretto
+
+ # Install events module using Java 8
+ - name: Install events with Maven
+ run: |
+ export JAVA_HOME=$JAVA_HOME_8_X64
+ mvn -B clean install \
+ -Dmaven.compiler.source=1.8 \
+ -Dmaven.compiler.target=1.8 \
+ --file aws-lambda-java-events/pom.xml
+
+ # Build custom-serialization samples
+ - name: install sam
+ uses: aws-actions/setup-sam@v2
+ - name: test fastJson
+ run: cd samples/custom-serialization/fastJson && sam build && sam local invoke -e events/event.json | grep 200
+ - name: test gson
+ run: cd samples/custom-serialization/gson && sam build && sam local invoke -e events/event.json | grep 200
+ - name: test jackson-jr
+ run: cd samples/custom-serialization/jackson-jr && sam build && sam local invoke -e events/event.json | grep 200
+ - name: test moshi
+ run: cd samples/custom-serialization/moshi && sam build && sam local invoke -e events/event.json | grep 200
+ - name: test request-stream-handler
+ run: cd samples/custom-serialization/request-stream-handler && sam build && sam local invoke -e events/event.json | grep 200
diff --git a/.gitignore b/.gitignore
index e7133935b..1adf36493 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,7 +13,26 @@ hs_err_pid*
# Maven build
target/
+dependency-reduced-pom.xml
# IDEA internal
*.iml
.idea
+.gradle
+.settings
+.classpath
+.project
+
+# OSX
+.DS_Store
+
+# snapshot process
+aws-lambda-java-runtime-interface-client/pom.xml.versionsBackup
+
+# profiler
+experimental/aws-lambda-java-profiler/integration_tests/helloworld/build
+experimental/aws-lambda-java-profiler/extension/build/
+experimental/aws-lambda-java-profiler/integration_tests/helloworld/bin
+!experimental/aws-lambda-java-profiler/extension/gradle/wrapper/*.jar
+/scratch/
+.vscode
diff --git a/README.md b/README.md
index 3243ff51c..b6c67b9e8 100644
--- a/README.md
+++ b/README.md
@@ -1,93 +1,190 @@
# AWS Lambda Java Support Libraries
-Interface definitions for Java code running on the AWS Lambda platform.
+Key libraries for running Java on the AWS Lambda platform.
-For issues and questions, you can start with our [FAQ](https://aws.amazon.com/lambda/faqs/) and the [AWS forums](https://forums.aws.amazon.com/forum.jspa?forumID=186)
+For issues and questions, you can start with our [FAQ](https://aws.amazon.com/lambda/faqs/)
+and the AWS questions and answer site [re:Post](https://repost.aws/tags/TA5uNafDy2TpGNjidWLMSxDw/aws-lambda)
-To get started writing AWS Lambda functions in Java, check out the [official documentation] (http://docs.aws.amazon.com/lambda/latest/dg/java-gs.html).
+To get started writing Lambda functions in Java, check out the official [developer guide](https://docs.aws.amazon.com/lambda/latest/dg/lambda-java.html).
-# Disclaimer of use
+For information on how to optimize your functions watch the re:Invent talk [Optimize your Java application on AWS Lambda](https://www.youtube.com/watch?v=sVJOJUD0fhQ).
-Each of the supplied packages should be used without modification. Removing
-dependencies, adding conflicting dependencies, or selectively including classes
-from the packages can result in unexpected behavior.
+## Core Java Lambda interfaces - aws-lambda-java-core
+
+[](https://central.sonatype.com/artifact/com.amazonaws/aws-lambda-java-core)
+
+This package defines the Lambda [Context](http://docs.aws.amazon.com/lambda/latest/dg/java-context-object.html) object
+as well as [interfaces](http://docs.aws.amazon.com/lambda/latest/dg/java-handler-using-predefined-interfaces.html) that Lambda accepts.
+
+- [Release Notes](aws-lambda-java-core/RELEASE.CHANGELOG.md)
+
+Example request handler
+
+```java
+public class Handler implements RequestHandler
*/
- public Map getCustom();
+ Map getCustom();
/**
* Gets environment information provided by mobile SDK, immutable.
*
*/
- public Map getEnvironment();
+ Map getEnvironment();
}
diff --git a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java
index 25f3b3dd3..a65887632 100644
--- a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java
+++ b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java
@@ -11,11 +11,11 @@ public interface CognitoIdentity {
* Gets the Amazon Cognito identity ID
*
*/
- public String getIdentityId();
+ String getIdentityId();
/**
* Gets the Amazon Cognito identity pool ID
*
*/
- public String getIdentityPoolId();
+ String getIdentityPoolId();
}
diff --git a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java
index a0850e78c..ed9311a11 100644
--- a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java
+++ b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java
@@ -100,4 +100,23 @@ public interface Context {
*/
LambdaLogger getLogger();
+ /**
+ *
+ * Returns the tenant ID associated with the request.
+ *
+ * @return null by default
+ */
+ default String getTenantId() {
+ return null;
+ }
+
+ /**
+ *
+ * Returns the X-Ray trace ID associated with the request.
+ *
+ * @return null by default
+ */
+ default String getXrayTraceId() {
+ return null;
+ }
}
diff --git a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CustomPojoSerializer.java b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CustomPojoSerializer.java
new file mode 100644
index 000000000..0d7cc27d4
--- /dev/null
+++ b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CustomPojoSerializer.java
@@ -0,0 +1,38 @@
+/* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
+
+package com.amazonaws.services.lambda.runtime;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import java.lang.reflect.Type;
+
+/**
+ * Interface required to implement a custom plain old java objects serializer
+ */
+public interface CustomPojoSerializer {
+
+ /**
+ * Deserializes from input stream to plain old java object
+ * @param input input stream
+ * @param type plain old java object type
+ * @return deserialized plain old java object of type T
+ */
+ T fromJson(InputStream input, Type type);
+
+ /**
+ * Deserializes from String to plain old java object
+ * @param input input string
+ * @param type plain old java object type
+ * @return deserialized plain old java object of type T
+ */
+ T fromJson(String input, Type type);
+
+ /**
+ * Serializes plain old java object to output stream
+ * @param value instance of type T to be serialized
+ * @param output OutputStream to serialize plain old java object to
+ * @param type plain old java object type
+ */
+ void toJson(T value, OutputStream output, Type type);
+}
diff --git a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java
index 8ff064589..e068abe8a 100644
--- a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java
+++ b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java
@@ -2,6 +2,8 @@
package com.amazonaws.services.lambda.runtime;
+import com.amazonaws.services.lambda.runtime.logging.LogLevel;
+
/**
* A low level Lambda runtime logger
*
@@ -10,7 +12,7 @@ public interface LambdaLogger {
/**
* Logs a string to AWS CloudWatch Logs
- *
+ *
*
* Logging will not be done:
*
@@ -22,15 +24,37 @@ public interface LambdaLogger {
*
*
*
- *
+ *
* @param message A string containing the event to log.
*/
- public void log(String message);
+ void log(String message);
/**
* Logs a byte array to AWS CloudWatch Logs
* @param message byte array containing logs
*/
- public void log(byte[] message);
+ void log(byte[] message);
+
+ /**
+ * LogLevel aware logging backend function.
+ *
+ * @param message in String format
+ * @param logLevel
+ */
+ default void log(String message, LogLevel logLevel) {
+ log(message);
+ }
+
+ /**
+ * LogLevel aware logging backend function.
+ *
+ * @param message in byte[] format
+ * @param logLevel
+ */
+ default void log(byte[] message, LogLevel logLevel) {
+ log(message);
+ }
+
+
}
diff --git a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java
index 406f2be3b..834683f26 100644
--- a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java
+++ b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java
@@ -17,5 +17,5 @@ public interface RequestHandler {
* @param context The Lambda execution environment context object.
* @return The Lambda Function output
*/
- public O handleRequest(I input, Context context);
+ O handleRequest(I input, Context context);
}
diff --git a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java
index d8ccf5a6b..3a34adc9b 100644
--- a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java
+++ b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java
@@ -18,5 +18,5 @@ public interface RequestStreamHandler {
* @param context The Lambda execution environment context object.
* @throws IOException
*/
- public void handleRequest(InputStream input, OutputStream output, Context context) throws IOException;
+ void handleRequest(InputStream input, OutputStream output, Context context) throws IOException;
}
diff --git a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/logging/LogFormat.java b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/logging/LogFormat.java
new file mode 100644
index 000000000..0d65860d7
--- /dev/null
+++ b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/logging/LogFormat.java
@@ -0,0 +1,17 @@
+/* Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
+
+package com.amazonaws.services.lambda.runtime.logging;
+
+
+public enum LogFormat {
+ JSON,
+ TEXT;
+
+ public static LogFormat fromString(String logFormat) {
+ try {
+ return LogFormat.valueOf(logFormat.toUpperCase());
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Invalid log format: '" + logFormat + "' expected one of [JSON, TEXT]");
+ }
+ }
+}
diff --git a/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/logging/LogLevel.java b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/logging/LogLevel.java
new file mode 100644
index 000000000..4f48a3e41
--- /dev/null
+++ b/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/logging/LogLevel.java
@@ -0,0 +1,25 @@
+/* Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
+
+package com.amazonaws.services.lambda.runtime.logging;
+
+
+public enum LogLevel {
+ // UNDEFINED log level is used when the legacy LambdaLogger::log(String) function is called
+ // where the loglevel is not defined. In this case we're not filtering the message in the runtime
+ UNDEFINED,
+ TRACE,
+ DEBUG,
+ INFO,
+ WARN,
+ ERROR,
+ FATAL;
+
+ public static LogLevel fromString(String logLevel) {
+ try {
+ return LogLevel.valueOf(logLevel.toUpperCase());
+ } catch (Exception e) {
+ throw new IllegalArgumentException(
+ "Invalid log level: '" + logLevel + "' expected one of [TRACE, DEBUG, INFO, WARN, ERROR, FATAL]");
+ }
+ }
+}
diff --git a/aws-lambda-java-events-sdk-transformer/README.md b/aws-lambda-java-events-sdk-transformer/README.md
new file mode 100644
index 000000000..02f2dc11f
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/README.md
@@ -0,0 +1,214 @@
+# AWS Lambda Java Events SDK Transformer Library
+
+### About
+
+Provides helper classes/methods to use alongside `aws-lambda-java-events` in order to transform Lambda input event model
+ objects into SDK-compatible output model objects
+ (eg. DynamodbEvent to a List of records writable back to DynamoDB through the AWS DynamoDB SDK for Java v1 or v2).
+
+
+### Getting started
+
+Add the following Apache Maven dependencies to your `pom.xml` file:
+
+```xml
+
+
+ com.amazonaws
+ aws-lambda-java-events-sdk-transformer
+ 3.1.0
+
+
+ com.amazonaws
+ aws-lambda-java-events
+ 3.11.2
+
+
+```
+
+To use this library as a transformer to the AWS DynamoDB Java SDK v2, also add the following dependency to your `pom.xml` file:
+
+```xml
+
+
+ software.amazon.awssdk
+ dynamodb
+ 2.15.40
+
+
+```
+
+To use this library as a transformer to the AWS DynamoDB Java SDK v1, add the following dependency to your `pom.xml` file instead:
+
+```xml
+
+
+ com.amazonaws
+ aws-java-sdk-dynamodb
+ 1.11.914
+
+
+```
+
+
+### Example Usage
+
+#### SDK v2
+
+To convert a full `DynamodbEvent` object to an SDK v2 compatible `List`:
+
+```java
+import com.amazonaws.services.lambda.runtime.events.transformers.v2.DynamodbEventTransformer;
+
+public class DDBEventProcessor implements RequestHandler {
+
+ public String handleRequest(DynamodbEvent ddbEvent, Context context) {
+ // Process input event
+ List convertedRecords = DynamodbEventTransformer.toRecordsV2(ddbEvent);
+ // Modify records as needed and write back to DynamoDB using the DynamoDB AWS SDK for Java 2.0
+ }
+}
+```
+
+To convert a single `DynamodbEvent.DynamodbStreamRecord` object to an SDK v2 compatible `Record`:
+
+```java
+import com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbRecordTransformer;
+
+public class MyClass {
+
+ public void myMethod(DynamodbEvent.DynamodbStreamRecord record) {
+ // ...
+ Record convertedRecord = DynamodbRecordTransformer.toRecordV2(record);
+ // ...
+ }
+}
+```
+
+To convert a `StreamRecord` object originating from a `DynamodbEvent` to an SDK v2 compatible `StreamRecord`:
+
+```java
+import com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbStreamRecordTransformer;
+
+public class MyClass {
+
+ public void myMethod(StreamRecord streamRecord) {
+ // ...
+ software.amazon.awssdk.services.dynamodb.model.StreamRecord convertedStreamRecord =
+ DynamodbStreamRecordTransformer.toStreamRecordV2(streamRecord);
+ // ...
+ }
+}
+```
+
+To convert an `AttributeValue` object originating from a `DynamodbEvent` to an SDK v2 compatible `AttributeValue`:
+
+```java
+import com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformer;
+
+public class MyClass {
+
+ public void myMethod(AttributeValue attributeValue) {
+ // ...
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue convertedAttributeValue =
+ DynamodbAttributeValueTransformer.toAttributeValueV2(attributeValue);
+ // ...
+ }
+}
+```
+
+To convert an `Identity` object originating from a `DynamodbEvent` to an SDK v2 compatible `Identity`:
+
+```java
+import com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbIdentityTransformer;
+
+public class MyClass {
+
+ public void myMethod(Identity identity) {
+ // ...
+ software.amazon.awssdk.services.dynamodb.model.Identity convertedIdentity =
+ DynamodbIdentityTransformer.toIdentityV2(identity);
+ // ...
+ }
+}
+```
+
+#### SDK v1
+
+To convert a full `DynamodbEvent` object to an SDK v1 compatible `List`:
+
+```java
+import com.amazonaws.services.lambda.runtime.events.transformers.v1.DynamodbEventTransformer;
+
+public class DDBEventProcessor implements RequestHandler {
+
+ public String handleRequest(DynamodbEvent ddbEvent, Context context) {
+ // Process input event
+ List convertedRecords = DynamodbEventTransformer.toRecordsV1(ddbEvent);
+ // Modify records as needed and write back to DynamoDB using the DynamoDB AWS SDK for Java 2.0
+ }
+}
+```
+
+To convert a single `DynamodbEvent.DynamodbStreamRecord` object to an SDK v1 compatible `Record`:
+
+```java
+import com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbRecordTransformer;
+
+public class MyClass {
+
+ public void myMethod(DynamodbEvent.DynamodbStreamRecord record) {
+ // ...
+ Record convertedRecord = DynamodbRecordTransformer.toRecordV1(record);
+ // ...
+ }
+}
+```
+
+To convert a `StreamRecord` object originating from a `DynamodbEvent` to an SDK v1 compatible `StreamRecord`:
+
+```java
+import com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbStreamRecordTransformer;
+
+public class MyClass {
+
+ public void myMethod(StreamRecord streamRecord) {
+ // ...
+ com.amazonaws.services.dynamodbv2.model.StreamRecord convertedStreamRecord =
+ DynamodbStreamRecordTransformer.toStreamRecordV1(streamRecord);
+ // ...
+ }
+}
+```
+
+To convert an `AttributeValue` object originating from a `DynamodbEvent` to an SDK v1 compatible `AttributeValue`:
+
+```java
+import com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformer;
+
+public class MyClass {
+
+ public void myMethod(AttributeValue attributeValue) {
+ // ...
+ com.amazonaws.services.dynamodbv2.model.AttributeValue convertedAttributeValue =
+ DynamodbAttributeValueTransformer.toAttributeValueV1(attributeValue);
+ // ...
+ }
+}
+```
+
+To convert an `Identity` object originating from a `DynamodbEvent` to an SDK v1 compatible `Identity`:
+
+```java
+import com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbIdentityTransformer;
+
+public class MyClass {
+
+ public void myMethod(Identity identity) {
+ // ...
+ com.amazonaws.services.dynamodbv2.model.Identity convertedIdentity =
+ DynamodbIdentityTransformer.toIdentityV1(identity);
+ // ...
+ }
+}
+```
\ No newline at end of file
diff --git a/aws-lambda-java-events-sdk-transformer/RELEASE.CHANGELOG.md b/aws-lambda-java-events-sdk-transformer/RELEASE.CHANGELOG.md
new file mode 100644
index 000000000..791348208
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/RELEASE.CHANGELOG.md
@@ -0,0 +1,80 @@
+### February 03, 2022
+`3.1.0`:
+- Make DynamodbAttributeValueTransformer v1 and v2 return empty list instead of null for empty list attribute ([#309](https://github.com/aws/aws-lambda-java-libs/pull/309))
+
+### November 24, 2021
+`3.0.7`:
+- Bumped `aws-lambda-java-events` to version `3.11.0`
+
+### September 02, 2021
+`3.0.6`:
+- Fixed NPE when UserIdentity, OldImage, or NewImage is null ([#264](https://github.com/aws/aws-lambda-java-libs/pull/264))
+
+### August 26, 2021
+`3.0.5`:
+- Bumped `aws-lambda-java-events` to version `3.10.0`
+
+### June 2, 2021
+`3.0.4`:
+- Bumped `aws-lambda-java-events` to version `3.9.0`
+
+### March 24, 2021
+`3.0.3`:
+- Bumped `aws-lambda-java-events` to version `3.8.0`
+
+### December 16, 2020
+`3.0.2`:
+- Bumped `aws-lambda-java-events` to version `3.7.0`
+
+### December 10, 2020
+`3.0.1`:
+- Change visibility scope of `Map toAttributeValueMapVx(Map)` to `public`
+
+### December 09, 2020
+`3.0.0`:
+- Added AWS SDK V1 transformers for `DynamodbEvent` in `aws-lambda-java-events` versions `3.0.0` and up
+- Moved existing SDK v2 transformers into `v2` package (from `com.amazonaws.services.lambda.runtime.events.transformers` to `com.amazonaws.services.lambda.runtime.events.transformers.v2`)
+- Bumped `software.amazon.awssdk:dynamodb` to version `2.15.40`
+
+### November 06, 2020
+`2.0.8`:
+- Bumped `aws-lambda-java-events` to version `3.6.0`
+- Bumped `junit-jupiter-engine` to version `5.7.0`
+
+### October 28, 2020
+`2.0.7`:
+- Bumped `aws-lambda-java-events` to version `3.5.0`
+
+### October 07, 2020
+`2.0.6`:
+- Fixed NPE when UserIdentity is null ([#169](https://github.com/aws/aws-lambda-java-libs/pull/169))
+- Bumped `aws-lambda-java-events` to version `3.4.0`
+
+### September 23, 2020
+`2.0.5`:
+- Bumped `aws-lambda-java-events` to version `3.3.1`
+
+### September 14, 2020
+`2.0.4`:
+- Bumped `aws-lambda-java-events` to version `3.3.0`
+
+### August 11, 2020
+`2.0.3`:
+- Bumped `aws-lambda-java-events` to version `3.2.0`
+
+### July 31, 2020
+`2.0.2`:
+- Bumped `aws-lambda-java-events` to version `3.1.1`
+
+### June 15, 2020
+`2.0.1`:
+- Fixed NPE when mapping insert/delete events ([#143](https://github.com/aws/aws-lambda-java-libs/pull/143))
+
+### May 20, 2020
+`2.0.0`:
+- Updated AWS SDK V2 transformers for `DynamodbEvent` to work with `aws-lambda-java-events` versions `3.0.0` and up
+- Bumped `software.amazon.awssdk:dynamodb` to version `2.13.18`
+
+### April 29, 2020
+`1.0.0`:
+- Added AWS SDK V2 transformers for `DynamodbEvent` in `aws-lambda-java-events` versions up to and including `2.x`
diff --git a/aws-lambda-java-log4j/pom.xml b/aws-lambda-java-events-sdk-transformer/pom.xml
similarity index 65%
rename from aws-lambda-java-log4j/pom.xml
rename to aws-lambda-java-events-sdk-transformer/pom.xml
index 0a765e03f..d719ec8ac 100644
--- a/aws-lambda-java-log4j/pom.xml
+++ b/aws-lambda-java-events-sdk-transformer/pom.xml
@@ -4,13 +4,15 @@
4.0.0
com.amazonaws
- aws-lambda-java-log4j
- 1.0.0
+ aws-lambda-java-events-sdk-transformer
+ 3.1.1
jar
- AWS Lambda Java Log4j 1.2 Library
+ AWS Lambda Java Events SDK Transformer Library
- Support for using log4j 1.2 with AWS Lambda.
+ Provides helper classes/methods to use alongside aws-lambda-java-events in order to transform Lambda input event model
+ objects into SDK-compatible output model objects (eg. DynamodbEvent to a List of records writable back to DynamoDB
+ through the AWS DynamoDB SDK for Java v1 or v2)
https://aws.amazon.com/lambda/
@@ -30,18 +32,14 @@
https://aws.amazon.com/
-
-
- com.amazonaws
- aws-lambda-java-core
- 1.1.0
-
-
- log4j
- log4j
- 1.2.17
-
-
+
+
+ 1.8
+ 1.8
+ 1.11.914
+ 2.15.40
+
+
sonatype-nexus-staging
@@ -49,6 +47,47 @@
+
+
+ software.amazon.awssdk
+ dynamodb
+ ${sdk.v2.version}
+ provided
+
+
+ com.amazonaws
+ aws-java-sdk-dynamodb
+ ${sdk.v1.version}
+ provided
+
+
+ com.amazonaws
+ aws-lambda-java-events
+ 3.16.1
+ provided
+
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ 5.7.0
+ test
+
+
+
+
+
+
+ maven-surefire-plugin
+ 2.22.2
+
+
+ maven-failsafe-plugin
+ 2.22.2
+
+
+
+
dev
@@ -121,18 +160,16 @@
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.3
+ org.sonatype.central
+ central-publishing-maven-plugin
+ 0.8.0
true
- sonatype-nexus-staging
- https://oss.sonatype.org/
- false
+ central
-
+
\ No newline at end of file
diff --git a/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/DynamodbEventTransformer.java b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/DynamodbEventTransformer.java
new file mode 100644
index 000000000..c9686d103
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/DynamodbEventTransformer.java
@@ -0,0 +1,21 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v1;
+
+import com.amazonaws.services.dynamodbv2.model.Record;
+import com.amazonaws.services.lambda.runtime.events.DynamodbEvent;
+import com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbRecordTransformer;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+public class DynamodbEventTransformer {
+
+ public static List toRecordsV1(final DynamodbEvent dynamodbEvent) {
+ return dynamodbEvent
+ .getRecords()
+ .stream()
+ .filter(record -> !Objects.isNull(record))
+ .map(DynamodbRecordTransformer::toRecordV1)
+ .collect(Collectors.toList());
+ }
+}
diff --git a/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbAttributeValueTransformer.java b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbAttributeValueTransformer.java
new file mode 100644
index 000000000..61f311f5b
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbAttributeValueTransformer.java
@@ -0,0 +1,74 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb;
+
+import com.amazonaws.services.dynamodbv2.model.AttributeValue;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+public class DynamodbAttributeValueTransformer {
+
+ public static AttributeValue toAttributeValueV1(final com.amazonaws.services.lambda.runtime.events.models.dynamodb.AttributeValue value) {
+ if (Objects.nonNull(value.getS())) {
+ return new AttributeValue()
+ .withS(value.getS());
+
+ } else if (Objects.nonNull(value.getSS())) {
+ return new AttributeValue()
+ .withSS(value.getSS().isEmpty() ? null : value.getSS());
+
+ } else if (Objects.nonNull(value.getN())) {
+ return new AttributeValue()
+ .withN(value.getN());
+
+ } else if (Objects.nonNull(value.getNS())) {
+ return new AttributeValue()
+ .withNS(value.getNS().isEmpty() ? null : value.getNS());
+
+ } else if (Objects.nonNull(value.getB())) {
+ return new AttributeValue()
+ .withB(value.getB());
+
+ } else if (Objects.nonNull(value.getBS())) {
+ return new AttributeValue()
+ .withBS(value.getBS().isEmpty() ? null : value.getBS());
+
+ } else if (Objects.nonNull(value.getBOOL())) {
+ return new AttributeValue()
+ .withBOOL(value.getBOOL());
+
+ } else if (Objects.nonNull(value.getL())) {
+ return new AttributeValue()
+ .withL(value.getL().isEmpty()
+ ? Collections.emptyList()
+ : value.getL().stream()
+ .map(DynamodbAttributeValueTransformer::toAttributeValueV1)
+ .collect(Collectors.toList()));
+
+ } else if (Objects.nonNull(value.getM())) {
+ return new AttributeValue()
+ .withM(toAttributeValueMapV1(value.getM()));
+
+ } else if (Objects.nonNull(value.getNULL())) {
+ return new AttributeValue()
+ .withNULL(value.getNULL());
+
+ } else {
+ throw new IllegalArgumentException(
+ String.format("Unsupported attributeValue type: %s", value));
+ }
+ }
+
+ public static Map toAttributeValueMapV1(
+ final Map attributeValueMap
+ ) {
+ return attributeValueMap
+ .entrySet()
+ .stream()
+ .collect(Collectors.toMap(
+ Map.Entry::getKey,
+ entry -> toAttributeValueV1(entry.getValue())
+ ));
+ }
+}
diff --git a/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbIdentityTransformer.java b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbIdentityTransformer.java
new file mode 100644
index 000000000..32f7aaff9
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbIdentityTransformer.java
@@ -0,0 +1,12 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb;
+
+import com.amazonaws.services.dynamodbv2.model.Identity;
+
+public class DynamodbIdentityTransformer {
+
+ public static Identity toIdentityV1(final com.amazonaws.services.lambda.runtime.events.models.dynamodb.Identity identity) {
+ return new Identity()
+ .withPrincipalId(identity.getPrincipalId())
+ .withType(identity.getType());
+ }
+}
diff --git a/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbRecordTransformer.java b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbRecordTransformer.java
new file mode 100644
index 000000000..7527cd91b
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbRecordTransformer.java
@@ -0,0 +1,24 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb;
+
+import com.amazonaws.services.dynamodbv2.model.Record;
+import com.amazonaws.services.lambda.runtime.events.DynamodbEvent;
+
+public class DynamodbRecordTransformer {
+
+ public static Record toRecordV1(final DynamodbEvent.DynamodbStreamRecord record) {
+ return new Record()
+ .withAwsRegion(record.getAwsRegion())
+ .withDynamodb(
+ DynamodbStreamRecordTransformer.toStreamRecordV1(record.getDynamodb())
+ )
+ .withEventID(record.getEventID())
+ .withEventName(record.getEventName())
+ .withEventSource(record.getEventSource())
+ .withEventVersion(record.getEventVersion())
+ .withUserIdentity(
+ record.getUserIdentity() != null
+ ? DynamodbIdentityTransformer.toIdentityV1(record.getUserIdentity())
+ : null
+ );
+ }
+}
diff --git a/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbStreamRecordTransformer.java b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbStreamRecordTransformer.java
new file mode 100644
index 000000000..f7ca2c6d3
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbStreamRecordTransformer.java
@@ -0,0 +1,29 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb;
+
+import com.amazonaws.services.dynamodbv2.model.StreamRecord;
+
+public class DynamodbStreamRecordTransformer {
+
+ public static StreamRecord toStreamRecordV1(final com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord) {
+ return new StreamRecord()
+ .withApproximateCreationDateTime(
+ streamRecord.getApproximateCreationDateTime()
+ )
+ .withKeys(
+ DynamodbAttributeValueTransformer.toAttributeValueMapV1(streamRecord.getKeys())
+ )
+ .withNewImage(
+ streamRecord.getNewImage() != null
+ ? DynamodbAttributeValueTransformer.toAttributeValueMapV1(streamRecord.getNewImage())
+ : null
+ )
+ .withOldImage(
+ streamRecord.getOldImage() != null
+ ? DynamodbAttributeValueTransformer.toAttributeValueMapV1(streamRecord.getOldImage())
+ : null
+ )
+ .withSequenceNumber(streamRecord.getSequenceNumber())
+ .withSizeBytes(streamRecord.getSizeBytes())
+ .withStreamViewType(streamRecord.getStreamViewType());
+ }
+}
diff --git a/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/DynamodbEventTransformer.java b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/DynamodbEventTransformer.java
new file mode 100644
index 000000000..43e57564c
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/DynamodbEventTransformer.java
@@ -0,0 +1,21 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v2;
+
+import com.amazonaws.services.lambda.runtime.events.DynamodbEvent;
+import com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbRecordTransformer;
+import software.amazon.awssdk.services.dynamodb.model.Record;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+public class DynamodbEventTransformer {
+
+ public static List toRecordsV2(final DynamodbEvent dynamodbEvent) {
+ return dynamodbEvent
+ .getRecords()
+ .stream()
+ .filter(record -> !Objects.isNull(record))
+ .map(DynamodbRecordTransformer::toRecordV2)
+ .collect(Collectors.toList());
+ }
+}
diff --git a/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbAttributeValueTransformer.java b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbAttributeValueTransformer.java
new file mode 100644
index 000000000..ee810c501
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbAttributeValueTransformer.java
@@ -0,0 +1,89 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb;
+
+import software.amazon.awssdk.core.SdkBytes;
+import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+public class DynamodbAttributeValueTransformer {
+
+ public static AttributeValue toAttributeValueV2(final com.amazonaws.services.lambda.runtime.events.models.dynamodb.AttributeValue value) {
+ if (Objects.nonNull(value.getS())) {
+ return AttributeValue.builder()
+ .s(value.getS())
+ .build();
+
+ } else if (Objects.nonNull(value.getSS())) {
+ return AttributeValue.builder()
+ .ss(value.getSS().isEmpty() ? null : value.getSS())
+ .build();
+
+ } else if (Objects.nonNull(value.getN())) {
+ return AttributeValue.builder()
+ .n(value.getN())
+ .build();
+
+ } else if (Objects.nonNull(value.getNS())) {
+ return AttributeValue.builder()
+ .ns(value.getNS().isEmpty() ? null : value.getNS())
+ .build();
+
+ } else if (Objects.nonNull(value.getB())) {
+ return AttributeValue.builder()
+ .b(SdkBytes.fromByteBuffer(value.getB()))
+ .build();
+
+ } else if (Objects.nonNull(value.getBS())) {
+ return AttributeValue.builder()
+ .bs(value.getBS().isEmpty()
+ ? null
+ : value.getBS().stream()
+ .map(SdkBytes::fromByteBuffer)
+ .collect(Collectors.toList()))
+ .build();
+
+ } else if (Objects.nonNull(value.getBOOL())) {
+ return AttributeValue.builder()
+ .bool(value.getBOOL())
+ .build();
+
+ } else if (Objects.nonNull(value.getL())) {
+ return AttributeValue.builder()
+ .l(value.getL().isEmpty()
+ ? Collections.emptyList()
+ : value.getL().stream()
+ .map(DynamodbAttributeValueTransformer::toAttributeValueV2)
+ .collect(Collectors.toList()))
+ .build();
+
+ } else if (Objects.nonNull(value.getM())) {
+ return AttributeValue.builder()
+ .m(toAttributeValueMapV2(value.getM()))
+ .build();
+
+ } else if (Objects.nonNull(value.getNULL())) {
+ return AttributeValue.builder()
+ .nul(value.getNULL())
+ .build();
+
+ } else {
+ throw new IllegalArgumentException(
+ String.format("Unsupported attributeValue type: %s", value));
+ }
+ }
+
+ public static Map toAttributeValueMapV2(
+ final Map attributeValueMap
+ ) {
+ return attributeValueMap
+ .entrySet()
+ .stream()
+ .collect(Collectors.toMap(
+ Map.Entry::getKey,
+ entry -> toAttributeValueV2(entry.getValue())
+ ));
+ }
+}
diff --git a/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbIdentityTransformer.java b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbIdentityTransformer.java
new file mode 100644
index 000000000..34c5fe69f
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbIdentityTransformer.java
@@ -0,0 +1,13 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb;
+
+import software.amazon.awssdk.services.dynamodb.model.Identity;
+
+public class DynamodbIdentityTransformer {
+
+ public static Identity toIdentityV2(final com.amazonaws.services.lambda.runtime.events.models.dynamodb.Identity identity) {
+ return Identity.builder()
+ .principalId(identity.getPrincipalId())
+ .type(identity.getType())
+ .build();
+ }
+}
diff --git a/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbRecordTransformer.java b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbRecordTransformer.java
new file mode 100644
index 000000000..0d035d192
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbRecordTransformer.java
@@ -0,0 +1,25 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb;
+
+import com.amazonaws.services.lambda.runtime.events.DynamodbEvent;
+import software.amazon.awssdk.services.dynamodb.model.Record;
+
+public class DynamodbRecordTransformer {
+
+ public static Record toRecordV2(final DynamodbEvent.DynamodbStreamRecord record) {
+ return Record.builder()
+ .awsRegion(record.getAwsRegion())
+ .dynamodb(
+ DynamodbStreamRecordTransformer.toStreamRecordV2(record.getDynamodb())
+ )
+ .eventID(record.getEventID())
+ .eventName(record.getEventName())
+ .eventSource(record.getEventSource())
+ .eventVersion(record.getEventVersion())
+ .userIdentity(
+ record.getUserIdentity() != null
+ ? DynamodbIdentityTransformer.toIdentityV2(record.getUserIdentity())
+ : null
+ )
+ .build();
+ }
+}
diff --git a/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbStreamRecordTransformer.java b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbStreamRecordTransformer.java
new file mode 100644
index 000000000..6cb1102dd
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/main/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbStreamRecordTransformer.java
@@ -0,0 +1,31 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb;
+
+import software.amazon.awssdk.services.dynamodb.model.StreamRecord;
+
+public class DynamodbStreamRecordTransformer {
+
+ public static StreamRecord toStreamRecordV2(final com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord) {
+
+ return StreamRecord.builder()
+ .approximateCreationDateTime(
+ streamRecord.getApproximateCreationDateTime().toInstant()
+ )
+ .keys(
+ DynamodbAttributeValueTransformer.toAttributeValueMapV2(streamRecord.getKeys())
+ )
+ .newImage(
+ streamRecord.getNewImage() != null
+ ? DynamodbAttributeValueTransformer.toAttributeValueMapV2(streamRecord.getNewImage())
+ : null
+ )
+ .oldImage(
+ streamRecord.getOldImage() != null
+ ? DynamodbAttributeValueTransformer.toAttributeValueMapV2(streamRecord.getOldImage())
+ : null
+ )
+ .sequenceNumber(streamRecord.getSequenceNumber())
+ .sizeBytes(streamRecord.getSizeBytes())
+ .streamViewType(streamRecord.getStreamViewType())
+ .build();
+ }
+}
diff --git a/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/DynamodbEventTransformerTest.java b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/DynamodbEventTransformerTest.java
new file mode 100644
index 000000000..234b97aea
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/DynamodbEventTransformerTest.java
@@ -0,0 +1,43 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v1;
+
+import com.amazonaws.services.dynamodbv2.model.Record;
+import com.amazonaws.services.lambda.runtime.events.DynamodbEvent;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbRecordTransformerTest.record_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbRecordTransformerTest.record_v1;
+
+public class DynamodbEventTransformerTest {
+
+ private final DynamodbEvent dynamodbEvent;
+
+ {
+ record_event.setEventSourceARN("arn:aws:dynamodb:us-west-2:account-id:table/ExampleTableWithStream/stream/2015-06-27T00:48:05.899");
+ dynamodbEvent = new DynamodbEvent();
+ dynamodbEvent.setRecords(Collections.singletonList(record_event));
+ }
+
+ private final List expectedRecordsV2 = Collections.singletonList(record_v1);
+
+ @Test
+ public void testDynamodbEventToRecordsV2() {
+ List convertedRecords = DynamodbEventTransformer.toRecordsV1(dynamodbEvent);
+ Assertions.assertEquals(expectedRecordsV2, convertedRecords);
+ }
+
+ @Test
+ public void testDynamodbEventToRecordsV2_FiltersNullRecords() {
+ DynamodbEvent event = dynamodbEvent.clone();
+ event.setRecords(Arrays.asList(record_event, null));
+ Assertions.assertEquals(2, event.getRecords().size());
+
+ List convertedRecords = DynamodbEventTransformer.toRecordsV1(event);
+ Assertions.assertEquals(expectedRecordsV2, convertedRecords);
+ Assertions.assertEquals(1, convertedRecords.size());
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbAttributeValueTransformerTest.java b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbAttributeValueTransformerTest.java
new file mode 100644
index 000000000..14534fae5
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbAttributeValueTransformerTest.java
@@ -0,0 +1,316 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb;
+
+import com.amazonaws.services.lambda.runtime.events.models.dynamodb.AttributeValue;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+class DynamodbAttributeValueTransformerTest {
+
+ private static final String valueN = "101";
+ private static final List valueNS = Arrays.asList("1", "2", "3");
+ private static final String valueS = "SVal";
+ private static final List valueSS = Arrays.asList("first", "second", "third");
+ private static final ByteBuffer valueB = ByteBuffer.wrap("BVal".getBytes());
+ private static final List valueBS = Arrays.asList(
+ ByteBuffer.wrap("first".getBytes()),
+ ByteBuffer.wrap("second".getBytes()),
+ ByteBuffer.wrap("third".getBytes()));
+ private static final boolean valueBOOL = true;
+ private static final boolean valueNUL = true;
+
+ private static final String keyM1 = "NestedMapKey1";
+ private static final String keyM2 = "NestedMapKey2";
+
+ //region AttributeValue_event
+ public static final AttributeValue attributeValueN_event = new AttributeValue().withN(valueN);
+ public static final AttributeValue attributeValueNS_event = new AttributeValue().withNS(valueNS);
+ public static final AttributeValue attributeValueS_event = new AttributeValue().withS(valueS);
+ public static final AttributeValue attributeValueSS_event = new AttributeValue().withSS(valueSS);
+ public static final AttributeValue attributeValueB_event = new AttributeValue().withB(valueB);
+ public static final AttributeValue attributeValueBS_event = new AttributeValue().withBS(valueBS);
+ public static final AttributeValue attributeValueBOOL_event = new AttributeValue().withBOOL(valueBOOL);
+ public static final AttributeValue attributeValueNUL_event = new AttributeValue().withNULL(valueNUL);
+ public static final AttributeValue attributeValueM_event = new AttributeValue().withM(new HashMap() {{
+ put(keyM1, attributeValueN_event);
+ put(keyM2, attributeValueS_event);
+ }});
+ public static final AttributeValue attributeValueL_event = new AttributeValue().withL(Arrays.asList(
+ attributeValueN_event,
+ attributeValueNS_event,
+ attributeValueS_event,
+ attributeValueSS_event,
+ attributeValueB_event,
+ attributeValueBS_event,
+ attributeValueBOOL_event,
+ attributeValueNUL_event,
+ attributeValueM_event,
+ new AttributeValue().withL(Arrays.asList(
+ attributeValueN_event,
+ attributeValueNS_event,
+ attributeValueS_event,
+ attributeValueSS_event,
+ attributeValueB_event,
+ attributeValueBS_event,
+ attributeValueBOOL_event,
+ attributeValueNUL_event,
+ attributeValueM_event
+ ))
+ ));
+ //endregion
+
+ //region AttributeValue_v1
+ public static final com.amazonaws.services.dynamodbv2.model.AttributeValue attributeValueN_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue().withN(valueN);
+ public static final com.amazonaws.services.dynamodbv2.model.AttributeValue attributeValueNS_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue().withNS(valueNS);
+ public static final com.amazonaws.services.dynamodbv2.model.AttributeValue attributeValueS_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue().withS(valueS);
+ public static final com.amazonaws.services.dynamodbv2.model.AttributeValue attributeValueSS_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue().withSS(valueSS);
+ public static final com.amazonaws.services.dynamodbv2.model.AttributeValue attributeValueB_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue().withB(valueB);
+ public static final com.amazonaws.services.dynamodbv2.model.AttributeValue attributeValueBS_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue().withBS(valueBS);
+ public static final com.amazonaws.services.dynamodbv2.model.AttributeValue attributeValueBOOL_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue().withBOOL(valueBOOL);
+ public static final com.amazonaws.services.dynamodbv2.model.AttributeValue attributeValueNUL_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue().withNULL(valueNUL);
+ public static final com.amazonaws.services.dynamodbv2.model.AttributeValue attributeValueM_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue().withM(new HashMap() {{
+ put(keyM1, attributeValueN_v1);
+ put(keyM2, attributeValueS_v1);
+ }});
+ public static final com.amazonaws.services.dynamodbv2.model.AttributeValue attributeValueL_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue().withL(Arrays.asList(
+ attributeValueN_v1,
+ attributeValueNS_v1,
+ attributeValueS_v1,
+ attributeValueSS_v1,
+ attributeValueB_v1,
+ attributeValueBS_v1,
+ attributeValueBOOL_v1,
+ attributeValueNUL_v1,
+ attributeValueM_v1,
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue().withL(Arrays.asList(
+ attributeValueN_v1,
+ attributeValueNS_v1,
+ attributeValueS_v1,
+ attributeValueSS_v1,
+ attributeValueB_v1,
+ attributeValueBS_v1,
+ attributeValueBOOL_v1,
+ attributeValueNUL_v1,
+ attributeValueM_v1
+ ))
+ ));
+ //endregion
+
+ @Test
+ public void testToAttributeValueV1_N() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue convertedAttributeValueN =
+ DynamodbAttributeValueTransformer.toAttributeValueV1(attributeValueN_event);
+ Assertions.assertEquals(attributeValueN_v1, convertedAttributeValueN);
+ }
+
+ @Test
+ public void testToAttributeValueV1_NS() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue convertedAttributeValueNS =
+ DynamodbAttributeValueTransformer.toAttributeValueV1(attributeValueNS_event);
+ Assertions.assertEquals(attributeValueNS_v1, convertedAttributeValueNS);
+ }
+
+ @Test
+ public void testToAttributeValueV1_S() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue convertedAttributeValueS =
+ DynamodbAttributeValueTransformer.toAttributeValueV1(attributeValueS_event);
+ Assertions.assertEquals(attributeValueS_v1, convertedAttributeValueS);
+ }
+
+ @Test
+ public void testToAttributeValueV1_SS() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue convertedAttributeValueSS =
+ DynamodbAttributeValueTransformer.toAttributeValueV1(attributeValueSS_event);
+ Assertions.assertEquals(attributeValueSS_v1, convertedAttributeValueSS);
+ }
+
+ @Test
+ public void testToAttributeValueV1_B() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue convertedAttributeValueB =
+ DynamodbAttributeValueTransformer.toAttributeValueV1(attributeValueB_event);
+ Assertions.assertEquals(attributeValueB_v1, convertedAttributeValueB);
+ }
+
+ @Test
+ public void testToAttributeValueV1_BS() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue convertedAttributeValueBS =
+ DynamodbAttributeValueTransformer.toAttributeValueV1(attributeValueBS_event);
+ Assertions.assertEquals(attributeValueBS_v1, convertedAttributeValueBS);
+ }
+
+ @Test
+ public void testToAttributeValueV1_BOOL() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue convertedAttributeValueBOOL =
+ DynamodbAttributeValueTransformer.toAttributeValueV1(attributeValueBOOL_event);
+ Assertions.assertEquals(attributeValueBOOL_v1, convertedAttributeValueBOOL);
+ }
+
+ @Test
+ public void testToAttributeValueV1_NUL() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue convertedAttributeValueNUL =
+ DynamodbAttributeValueTransformer.toAttributeValueV1(attributeValueNUL_event);
+ Assertions.assertEquals(attributeValueNUL_v1, convertedAttributeValueNUL);
+ }
+
+ @Test
+ public void testToAttributeValueV1_M() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue convertedAttributeValueM =
+ DynamodbAttributeValueTransformer.toAttributeValueV1(attributeValueM_event);
+ Assertions.assertEquals(attributeValueM_v1, convertedAttributeValueM);
+ }
+
+ @Test
+ public void testToAttributeValueV1_L() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue convertedAttributeValueL =
+ DynamodbAttributeValueTransformer.toAttributeValueV1(attributeValueL_event);
+ Assertions.assertEquals(attributeValueL_v1, convertedAttributeValueL);
+ Assertions.assertEquals("ArrayList", convertedAttributeValueL.getL().getClass().getSimpleName(), "List is mutable");
+ }
+
+ @Test
+ public void testToAttributeValueV1_IllegalArgumentWhenNull() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue())
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV1_IllegalArgumentWhenNull_N() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withN(null))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV1_IllegalArgumentWhenNull_S() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withS(null))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV1_IllegalArgumentWhenNull_B() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withB(null))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV1_IllegalArgumentWhenNull_BOOL() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withBOOL(null))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV1_IllegalArgumentWhenNull_NUL() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withNULL(null))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV1_IllegalArgumentWhenNull_M() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withM(null))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV1_DoesNotThrowWhenEmpty_NS() {
+ Assertions.assertDoesNotThrow(() ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withNS())
+ );
+ Assertions.assertDoesNotThrow(() ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withNS(Collections.emptyList()))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV1_DoesNotThrowWhenEmpty_SS() {
+ Assertions.assertDoesNotThrow(() ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withSS())
+ );
+ Assertions.assertDoesNotThrow(() ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withSS(Collections.emptyList()))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV1_DoesNotThrowWhenEmpty_BS() {
+ Assertions.assertDoesNotThrow(() ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withBS())
+ );
+ Assertions.assertDoesNotThrow(() ->
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withBS(Collections.emptyList()))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV1_DoesNotThrowWhenEmpty_L() {
+ Assertions.assertDoesNotThrow(() -> {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue attributeValue = DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withL());
+ Assertions.assertEquals("ArrayList", attributeValue.getL().getClass().getSimpleName(), "List is mutable");
+ });
+ Assertions.assertDoesNotThrow(() -> {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue attributeValue = DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withL(Collections.emptyList()));
+ Assertions.assertEquals("ArrayList", attributeValue.getL().getClass().getSimpleName(), "List is mutable");
+ });
+ }
+
+ @Test
+ public void testToAttributeValueV1_EmptyV1ObjectWhenEmpty_NS() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue expectedAttributeValue_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue();
+ Assertions.assertEquals(expectedAttributeValue_v1,
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withNS()));
+ Assertions.assertEquals(expectedAttributeValue_v1,
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withNS(Collections.emptyList())));
+ }
+
+ @Test
+ public void testToAttributeValueV1_EmptyV1ObjectWhenEmpty_SS() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue expectedAttributeValue_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue();
+ Assertions.assertEquals(expectedAttributeValue_v1,
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withSS()));
+ Assertions.assertEquals(expectedAttributeValue_v1,
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withSS(Collections.emptyList())));
+ }
+
+ @Test
+ public void testToAttributeValueV1_EmptyV1ObjectWhenEmpty_BS() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue expectedAttributeValue_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue();
+ Assertions.assertEquals(expectedAttributeValue_v1,
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withBS()));
+ Assertions.assertEquals(expectedAttributeValue_v1,
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withBS(Collections.emptyList())));
+ }
+
+ @Test
+ public void testToAttributeValueV1_EmptyV1ObjectWhenEmpty_L() {
+ com.amazonaws.services.dynamodbv2.model.AttributeValue expectedAttributeValue_v1 =
+ new com.amazonaws.services.dynamodbv2.model.AttributeValue().withL(Collections.emptyList());
+ Assertions.assertEquals(expectedAttributeValue_v1,
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withL()));
+ Assertions.assertEquals(expectedAttributeValue_v1,
+ DynamodbAttributeValueTransformer.toAttributeValueV1(new AttributeValue().withL(Collections.emptyList())));
+ }
+
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbIdentityTransformerTest.java b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbIdentityTransformerTest.java
new file mode 100644
index 000000000..5da2f319b
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbIdentityTransformerTest.java
@@ -0,0 +1,30 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb;
+
+import com.amazonaws.services.dynamodbv2.model.Identity;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+class DynamodbIdentityTransformerTest {
+
+ private static final String principalId = "1234567890";
+ private static final String identityType = "type";
+
+ //region Identity_event
+ public static final com.amazonaws.services.lambda.runtime.events.models.dynamodb.Identity identity_event = new com.amazonaws.services.lambda.runtime.events.models.dynamodb.Identity()
+ .withPrincipalId(principalId)
+ .withType(identityType);
+ //endregion
+
+ //region Identity_v1
+ public static final Identity identity_v1 = new Identity()
+ .withPrincipalId(principalId)
+ .withType(identityType);
+ //endregion
+
+ @Test
+ public void testToIdentityV1() {
+ Identity convertedIdentity = DynamodbIdentityTransformer.toIdentityV1(identity_event);
+ Assertions.assertEquals(identity_v1, convertedIdentity);
+ }
+
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbRecordTransformerTest.java b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbRecordTransformerTest.java
new file mode 100644
index 000000000..4504da1db
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbRecordTransformerTest.java
@@ -0,0 +1,63 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb;
+
+import com.amazonaws.services.dynamodbv2.model.OperationType;
+import com.amazonaws.services.dynamodbv2.model.Record;
+import com.amazonaws.services.lambda.runtime.events.DynamodbEvent;
+import com.amazonaws.services.lambda.runtime.events.transformers.v1.DynamodbEventTransformer;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbIdentityTransformerTest.identity_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbIdentityTransformerTest.identity_v1;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbStreamRecordTransformerTest.streamRecord_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbStreamRecordTransformerTest.streamRecord_v1;
+
+public class DynamodbRecordTransformerTest {
+
+ private static final String eventId = "2";
+ private static final String eventName = OperationType.MODIFY.toString();
+ private static final String eventVersion = "1.0";
+ private static final String eventSource = "aws:dynamodb";
+ private static final String awsRegion = "us-west-2";
+
+ //region Record_event
+ public static final DynamodbEvent.DynamodbStreamRecord record_event = (DynamodbEvent.DynamodbStreamRecord)
+ new DynamodbEvent.DynamodbStreamRecord()
+ .withEventID(eventId)
+ .withEventName(eventName)
+ .withEventVersion(eventVersion)
+ .withEventSource(eventSource)
+ .withAwsRegion(awsRegion)
+ .withDynamodb(streamRecord_event)
+ .withUserIdentity(identity_event);
+ //endregion
+
+ //region Record_v1
+ public static final Record record_v1 =
+ new Record()
+ .withEventID(eventId)
+ .withEventName(eventName)
+ .withEventVersion(eventVersion)
+ .withEventSource(eventSource)
+ .withAwsRegion(awsRegion)
+ .withDynamodb(streamRecord_v1)
+ .withUserIdentity(identity_v1);
+ //endregion
+
+ @Test
+ public void testToRecordV1() {
+ Record convertedRecord = DynamodbRecordTransformer.toRecordV1(record_event);
+ Assertions.assertEquals(record_v1, convertedRecord);
+ }
+
+ @Test
+ public void testToRecordV1WhenUserIdentityIsNull() {
+ DynamodbEvent.DynamodbStreamRecord record = record_event.clone();
+ record.setUserIdentity(null);
+
+ Assertions.assertDoesNotThrow(() -> {
+ com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbRecordTransformer.toRecordV1(record);
+ });
+ }
+
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbStreamRecordTransformerTest.java b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbStreamRecordTransformerTest.java
new file mode 100644
index 000000000..594d2a1dc
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v1/dynamodb/DynamodbStreamRecordTransformerTest.java
@@ -0,0 +1,150 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb;
+
+import com.amazonaws.services.dynamodbv2.model.StreamRecord;
+import com.amazonaws.services.dynamodbv2.model.StreamViewType;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.util.Date;
+import java.util.HashMap;
+
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueBOOL_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueBOOL_v1;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueBS_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueBS_v1;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueB_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueB_v1;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueL_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueL_v1;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueM_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueM_v1;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueNS_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueNS_v1;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueNUL_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueNUL_v1;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueN_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueN_v1;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueSS_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueSS_v1;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueS_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueS_v1;
+
+class DynamodbStreamRecordTransformerTest {
+
+ private static final String keyNK = "Id";
+ private static final String keyNSK = "KeyNS";
+
+ private static final String keySK = "SKey";
+ private static final String keySSK = "KeySS";
+
+ private static final String keyBK = "BKey";
+ private static final String keyBSK = "KeyBS";
+
+ private static final String keyBOOLK = "IsBool";
+ private static final String keyNULK = "nil";
+
+ private static final String keyMK = "MapKey";
+
+ private static final String keyLK = "LongNum";
+
+ private static final String oldImageSK = "Message";
+ private static final String newImageSK = "Message";
+ private static final String streamViewType = StreamViewType.NEW_AND_OLD_IMAGES.toString();
+ private static final String sequenceNumber = "222";
+ private static final Long sizeBytes = 59L;
+ private static final Date approximateCreationDateTime = new Date();
+
+ //region StreamRecord_event
+ public static final com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord_event = new com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord()
+ .withKeys(new HashMap() {
+ {
+ put(keyNK, attributeValueN_event);
+ put(keyNSK, attributeValueNS_event);
+ put(keySK, attributeValueS_event);
+ put(keySSK, attributeValueSS_event);
+ put(keyBK, attributeValueB_event);
+ put(keyBSK, attributeValueBS_event);
+ put(keyBOOLK, attributeValueBOOL_event);
+ put(keyNULK, attributeValueNUL_event);
+ put(keyMK, attributeValueM_event);
+ put(keyLK, attributeValueL_event);
+ }
+ })
+ .withOldImage(new HashMap() {
+ {
+ put(oldImageSK, attributeValueS_event);
+ put(keyNK, attributeValueN_event);
+ }
+ })
+ .withNewImage(new HashMap() {
+ {
+ put(newImageSK, attributeValueS_event);
+ put(keyNK, attributeValueN_event);
+ }
+ })
+ .withStreamViewType(com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamViewType.fromValue(streamViewType))
+ .withSequenceNumber(sequenceNumber)
+ .withSizeBytes(sizeBytes)
+ .withApproximateCreationDateTime(approximateCreationDateTime);
+ //endregion
+
+ //region StreamRecord_v1
+ public static final StreamRecord streamRecord_v1 = new StreamRecord()
+ .withApproximateCreationDateTime(approximateCreationDateTime)
+ .withKeys(new HashMap() {
+ {
+ put(keyNK, attributeValueN_v1);
+ put(keyNSK, attributeValueNS_v1);
+ put(keySK, attributeValueS_v1);
+ put(keySSK, attributeValueSS_v1);
+ put(keyBK, attributeValueB_v1);
+ put(keyBSK, attributeValueBS_v1);
+ put(keyBOOLK, attributeValueBOOL_v1);
+ put(keyNULK, attributeValueNUL_v1);
+ put(keyMK, attributeValueM_v1);
+ put(keyLK, attributeValueL_v1);
+ }
+ })
+ .withOldImage(new HashMap() {
+ {
+ put(oldImageSK, attributeValueS_v1);
+ put(keyNK, attributeValueN_v1);
+ }
+ })
+ .withNewImage(new HashMap() {
+ {
+ put(newImageSK, attributeValueS_v1);
+ put(keyNK, attributeValueN_v1);
+ }
+ })
+ .withSequenceNumber(sequenceNumber)
+ .withSizeBytes(sizeBytes)
+ .withStreamViewType(streamViewType);
+ //endregion
+
+ @Test
+ public void testToStreamRecordV1() {
+ StreamRecord convertedStreamRecord = DynamodbStreamRecordTransformer.toStreamRecordV1(streamRecord_event);
+ Assertions.assertEquals(streamRecord_v1, convertedStreamRecord);
+ }
+
+ @Test
+ public void testToStreamRecordV1WhenOldImageIsNull() {
+ com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord = streamRecord_event.clone();
+ streamRecord.setOldImage(null);
+
+ Assertions.assertDoesNotThrow(() -> {
+ com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbStreamRecordTransformer.toStreamRecordV1(streamRecord);
+ });
+ }
+
+ @Test
+ public void testToStreamRecordV1WhenNewImageIsNull() {
+ com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord = streamRecord_event.clone();
+ streamRecord.setNewImage(null);
+
+ Assertions.assertDoesNotThrow(() -> {
+ com.amazonaws.services.lambda.runtime.events.transformers.v1.dynamodb.DynamodbStreamRecordTransformer.toStreamRecordV1(streamRecord);
+ });
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/DynamodbEventTransformerTest.java b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/DynamodbEventTransformerTest.java
new file mode 100644
index 000000000..e9e385480
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/DynamodbEventTransformerTest.java
@@ -0,0 +1,43 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v2;
+
+import com.amazonaws.services.lambda.runtime.events.DynamodbEvent;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.services.dynamodb.model.Record;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbRecordTransformerTest.record_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbRecordTransformerTest.record_v2;
+
+public class DynamodbEventTransformerTest {
+
+ private final DynamodbEvent dynamodbEvent;
+
+ {
+ record_event.setEventSourceARN("arn:aws:dynamodb:us-west-2:account-id:table/ExampleTableWithStream/stream/2015-06-27T00:48:05.899");
+ dynamodbEvent = new DynamodbEvent();
+ dynamodbEvent.setRecords(Collections.singletonList(record_event));
+ }
+
+ private final List expectedRecordsV2 = Collections.singletonList(record_v2);
+
+ @Test
+ public void testDynamodbEventToRecordsV2() {
+ List convertedRecords = DynamodbEventTransformer.toRecordsV2(dynamodbEvent);
+ Assertions.assertEquals(expectedRecordsV2, convertedRecords);
+ }
+
+ @Test
+ public void testDynamodbEventToRecordsV2_FiltersNullRecords() {
+ DynamodbEvent event = dynamodbEvent.clone();
+ event.setRecords(Arrays.asList(record_event, null));
+ Assertions.assertEquals(2, event.getRecords().size());
+
+ List convertedRecords = DynamodbEventTransformer.toRecordsV2(event);
+ Assertions.assertEquals(expectedRecordsV2, convertedRecords);
+ Assertions.assertEquals(1, convertedRecords.size());
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbAttributeValueTransformerTest.java b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbAttributeValueTransformerTest.java
new file mode 100644
index 000000000..1c7f05f7d
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbAttributeValueTransformerTest.java
@@ -0,0 +1,320 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb;
+
+import com.amazonaws.services.lambda.runtime.events.models.dynamodb.AttributeValue;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.core.SdkBytes;
+import software.amazon.awssdk.utils.ImmutableMap;
+
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+class DynamodbAttributeValueTransformerTest {
+
+ private static final String valueN = "101";
+ private static final List valueNS = Arrays.asList("1", "2", "3");
+ private static final String valueS = "SVal";
+ private static final List valueSS = Arrays.asList("first", "second", "third");
+ private static final ByteBuffer valueB = ByteBuffer.wrap("BVal".getBytes());
+ private static final List valueBS = Arrays.asList(
+ ByteBuffer.wrap("first".getBytes()),
+ ByteBuffer.wrap("second".getBytes()),
+ ByteBuffer.wrap("third".getBytes()));
+ private static final boolean valueBOOL = true;
+ private static final boolean valueNUL = true;
+
+ private static final String keyM1 = "NestedMapKey1";
+ private static final String keyM2 = "NestedMapKey2";
+
+ //region AttributeValue_event
+ public static final AttributeValue attributeValueN_event = new AttributeValue().withN(valueN);
+ public static final AttributeValue attributeValueNS_event = new AttributeValue().withNS(valueNS);
+ public static final AttributeValue attributeValueS_event = new AttributeValue().withS(valueS);
+ public static final AttributeValue attributeValueSS_event = new AttributeValue().withSS(valueSS);
+ public static final AttributeValue attributeValueB_event = new AttributeValue().withB(valueB);
+ public static final AttributeValue attributeValueBS_event = new AttributeValue().withBS(valueBS);
+ public static final AttributeValue attributeValueBOOL_event = new AttributeValue().withBOOL(valueBOOL);
+ public static final AttributeValue attributeValueNUL_event = new AttributeValue().withNULL(valueNUL);
+ public static final AttributeValue attributeValueM_event = new AttributeValue().withM(ImmutableMap.of(
+ keyM1, attributeValueN_event,
+ keyM2, attributeValueS_event
+ ));
+ public static final AttributeValue attributeValueL_event = new AttributeValue().withL(Arrays.asList(
+ attributeValueN_event,
+ attributeValueNS_event,
+ attributeValueS_event,
+ attributeValueSS_event,
+ attributeValueB_event,
+ attributeValueBS_event,
+ attributeValueBOOL_event,
+ attributeValueNUL_event,
+ attributeValueM_event,
+ new AttributeValue().withL(Arrays.asList(
+ attributeValueN_event,
+ attributeValueNS_event,
+ attributeValueS_event,
+ attributeValueSS_event,
+ attributeValueB_event,
+ attributeValueBS_event,
+ attributeValueBOOL_event,
+ attributeValueNUL_event,
+ attributeValueM_event
+ ))
+ ));
+ //endregion
+
+ //region AttributeValue_v2
+ public static final software.amazon.awssdk.services.dynamodb.model.AttributeValue attributeValueN_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().n(valueN).build();
+ public static final software.amazon.awssdk.services.dynamodb.model.AttributeValue attributeValueNS_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().ns(valueNS).build();
+ public static final software.amazon.awssdk.services.dynamodb.model.AttributeValue attributeValueS_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().s(valueS).build();
+ public static final software.amazon.awssdk.services.dynamodb.model.AttributeValue attributeValueSS_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().ss(valueSS).build();
+ public static final software.amazon.awssdk.services.dynamodb.model.AttributeValue attributeValueB_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().b(SdkBytes.fromByteBuffer(valueB)).build();
+ public static final software.amazon.awssdk.services.dynamodb.model.AttributeValue attributeValueBS_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().bs(valueBS.stream()
+ .map(SdkBytes::fromByteBuffer)
+ .collect(Collectors.toList())).build();
+ public static final software.amazon.awssdk.services.dynamodb.model.AttributeValue attributeValueBOOL_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().bool(valueBOOL).build();
+ public static final software.amazon.awssdk.services.dynamodb.model.AttributeValue attributeValueNUL_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().nul(valueNUL).build();
+ public static final software.amazon.awssdk.services.dynamodb.model.AttributeValue attributeValueM_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().m(ImmutableMap.of(
+ keyM1, attributeValueN_v2,
+ keyM2, attributeValueS_v2
+ )).build();
+ public static final software.amazon.awssdk.services.dynamodb.model.AttributeValue attributeValueL_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().l(Arrays.asList(
+ attributeValueN_v2,
+ attributeValueNS_v2,
+ attributeValueS_v2,
+ attributeValueSS_v2,
+ attributeValueB_v2,
+ attributeValueBS_v2,
+ attributeValueBOOL_v2,
+ attributeValueNUL_v2,
+ attributeValueM_v2,
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().l(Arrays.asList(
+ attributeValueN_v2,
+ attributeValueNS_v2,
+ attributeValueS_v2,
+ attributeValueSS_v2,
+ attributeValueB_v2,
+ attributeValueBS_v2,
+ attributeValueBOOL_v2,
+ attributeValueNUL_v2,
+ attributeValueM_v2
+ )).build()
+ )).build();
+ //endregion
+
+ @Test
+ public void testToAttributeValueV2_N() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue convertedAttributeValueN =
+ DynamodbAttributeValueTransformer.toAttributeValueV2(attributeValueN_event);
+ Assertions.assertEquals(attributeValueN_v2, convertedAttributeValueN);
+ }
+
+ @Test
+ public void testToAttributeValueV2_NS() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue convertedAttributeValueNS =
+ DynamodbAttributeValueTransformer.toAttributeValueV2(attributeValueNS_event);
+ Assertions.assertEquals(attributeValueNS_v2, convertedAttributeValueNS);
+ }
+
+ @Test
+ public void testToAttributeValueV2_S() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue convertedAttributeValueS =
+ DynamodbAttributeValueTransformer.toAttributeValueV2(attributeValueS_event);
+ Assertions.assertEquals(attributeValueS_v2, convertedAttributeValueS);
+ }
+
+ @Test
+ public void testToAttributeValueV2_SS() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue convertedAttributeValueSS =
+ DynamodbAttributeValueTransformer.toAttributeValueV2(attributeValueSS_event);
+ Assertions.assertEquals(attributeValueSS_v2, convertedAttributeValueSS);
+ }
+
+ @Test
+ public void testToAttributeValueV2_B() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue convertedAttributeValueB =
+ DynamodbAttributeValueTransformer.toAttributeValueV2(attributeValueB_event);
+ Assertions.assertEquals(attributeValueB_v2, convertedAttributeValueB);
+ }
+
+ @Test
+ public void testToAttributeValueV2_BS() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue convertedAttributeValueBS =
+ DynamodbAttributeValueTransformer.toAttributeValueV2(attributeValueBS_event);
+ Assertions.assertEquals(attributeValueBS_v2, convertedAttributeValueBS);
+ }
+
+ @Test
+ public void testToAttributeValueV2_BOOL() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue convertedAttributeValueBOOL =
+ DynamodbAttributeValueTransformer.toAttributeValueV2(attributeValueBOOL_event);
+ Assertions.assertEquals(attributeValueBOOL_v2, convertedAttributeValueBOOL);
+ }
+
+ @Test
+ public void testToAttributeValueV2_NUL() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue convertedAttributeValueNUL =
+ DynamodbAttributeValueTransformer.toAttributeValueV2(attributeValueNUL_event);
+ Assertions.assertEquals(attributeValueNUL_v2, convertedAttributeValueNUL);
+ }
+
+ @Test
+ public void testToAttributeValueV2_M() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue convertedAttributeValueM =
+ DynamodbAttributeValueTransformer.toAttributeValueV2(attributeValueM_event);
+ Assertions.assertEquals(attributeValueM_v2, convertedAttributeValueM);
+ }
+
+ @Test
+ public void testToAttributeValueV2_L() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue convertedAttributeValueL =
+ DynamodbAttributeValueTransformer.toAttributeValueV2(attributeValueL_event);
+ Assertions.assertEquals(attributeValueL_v2, convertedAttributeValueL);
+ Assertions.assertEquals("UnmodifiableRandomAccessList", convertedAttributeValueL.l().getClass().getSimpleName(), "List is immutable");
+ }
+
+ @Test
+ public void testToAttributeValueV2_IllegalArgumentWhenNull() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue())
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV2_IllegalArgumentWhenNull_N() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withN(null))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV2_IllegalArgumentWhenNull_S() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withS(null))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV2_IllegalArgumentWhenNull_B() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withB(null))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV2_IllegalArgumentWhenNull_BOOL() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withBOOL(null))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV2_IllegalArgumentWhenNull_NUL() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withNULL(null))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV2_IllegalArgumentWhenNull_M() {
+ Assertions.assertThrows(IllegalArgumentException.class, () ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withM(null))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV2_DoesNotThrowWhenEmpty_NS() {
+ Assertions.assertDoesNotThrow(() ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withNS())
+ );
+ Assertions.assertDoesNotThrow(() ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withNS(Collections.emptyList()))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV2_DoesNotThrowWhenEmpty_SS() {
+ Assertions.assertDoesNotThrow(() ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withSS())
+ );
+ Assertions.assertDoesNotThrow(() ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withSS(Collections.emptyList()))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV2_DoesNotThrowWhenEmpty_BS() {
+ Assertions.assertDoesNotThrow(() ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withBS())
+ );
+ Assertions.assertDoesNotThrow(() ->
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withBS(Collections.emptyList()))
+ );
+ }
+
+ @Test
+ public void testToAttributeValueV2_DoesNotThrowWhenEmpty_L() {
+ Assertions.assertDoesNotThrow(() -> {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue attributeValue = DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withL());
+ Assertions.assertEquals("UnmodifiableRandomAccessList", attributeValue.l().getClass().getSimpleName(), "List is immutable");
+ });
+ Assertions.assertDoesNotThrow(() -> {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue attributeValue = DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withL(Collections.emptyList()));
+ Assertions.assertEquals("UnmodifiableRandomAccessList", attributeValue.l().getClass().getSimpleName(), "List is immutable");
+ });
+ }
+
+ @Test
+ public void testToAttributeValueV2_EmptyV2ObjectWhenEmpty_NS() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue expectedAttributeValue_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().build();
+ Assertions.assertEquals(expectedAttributeValue_v2,
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withNS()));
+ Assertions.assertEquals(expectedAttributeValue_v2,
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withNS(Collections.emptyList())));
+ }
+
+ @Test
+ public void testToAttributeValueV2_EmptyV2ObjectWhenEmpty_SS() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue expectedAttributeValue_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().build();
+ Assertions.assertEquals(expectedAttributeValue_v2,
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withSS()));
+ Assertions.assertEquals(expectedAttributeValue_v2,
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withSS(Collections.emptyList())));
+ }
+
+ @Test
+ public void testToAttributeValueV2_EmptyV2ObjectWhenEmpty_BS() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue expectedAttributeValue_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().build();
+ Assertions.assertEquals(expectedAttributeValue_v2,
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withBS()));
+ Assertions.assertEquals(expectedAttributeValue_v2,
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withBS(Collections.emptyList())));
+ }
+
+ @Test
+ public void testToAttributeValueV2_EmptyV2ObjectWhenEmpty_L() {
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue expectedAttributeValue_v2 =
+ software.amazon.awssdk.services.dynamodb.model.AttributeValue.builder().l(Collections.emptyList()).build();
+ Assertions.assertEquals(expectedAttributeValue_v2,
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withL()));
+ Assertions.assertEquals(expectedAttributeValue_v2,
+ DynamodbAttributeValueTransformer.toAttributeValueV2(new AttributeValue().withL(Collections.emptyList())));
+ }
+
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbIdentityTransformerTest.java b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbIdentityTransformerTest.java
new file mode 100644
index 000000000..f4ec64be8
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbIdentityTransformerTest.java
@@ -0,0 +1,32 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.services.dynamodb.model.Identity;
+
+class DynamodbIdentityTransformerTest {
+
+ private static final String principalId = "1234567890";
+ private static final String identityType = "type";
+
+ //region Identity_event
+ public static final com.amazonaws.services.lambda.runtime.events.models.dynamodb.Identity identity_event =
+ new com.amazonaws.services.lambda.runtime.events.models.dynamodb.Identity()
+ .withPrincipalId(principalId)
+ .withType(identityType);
+ //endregion
+
+ //region Identity_v2
+ public static final Identity identity_v2 = Identity.builder()
+ .principalId(principalId)
+ .type(identityType)
+ .build();
+ //endregion
+
+ @Test
+ public void testToIdentityV2() {
+ Identity convertedIdentity = DynamodbIdentityTransformer.toIdentityV2(identity_event);
+ Assertions.assertEquals(identity_v2, convertedIdentity);
+ }
+
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbRecordTransformerTest.java b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbRecordTransformerTest.java
new file mode 100644
index 000000000..cd8bbdc88
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbRecordTransformerTest.java
@@ -0,0 +1,63 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb;
+
+import com.amazonaws.services.lambda.runtime.events.DynamodbEvent;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.services.dynamodb.model.OperationType;
+import software.amazon.awssdk.services.dynamodb.model.Record;
+
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbIdentityTransformerTest.identity_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbIdentityTransformerTest.identity_v2;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbStreamRecordTransformerTest.streamRecord_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbStreamRecordTransformerTest.streamRecord_v2;
+
+public class DynamodbRecordTransformerTest {
+
+ private static final String eventId = "2";
+ private static final String eventName = OperationType.MODIFY.toString();
+ private static final String eventVersion = "1.0";
+ private static final String eventSource = "aws:dynamodb";
+ private static final String awsRegion = "us-west-2";
+
+ //region Record_event
+ public static final DynamodbEvent.DynamodbStreamRecord record_event = (DynamodbEvent.DynamodbStreamRecord)
+ new DynamodbEvent.DynamodbStreamRecord()
+ .withEventID(eventId)
+ .withEventName(eventName)
+ .withEventVersion(eventVersion)
+ .withEventSource(eventSource)
+ .withAwsRegion(awsRegion)
+ .withDynamodb(streamRecord_event)
+ .withUserIdentity(identity_event);
+ //endregion
+
+ //region Record_v2
+ public static final Record record_v2 =
+ Record.builder()
+ .eventID(eventId)
+ .eventName(eventName)
+ .eventVersion(eventVersion)
+ .eventSource(eventSource)
+ .awsRegion(awsRegion)
+ .dynamodb(streamRecord_v2)
+ .userIdentity(identity_v2)
+ .build();
+ //endregion
+
+ @Test
+ public void testToRecordV2() {
+ Record convertedRecord = DynamodbRecordTransformer.toRecordV2(record_event);
+ Assertions.assertEquals(record_v2, convertedRecord);
+ }
+
+ @Test
+ public void testToRecordV2WhenUserIdentityIsNull() {
+ DynamodbEvent.DynamodbStreamRecord record = record_event.clone();
+ record.setUserIdentity(null);
+
+ Assertions.assertDoesNotThrow(() -> {
+ DynamodbRecordTransformer.toRecordV2(record);
+ });
+ }
+
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbStreamRecordTransformerTest.java b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbStreamRecordTransformerTest.java
new file mode 100644
index 000000000..d663d1dbf
--- /dev/null
+++ b/aws-lambda-java-events-sdk-transformer/src/test/java/com/amazonaws/services/lambda/runtime/events/transformers/v2/dynamodb/DynamodbStreamRecordTransformerTest.java
@@ -0,0 +1,143 @@
+package com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb;
+
+import com.amazonaws.services.lambda.runtime.events.models.dynamodb.AttributeValue;
+import com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamViewType;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.services.dynamodb.model.StreamRecord;
+import software.amazon.awssdk.utils.ImmutableMap;
+
+import java.util.Date;
+
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueBOOL_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueBOOL_v2;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueBS_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueBS_v2;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueB_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueB_v2;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueL_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueL_v2;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueM_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueM_v2;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueNS_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueNS_v2;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueNUL_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueNUL_v2;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueN_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueN_v2;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueSS_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueSS_v2;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueS_event;
+import static com.amazonaws.services.lambda.runtime.events.transformers.v2.dynamodb.DynamodbAttributeValueTransformerTest.attributeValueS_v2;
+
+class DynamodbStreamRecordTransformerTest {
+
+ private static final String keyNK = "Id";
+ private static final String keyNSK = "KeyNS";
+
+ private static final String keySK = "SKey";
+ private static final String keySSK = "KeySS";
+
+ private static final String keyBK = "BKey";
+ private static final String keyBSK = "KeyBS";
+
+ private static final String keyBOOLK = "IsBool";
+ private static final String keyNULK = "nil";
+
+ private static final String keyMK = "MapKey";
+
+ private static final String keyLK = "LongNum";
+
+ private static final String oldImageSK = "Message";
+ private static final String newImageSK = "Message";
+ private static final String streamViewType = StreamViewType.NEW_AND_OLD_IMAGES.toString();
+ private static final String sequenceNumber = "222";
+ private static final Long sizeBytes = 59L;
+ private static final Date approximateCreationDateTime = new Date();
+
+ //region StreamRecord_event
+ public static final com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord_event =
+ new com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord()
+ .withKeys(ImmutableMap.builder()
+ .put(keyNK, attributeValueN_event)
+ .put(keyNSK, attributeValueNS_event)
+ .put(keySK, attributeValueS_event)
+ .put(keySSK, attributeValueSS_event)
+ .put(keyBK, attributeValueB_event)
+ .put(keyBSK, attributeValueBS_event)
+ .put(keyBOOLK, attributeValueBOOL_event)
+ .put(keyNULK, attributeValueNUL_event)
+ .put(keyMK, attributeValueM_event)
+ .put(keyLK, attributeValueL_event)
+ .build()
+ )
+ .withOldImage(ImmutableMap.of(
+ oldImageSK, attributeValueS_event,
+ keyNK, attributeValueN_event
+ ))
+ .withNewImage(ImmutableMap.of(
+ newImageSK, attributeValueS_event,
+ keyNK, attributeValueN_event
+ ))
+ .withStreamViewType(StreamViewType.fromValue(streamViewType))
+ .withSequenceNumber(sequenceNumber)
+ .withSizeBytes(sizeBytes)
+ .withApproximateCreationDateTime(approximateCreationDateTime);
+ //endregion
+
+ //region StreamRecord_v2
+ public static final StreamRecord streamRecord_v2 = StreamRecord.builder()
+ .approximateCreationDateTime(approximateCreationDateTime.toInstant())
+ .keys(ImmutableMap.builder()
+ .put(keyNK, attributeValueN_v2)
+ .put(keyNSK, attributeValueNS_v2)
+ .put(keySK, attributeValueS_v2)
+ .put(keySSK, attributeValueSS_v2)
+ .put(keyBK, attributeValueB_v2)
+ .put(keyBSK, attributeValueBS_v2)
+ .put(keyBOOLK, attributeValueBOOL_v2)
+ .put(keyNULK, attributeValueNUL_v2)
+ .put(keyMK, attributeValueM_v2)
+ .put(keyLK, attributeValueL_v2)
+ .build()
+ )
+ .oldImage(ImmutableMap.of(
+ oldImageSK, attributeValueS_v2,
+ keyNK, attributeValueN_v2
+ ))
+ .newImage(ImmutableMap.of(
+ newImageSK, attributeValueS_v2,
+ keyNK, attributeValueN_v2
+ ))
+ .sequenceNumber(sequenceNumber)
+ .sizeBytes(sizeBytes)
+ .streamViewType(streamViewType)
+ .build();
+ //endregion
+
+ @Test
+ public void testToStreamRecordV2() {
+ StreamRecord convertedStreamRecord = DynamodbStreamRecordTransformer.toStreamRecordV2(streamRecord_event);
+ Assertions.assertEquals(streamRecord_v2, convertedStreamRecord);
+ }
+
+ @Test
+ public void testToStreamRecordV2WhenOldImageIsNull() {
+ com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord = streamRecord_event.clone();
+ streamRecord.setOldImage(null);
+
+ Assertions.assertDoesNotThrow(() -> {
+ DynamodbStreamRecordTransformer.toStreamRecordV2(streamRecord);
+ });
+ }
+
+ @Test
+ public void testToStreamRecordV2WhenNewImageIsNull() {
+ com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord = streamRecord_event.clone();
+ streamRecord.setNewImage(null);
+
+ Assertions.assertDoesNotThrow(() -> {
+ DynamodbStreamRecordTransformer.toStreamRecordV2(streamRecord);
+ });
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/README.md b/aws-lambda-java-events/README.md
index 7c7d31717..43c25d76a 100644
--- a/aws-lambda-java-events/README.md
+++ b/aws-lambda-java-events/README.md
@@ -1,114 +1,67 @@
-# AWS Lambda Java Events v2.0
+# AWS Lambda Java Events v3
-### New Event Models Supported
-* APIGatewayProxyRequestEvent
-* APIGatewayProxyResponseEvent
-* APIGatewayV2ProxyRequestEvent
-* APIGatewayV2ProxyResponseEvent
-* CloudFrontEvent
-* CloudWatchLogsEvent
-* CodeCommitEvent
-* IoTButtonEvent
-* KinesisFirehoseEvent
-* LexEvent
-* ScheduledEvent
+### Event Models Supported
+* `ActiveMQEvent`
+* `APIGatewayCustomAuthorizerEvent`
+* `APIGatewayProxyRequestEvent`
+* `APIGatewayProxyResponseEvent`
+* `APIGatewayV2CustomAuthorizerEvent`
+* `APIGatewayV2HTTPEvent`
+* `APIGatewayV2HTTPResponse`
+* `APIGatewayV2WebSocketEvent`
+* `APIGatewayV2WebSocketResponse`
+* `ApplicationLoadBalancerRequestEvent`
+* `ApplicationLoadBalancerResponseEvent`
+* `AppSyncLambdaAuthorizerEvent`
+* `AppSyncLambdaAuthorizerResponse`
+* `CloudFormationCustomResourceEvent`
+* `CloudFrontEvent`
+* `CloudWatchCompositeAlarmEvent`
+* `CloudWatchLogsEvent`
+* `CloudWatchMetricAlarmEvent`
+* `CodeCommitEvent`
+* `CognitoEvent`
+* `CognitoUserPoolCreateAuthChallengeEvent`
+* `CognitoUserPoolCustomMessageEvent`
+* `CognitoUserPoolDefineAuthChallengeEvent`
+* `CognitoUserPoolEvent`
+* `CognitoUserPoolMigrateUserEvent`
+* `CognitoUserPoolPostAuthenticationEvent`
+* `CognitoUserPoolPostConfirmationEvent`
+* `CognitoUserPoolPreAuthenticationEvent`
+* `CognitoUserPoolPreSignUpEvent`
+* `CognitoUserPoolPreTokenGenerationEvent`
+* `CognitoUserPoolPreTokenGenerationEventV2`
+* `CognitoUserPoolVerifyAuthChallengeResponseEvent`
+* `ConfigEvent`
+* `ConnectEvent`
+* `DynamodbEvent`
+* `IoTButtonEvent`
+* `KafkaEvent`
+* `KinesisAnalyticsFirehoseInputPreprocessingEvent`
+* `KinesisAnalyticsInputPreprocessingResponse`
+* `KinesisAnalyticsOutputDeliveryEvent`
+* `KinesisAnalyticsOutputDeliveryResponse`
+* `KinesisAnalyticsStreamsInputPreprocessingEvent`
+* `KinesisEvent`
+* `KinesisFirehoseEvent`
+* `LambdaDestinationEvent`
+* `LexEvent`
+* `MSKFirehoseEvent`
+* `MSKFirehoseResponse`
+* `RabbitMQEvent`
+* `S3BatchEvent`
+* `S3BatchResponse`
+* `S3Event`
+* `ScheduledEvent`
+* `SecretsManagerRotationEvent`
+* `SimpleIAMPolicyResponse`
+* `SNSEvent`
+* `SQSBatchResponse`
+* `SQSEvent`
-### New package inclusion model
-The old package inclusion model required users to pull unused dependencies into
-their package. We have removed this inclusion so that users' jars will be
-smaller, which will results in reduced latency times. Customers using older
-versions do not need to make any changes to their existing code.
-The following event models do not require any SDK dependencies
-* APIGatewayProxyRequestEvent
-* APIGatewayProxyResponseEvent
-* APIGatewayV2ProxyRequestEvent
-* APIGatewayV2ProxyResponseEvent
-* CloudFrontEvent
-* CloudWatchLogsEvent
-* CodeCommitEvent
-* CognitoEvent
-* ConfigEvent
-* IoTButtonEvent
-* KinesisFirehoseEvent
-* LexEvent
-* ScheduledEvent
-* SNSEvent
-
-so the dependencies section in the pom.xml file would like this
-
-```xml
-
- ...
-
- com.amazonaws
- aws-lambda-java-core
- 1.1.0
-
-
- com.amazonaws
- aws-lambda-java-events
- 2.2.7
-
- ...
-
-```
-
-#### S3 Event
-
-For the S3 event the pom would look like this:
-
-```xml
-
- ...
-
- com.amazonaws
- aws-lambda-java-core
- 1.1.0
-
-
- com.amazonaws
- aws-lambda-java-events
- 2.2.7
-
-
- com.amazonaws
- aws-java-sdk-s3
- 1.11.163
-
- ...
-
-```
-
-#### Kinesis Event
-
-For the Kinesis event
-
-```xml
-
- ....
-
- com.amazonaws
- aws-lambda-java-core
- 1.1.0
-
-
- com.amazonaws
- aws-lambda-java-events
- 2.2.7
-
-
- com.amazonaws
- aws-java-sdk-kinesis
- 1.11.163
-
- ...
-
-```
-
-#### Dynamodb Event
-
-For the Dynamodb event
+### Usage
```xml
@@ -116,17 +69,12 @@ For the Dynamodb event
com.amazonaws
aws-lambda-java-core
- 1.1.0
+ 1.2.3
com.amazonaws
aws-lambda-java-events
- 2.2.7
-
-
- com.amazonaws
- aws-java-sdk-dynamodb
- 1.11.163
+ 3.16.0
...
diff --git a/aws-lambda-java-events/RELEASE.CHANGELOG.md b/aws-lambda-java-events/RELEASE.CHANGELOG.md
new file mode 100644
index 000000000..a4bcd10a0
--- /dev/null
+++ b/aws-lambda-java-events/RELEASE.CHANGELOG.md
@@ -0,0 +1,278 @@
+### June 17, 2025
+`3.16.0`:
+- Add Schema metadata related attributes in KafkaEvent ([#548](https://github.com/aws/aws-lambda-java-libs/pull/548))
+
+### January 31, 2025
+`3.15.0`:
+- Fix `CognitoUserPoolPreTokenGenerationEventV2` model ([#519](https://github.com/aws/aws-lambda-java-libs/pull/519))
+- Add RotationToken to SecretsManagerRotationEvent ([#520](https://github.com/aws/aws-lambda-java-libs/pull/520))
+
+
+### September 13, 2024
+`3.14.0`:
+- Fix name of s3Bucket field of Task class in S3BatchEventV2 ([#506](https://github.com/aws/aws-lambda-java-libs/pull/506))
+
+### July 29, 2024
+`3.13.0`:
+- Add S3BatchEventV2 ([#496](https://github.com/aws/aws-lambda-java-libs/pull/496))
+
+### July 11, 2024
+`3.12.0`:
+- Added the object representations of the CloudWatch alarms([#493](https://github.com/aws/aws-lambda-java-libs/pull/493))
+- Added event class MskFirehoseEvent.java for Firehose Lambda transformation when MSK is the source([#490](https://github.com/aws/aws-lambda-java-libs/pull/490))
+
+### June 11, 2024
+`3.11.6`:
+- Add the V2 version of the pre token generation event([#465](https://github.com/aws/aws-lambda-java-libs/pull/465))
+
+### April 12, 2024
+`3.11.5`:
+- Add requestHeaders field for Appsync lambda authorizer event([#473](https://github.com/aws/aws-lambda-java-libs/pull/473))
+
+### December 1, 2023
+`3.11.4`:
+- Improve `toString` in Cognito events by calling `super`
+- Added missing `version` field to ScheduledEvent from CloudWatch
+
+### September 1, 2023
+`3.11.3`:
+- Update challengeAnswer field format in CognitoUserPoolEvent
+
+### May 18, 2023
+`3.11.2`:
+- Add missing fields to API Gateway request context
+
+### March 10, 2023
+`3.11.1`:
+- Extended ActiveMQEvent with custom properties ([#408](https://github.com/aws/aws-lambda-java-libs/pull/408))
+- Updated dependencies([#410](https://github.com/aws/aws-lambda-java-libs/pull/410)):
+ - `joda-time` from 2.6 to 2.10.8
+ - `jackson-databind` from 2.13.4.1 to 2.14.2
+ - `junit-jupiter-engine` from 5.7.0 to 5.9.2
+ - `json-unit-assertj` from 2.22.0 to 2.36.1
+
+### November 24, 2021
+`3.11.0`:
+- Added support for SQSaaES Partial Batch Feature ([#279](https://github.com/aws/aws-lambda-java-libs/pull/279))
+ - `SQSBatchResponse`
+
+### August 26, 2021
+`3.10.0`:
+- Added headers in `KafkaEventRecord` ([#260](https://github.com/aws/aws-lambda-java-libs/pull/260))
+- Added support for AppSync Lambda Authorizer ([#263](https://github.com/aws/aws-lambda-java-libs/pull/263))
+ - `AppSyncLambdaAuthorizerEvent`
+ - `AppSyncLambdaAuthorizerResponse`
+- Added support for RabbitMQ Event ([#256](https://github.com/aws/aws-lambda-java-libs/pull/256))
+ - `RabbitMQEvent`
+- Added missing `version` field to `APIGatewayProxyRequestEvent` ([#258](https://github.com/aws/aws-lambda-java-libs/pull/258))
+
+### June 2, 2021
+`3.9.0`:
+- Added support for Cognito User Pool events ([#175](https://github.com/aws/aws-lambda-java-libs/pull/175))
+ - `CognitoUserPoolCreateAuthChallengeEvent`
+ - `CognitoUserPoolCustomMessageEvent`
+ - `CognitoUserPoolDefineAuthChallengeEvent`
+ - `CognitoUserPoolEvent`
+ - `CognitoUserPoolMigrateUserEvent`
+ - `CognitoUserPoolPostAuthenticationEvent`
+ - `CognitoUserPoolPostConfirmationEvent`
+ - `CognitoUserPoolPreAuthenticationEvent`
+ - `CognitoUserPoolPreSignUpEvent`
+ - `CognitoUserPoolPreTokenGenerationEvent`
+ - `CognitoUserPoolVerifyAuthChallengeResponseEvent`
+- Added support for IAM Policy Responses for API Gateway REST APIs ([#213](https://github.com/aws/aws-lambda-java-libs/pull/213))
+ - `IamPolicyResponseV1`
+- Added default IntelliJ equals, hashCode and toString methods to `APIGatewayV2WebSocketEvent` ([#248](https://github.com/aws/aws-lambda-java-libs/pull/248))
+- Fixed toString method in `KinesisEvent` ([#245](https://github.com/aws/aws-lambda-java-libs/pull/245))
+- Changed `body` field to lowercase in `APIGatewayV2HTTPEvent` ([#236](https://github.com/aws/aws-lambda-java-libs/pull/236))
+- Added `principalOrgId` field to `APIGatewayProxyRequestEvent` ([#247](https://github.com/aws/aws-lambda-java-libs/pull/247))
+
+### March 24, 2021
+`3.8.0`:
+- Added support for S3 Object Lambda event ([#229](https://github.com/aws/aws-lambda-java-libs/pull/229))
+ - `S3ObjectLambdaEvent`
+- Added support for IAM Policy response ([#213](https://github.com/aws/aws-lambda-java-libs/pull/213))
+ - `IamPolicyResponse`
+- Added `bootstrapServers` to `KafkaEvent` ([#216](https://github.com/aws/aws-lambda-java-libs/pull/216))
+- Added `requestId` to `APIGatewayV2HTTPEvent` ([#230](https://github.com/aws/aws-lambda-java-libs/pull/230))
+- Added `multiValueHeaders` to `APIGatewayProxyResponseEvent` ([#228](https://github.com/aws/aws-lambda-java-libs/pull/228))
+- Bumped `jackson-databind` from `2.10.4` to `2.10.5.1` ([#231](https://github.com/aws/aws-lambda-java-libs/pull/231))
+
+### December 16, 2020
+`3.7.0`:
+- Added support for StreamAnalytics and CustomCheckpointing ([#202](https://github.com/aws/aws-lambda-java-libs/pull/202))
+ - `DynamodbTimeWindowEvent`
+ - `KinesisTimeWindowEvent`
+ - `StreamsEventResponse`
+ - `TimeWindowEventResponse`
+
+### November 06, 2020
+`3.6.0`:
+- Added support for Amazon `ActiveMQ` event: ([#185](https://github.com/aws/aws-lambda-java-libs/pull/185))
+- Bumped `junit-jupiter-engine` to version `5.7.0`
+- Bumped `lombok` to version `1.18.16`
+
+### October 28, 2020
+`3.5.0`:
+- Added support for S3 Batch events: ([#179](https://github.com/aws/aws-lambda-java-libs/pull/179))
+ - `S3BatchEvent`
+ - `S3BatchResponse`
+
+### October 07, 2020
+`3.4.0`:
+- Added Lambda and IAM authorizers to `APIGatewayV2HTTPEvent` request context ([#167](https://github.com/aws/aws-lambda-java-libs/pull/167))
+- Added support for API Gateway custom authorizer: ([#166](https://github.com/aws/aws-lambda-java-libs/pull/166))
+ - `APIGatewayCustomAuthorizerEvent`
+ - `APIGatewayV2CustomAuthorizerEvent`
+ - `SimpleIAMPolicyResponse`
+
+### September 23, 2020
+`3.3.1`:
+- Added `multiValueQueryStringParameters` to `ApplicationLoadBalancerRequestEvent` ([#163](https://github.com/aws/aws-lambda-java-libs/pull/163))
+
+### September 14, 2020
+`3.3.0`:
+- Added support for Secrets Manager Rotation Event ([#130](https://github.com/aws/aws-lambda-java-libs/pull/130))
+- Added support for CloudFormation Custom Resource Event ([#138](https://github.com/aws/aws-lambda-java-libs/pull/138))
+- Added support for Lambda Destination Event ([#139](https://github.com/aws/aws-lambda-java-libs/pull/139))
+- Added support for Amazon Connect Event ([#140](https://github.com/aws/aws-lambda-java-libs/pull/140))
+
+### August 11, 2020
+`3.2.0`:
+- Added support for Kafka Events ([#154](https://github.com/aws/aws-lambda-java-libs/pull/154))
+
+### July 31, 2020
+`3.1.1`:
+- Fixed Base64 encoding for ALB and API Gateway HTTP events ([#150](https://github.com/aws/aws-lambda-java-libs/pull/131))
+
+### May 20, 2020
+`3.1.0`:
+- Added support for Application Load Balancer Target Events ([#131](https://github.com/aws/aws-lambda-java-libs/pull/131))
+ - `ApplicationLoadBalancerRequestEvent`
+ - `ApplicationLoadBalancerResponseEvent`
+- Added support for API Gateway HTTP API Events ([#123](https://github.com/aws/aws-lambda-java-libs/pull/123))
+ - `APIGatewayV2HTTPEvent`
+ - `APIGatewayV2HTTPResponse`
+- Aliased the existing APIGatewayV2Proxy classes as `APIGatewayV2WebSocketEvent`/`APIGatewayV2WebSocketResponse` ([#125](https://github.com/aws/aws-lambda-java-libs/pull/125))
+
+### May 18, 2020
+`3.0.0`:
+- Removed AWS SDK v1 dependencies ([#74](https://github.com/aws/aws-lambda-java-libs/issues/74))
+ - Copied relevant S3, Kinesis and DynamoDB model classes under namespace `com.amazonaws.services.lambda.runtime.events.models`
+ - S3:
+ - `S3EventNotification`
+ - Kinesis:
+ - `EncryptionType`
+ - `Record`
+ - DynamoDB:
+ - `AttributeValue`
+ - `Identity`
+ - `OperationType`
+ - `Record`
+ - `StreamRecord`
+ - `StreamViewType`
+
+### May 13, 2020
+`2.2.9`:
+- Added field `operationName` to `APIGatewayProxyRequestEvent` ([#126](https://github.com/aws/aws-lambda-java-libs/pull/126))
+
+### April 28, 2020
+`2.2.8`:
+- Added missing XML namespace declarations to `pom.xml` file ([#97](https://github.com/aws/aws-lambda-java-libs/issues/97))
+- Updated `nexusUrl` in `pom.xml` file ([#108](https://github.com/aws/aws-lambda-java-libs/issues/108))
+
+### August 13, 2019
+`2.2.7`:
+- Added support for APIGatewayV2 (Web Sockets) ([#92](https://github.com/aws/aws-lambda-java-libs/issues/92))
+ - `APIGatewayV2ProxyRequestEvent`
+ - `APIGatewayV2ProxyResponseEvent`
+- Fixed typo in `CognitoEvent` javadoc ([#87](https://github.com/aws/aws-lambda-java-libs/issues/87))
+
+### March 11, 2019
+`2.2.6`:
+- Added field `customData` to `CommitEvent.Record` ([#79](https://github.com/aws/aws-lambda-java-libs/issues/79))
+- Added field `isBase64Encoded` to `APIGatewayProxyResponseEvent` ([#48](https://github.com/aws/aws-lambda-java-libs/issues/48))
+- Added field `authorizer` to `APIGatewayProxyRequestEvent` ([#77](https://github.com/aws/aws-lambda-java-libs/issues/77))
+
+### January 03, 2019
+`2.2.5`:
+- Fixed "Paramters" typo in `APIGatewayProxyRequestEvent` and `ConfigEvent` ([#65](https://github.com/aws/aws-lambda-java-libs/issues/65))
+
+### November 14, 2018
+`2.2.4`:
+- Added default constructor for `S3Event` for easier deserialization
+
+### November 05, 2018
+`2.2.3`:
+- Added support for Multi-Value Headers and Query String Parameters to `APIGatewayProxyRequestEvent` ([#60](https://github.com/aws/aws-lambda-java-libs/issues/60))
+
+### July 02, 2018
+`2.2.2`:
+- Made `SQSEvent.SQSMessage` default constructor public ([#51](https://github.com/aws/aws-lambda-java-libs/issues/51))
+
+### June 29, 2018
+`2.2.1`:
+- Made `SQSEvent.SQSMessage` public ([#51](https://github.com/aws/aws-lambda-java-libs/issues/51))
+
+### June 28, 2018
+`2.2.0`:
+- Added `SQSEvent`
+
+### March 09, 2018
+`2.1.0`:
+- Added Kinesis Analytics events
+ - `KinesisAnalyticsFirehoseInputPreprocessingEvent`
+ - `KinesisAnalyticsInputPreprocessingResponse`
+ - `KinesisAnalyticsOutputDeliveryEvent`
+ - `KinesisAnalyticsOutputDeliveryResponse`
+ - `KinesisAnalyticsStreamsInputPreprocessingEvent`
+
+### November 21, 2017
+`2.0.2`:
+- Added missing fields to `APIGatewayProxyRequestEvent` ([#46](https://github.com/aws/aws-lambda-java-libs/issues/46))
+
+### October 07, 2017
+`2.0.1`:
+- Updated KinesisFirehose event schema.
+ - `approximateArrivalTimestamp` is now represented as a millisecond epoch instead of an `org.joda.time.DateTime` object.
+
+### September 20, 2017
+`2.0`:
+- Added the following events:
+ - `APIGatewayProxyRequestEvent`
+ - `APIGatewayProxyResponseEvent`
+ - `CloudFrontEvent`
+ - `CloudWatchLogsEvent`
+ - `CodeCommitEvent`
+ - `IoTButtonEvent`
+ - `KinesisFirehoseEvent`
+ - `LexEvent`
+ - `ScheduledEvent`
+- Changed dependency management; Users must now supply the SDK package if they are using an event that is connected to an SDK library.
+ - These events are `S3Event`, `KinesisEvemt`, and `DynamodbEvent`.
+- Bumped AWS SDK versions to `1.11.163`
+
+
+### May 16, 2016
+`1.3.0`:
+- Bumped AWS SDK versions to `1.11.0`
+
+### May 16, 2016
+`1.2.1`:
+- Bumped AWS SDK versions to `1.10.77`
+
+### April 22, 2016
+`1.2.0`:
+- Added `ConfigEvent`
+
+### August 21, 2015
+`1.1.0`:
+- Added `DynamodbEvent`
+
+### June 15, 2015
+`1.0.0`:
+- Initial support for java in AWS Lambda, includes the following events:
+ - `CognitoEvent`
+ - `KinesisEvent`
+ - `S3Event`
+ - `SNSEvent`
diff --git a/aws-lambda-java-events/pom.xml b/aws-lambda-java-events/pom.xml
index 43724dd9e..714c825d9 100644
--- a/aws-lambda-java-events/pom.xml
+++ b/aws-lambda-java-events/pom.xml
@@ -1,153 +1,192 @@
- 4.0.0
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
+ 4.0.0
- com.amazonaws
- aws-lambda-java-events
- 2.2.7
- jar
+ com.amazonaws
+ aws-lambda-java-events
+ 3.16.1
+ jar
- AWS Lambda Java Events Library
-
- Event interface definitions AWS services supported by AWS Lambda.
-
- https://aws.amazon.com/lambda/
-
-
- Apache License, Version 2.0
- https://aws.amazon.com/apache2.0
- repo
-
-
-
- https://github.com/aws/aws-lambda-java-libs.git
-
-
-
- AWS Lambda team
- Amazon Web Services
- https://aws.amazon.com/
-
-
+ AWS Lambda Java Events Library
+
+ Event interface definitions AWS services supported by AWS Lambda.
+
+ https://aws.amazon.com/lambda/
+
+
+ Apache License, Version 2.0
+ https://aws.amazon.com/apache2.0
+ repo
+
+
+
+ https://github.com/aws/aws-lambda-java-libs.git
+
+
+
+ AWS Lambda team
+ Amazon Web Services
+ https://aws.amazon.com/
+
+
-
-
- sonatype-nexus-staging
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
-
-
+
+ 1.8
+ 1.8
+ 1.18.22
+ UTF-8
+ UTF-8
+ 2.20.1
+ 2.40.1
+
-
-
- joda-time
- joda-time
- 2.6
-
-
- com.amazonaws
- aws-java-sdk-s3
- 1.11.163
- provided
-
-
- com.amazonaws
- aws-java-sdk-kinesis
- 1.11.163
- provided
-
-
- com.amazonaws
- aws-java-sdk-dynamodb
- 1.11.163
- provided
-
-
+
+
+ sonatype-nexus-staging
+ https://oss.sonatype.org/service/local/staging/deploy/maven2/
+
+
-
-
- dev
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 2.9.1
-
- -Xdoclint:none
-
-
-
- attach-javadocs
-
- jar
-
-
-
-
-
-
-
-
- release
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 2.2.1
-
-
- attach-sources
-
- jar-no-fork
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 2.9.1
-
- -Xdoclint:none
-
-
-
- attach-javadocs
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- 1.5
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.3
- true
-
- sonatype-nexus-staging
- https://oss.sonatype.org/
- false
-
-
-
-
-
-
-
+
+
+ joda-time
+ joda-time
+ 2.10.8
+
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ 5.9.2
+ test
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson.version}
+ test
+
+
+ net.javacrumbs.json-unit
+ json-unit-assertj
+ ${json.unit}
+ test
+
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+ provided
+
+
+
+
+
+ dev
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.9.1
+
+ -Xdoclint:none
+
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+
+
+
+ release
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.2.1
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.9.1
+
+ -Xdoclint:none
+
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.5
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+ org.sonatype.central
+ central-publishing-maven-plugin
+ 0.8.0
+ true
+
+ central
+
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ 3.3.1
+
+ UTF-8
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.11.0
+
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+
+
+ UTF-8
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayCustomAuthorizerEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayCustomAuthorizerEvent.java
new file mode 100644
index 000000000..728833195
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayCustomAuthorizerEvent.java
@@ -0,0 +1,59 @@
+package com.amazonaws.services.lambda.runtime.events;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Map;
+
+/**
+ * The API Gateway customer authorizer event object as described - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html
+ *
+ */
+
+@Data
+@Builder(setterPrefix = "with")
+@NoArgsConstructor
+@AllArgsConstructor
+public class APIGatewayCustomAuthorizerEvent {
+
+ private String version;
+ private String type;
+ private String methodArn;
+ private String identitySource;
+ private String authorizationToken;
+ private String resource;
+ private String path;
+ private String httpMethod;
+ private Map headers;
+ private Map queryStringParameters;
+ private Map pathParameters;
+ private Map stageVariables;
+ private RequestContext requestContext;
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class RequestContext {
+ private String path;
+ private String accountId;
+ private String resourceId;
+ private String stage;
+ private String requestId;
+ private Identity identity;
+ private String resourcePath;
+ private String httpMethod;
+ private String apiId;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class Identity {
+ private String apiKey;
+ private String sourceIp;
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java
index 68ca91da1..8ff8ccb8b 100644
--- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java
@@ -11,6 +11,8 @@ public class APIGatewayProxyRequestEvent implements Serializable, Cloneable {
private static final long serialVersionUID = 4189228800688527467L;
+ private String version;
+
private String resource;
private String path;
@@ -50,6 +52,8 @@ public static class ProxyRequestContext implements Serializable, Cloneable {
private String requestId;
+ private String operationName;
+
private RequestIdentity identity;
private String resourcePath;
@@ -62,6 +66,18 @@ public static class ProxyRequestContext implements Serializable, Cloneable {
private Map authorizer;
+ private String extendedRequestId;
+
+ private String requestTime;
+
+ private Long requestTimeEpoch;
+
+ private String domainName;
+
+ private String domainPrefix;
+
+ private String protocol;
+
/**
* default constructor
*/
@@ -282,6 +298,164 @@ public ProxyRequestContext withPath(String path) {
return this;
}
+ /**
+ * @return The name of the operation being performed
+ * */
+ public String getOperationName() {
+ return operationName;
+ }
+
+ /**
+ * @param operationName The name of the operation being performed
+ * */
+ public void setOperationName(String operationName) {
+ this.operationName = operationName;
+ }
+
+ public ProxyRequestContext withOperationName(String operationName) {
+ this.setOperationName(operationName);
+ return this;
+ }
+
+ /**
+ * @return The API Gateway Extended Request Id
+ */
+ public String getExtendedRequestId() {
+ return extendedRequestId;
+ }
+
+ /**
+ * @param extendedRequestId The API Gateway Extended Request Id
+ */
+ public void setExtendedRequestId(String extendedRequestId) {
+ this.extendedRequestId = extendedRequestId;
+ }
+
+ /**
+ * @param extendedRequestId The API Gateway Extended Request Id
+ * @return ProxyRequestContext object
+ */
+ public ProxyRequestContext withExtendedRequestId(String extendedRequestId) {
+ this.setExtendedRequestId(extendedRequestId);
+ return this;
+ }
+
+ /**
+ * @return The CLF-formatted request time (dd/MMM/yyyy:HH:mm:ss +-hhmm).
+ */
+ public String getRequestTime() {
+ return requestTime;
+ }
+
+ /**
+ * @param requestTime The CLF-formatted request time (dd/MMM/yyyy:HH:mm:ss +-hhmm).
+ */
+ public void setRequestTime(String requestTime) {
+ this.requestTime = requestTime;
+ }
+
+ /**
+ * @param requestTime The CLF-formatted request time (dd/MMM/yyyy:HH:mm:ss +-hhmm).
+ * @return ProxyRequestContext object
+ */
+ public ProxyRequestContext withRequestTime(String requestTime) {
+ this.setRequestTime(requestTime);
+ return this;
+ }
+
+ /**
+ * @return The Epoch-formatted request time (in millis)
+ */
+ public Long getRequestTimeEpoch() {
+ return requestTimeEpoch;
+ }
+
+ /**
+ * @param requestTimeEpoch The Epoch-formatted request time (in millis)
+ */
+ public void setRequestTimeEpoch(Long requestTimeEpoch) {
+ this.requestTimeEpoch = requestTimeEpoch;
+ }
+
+ /**
+ * @param requestTimeEpoch The Epoch-formatted request time (in millis)
+ * @return ProxyRequestContext object
+ */
+ public ProxyRequestContext withRequestTimeEpoch(Long requestTimeEpoch) {
+ this.setRequestTimeEpoch(requestTimeEpoch);
+ return this;
+ }
+
+ /**
+ * @return The full domain name used to invoke the API. This should be the same as the incoming Host header.
+ */
+ public String getDomainName() {
+ return domainName;
+ }
+
+ /**
+ * @param domainName The full domain name used to invoke the API.
+ * This should be the same as the incoming Host header.
+ */
+ public void setDomainName(String domainName) {
+ this.domainName = domainName;
+ }
+
+ /**
+ * @param domainName The full domain name used to invoke the API.
+ * This should be the same as the incoming Host header.
+ * @return ProxyRequestContext object
+ */
+ public ProxyRequestContext withDomainName(String domainName) {
+ this.setDomainName(domainName);
+ return this;
+ }
+
+ /**
+ * @return The first label of the domainName. This is often used as a caller/customer identifier.
+ */
+ public String getDomainPrefix() {
+ return domainPrefix;
+ }
+
+ /**
+ * @param domainPrefix The first label of the domainName. This is often used as a caller/customer identifier.
+ */
+ public void setDomainPrefix(String domainPrefix) {
+ this.domainPrefix = domainPrefix;
+ }
+
+ /**
+ * @param domainPrefix The first label of the domainName. This is often used as a caller/customer identifier.
+ * @return
+ */
+ public ProxyRequestContext withDomainPrefix(String domainPrefix) {
+ this.setDomainPrefix(domainPrefix);
+ return this;
+ }
+ /**
+ * @return The request protocol, for example, HTTP/1.1.
+ */
+ public String getProtocol() {
+ return protocol;
+ }
+
+ /**
+ * @param protocol The request protocol, for example, HTTP/1.1.
+ */
+ public void setProtocol(String protocol) {
+ this.protocol = protocol;
+ }
+
+ /**
+ * @param protocol The request protocol, for example, HTTP/1.1.
+ * @return ProxyRequestContext object
+ */
+ public ProxyRequestContext withProtocol(String protocol) {
+ this.setProtocol(protocol);
+ return this;
+ }
+
/**
* Returns a string representation of this object; useful for testing and debugging.
*
@@ -313,6 +487,20 @@ public String toString() {
sb.append("path: ").append(getPath()).append(",");
if (getAuthorizer() != null)
sb.append("authorizer: ").append(getAuthorizer().toString());
+ if (getOperationName() != null)
+ sb.append("operationName: ").append(getOperationName().toString());
+ if (getExtendedRequestId() != null)
+ sb.append("extendedRequestId: ").append(getExtendedRequestId()).append(",");
+ if (getRequestTime() != null)
+ sb.append("requestTime: ").append(getRequestTime()).append(",");
+ if (getProtocol() != null)
+ sb.append("protocol: ").append(getProtocol()).append(",");
+ if (getRequestTimeEpoch() != null)
+ sb.append("requestTimeEpoch: ").append(getRequestTimeEpoch()).append(",");
+ if (getDomainPrefix() != null)
+ sb.append("domainPrefix: ").append(getDomainPrefix()).append(",");
+ if (getDomainName() != null)
+ sb.append("domainName: ").append(getDomainName());
sb.append("}");
return sb.toString();
}
@@ -367,6 +555,34 @@ public boolean equals(Object obj) {
return false;
if (other.getAuthorizer() != null && !other.getAuthorizer().equals(this.getAuthorizer()))
return false;
+ if (other.getOperationName() == null ^ this.getOperationName() == null)
+ return false;
+ if (other.getOperationName() != null && !other.getOperationName().equals(this.getOperationName()))
+ return false;
+ if (other.getExtendedRequestId() == null ^ this.getExtendedRequestId() == null)
+ return false;
+ if (other.getExtendedRequestId() != null && other.getExtendedRequestId().equals(this.getExtendedRequestId()) == false)
+ return false;
+ if (other.getRequestTime() == null ^ this.getRequestTime() == null)
+ return false;
+ if (other.getRequestTime() != null && other.getRequestTime().equals(this.getRequestTime()) == false)
+ return false;
+ if (other.getRequestTimeEpoch() == null ^ this.getRequestTimeEpoch() == null)
+ return false;
+ if (other.getRequestTimeEpoch() != null && other.getRequestTimeEpoch().equals(this.getRequestTimeEpoch()) == false)
+ return false;
+ if (other.getDomainName() == null ^ this.getDomainName() == null)
+ return false;
+ if (other.getDomainName() != null && other.getDomainName().equals(this.getDomainName()) == false)
+ return false;
+ if (other.getDomainPrefix() == null ^ this.getDomainPrefix() == null)
+ return false;
+ if (other.getDomainPrefix() != null && other.getDomainPrefix().equals(this.getDomainPrefix()) == false)
+ return false;
+ if (other.getProtocol() == null ^ this.getProtocol() == null)
+ return false;
+ if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == false)
+ return false;
return true;
}
@@ -385,6 +601,13 @@ public int hashCode() {
hashCode = prime * hashCode + ((getApiId() == null) ? 0 : getApiId().hashCode());
hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode());
hashCode = prime * hashCode + ((getAuthorizer() == null) ? 0 : getAuthorizer().hashCode());
+ hashCode = prime * hashCode + ((getOperationName() == null) ? 0: getOperationName().hashCode());
+ hashCode = prime * hashCode + ((getExtendedRequestId() == null) ? 0 : getExtendedRequestId().hashCode());
+ hashCode = prime * hashCode + ((getRequestTime() == null) ? 0 : getRequestTime().hashCode());
+ hashCode = prime * hashCode + ((getRequestTimeEpoch() == null) ? 0 : getRequestTimeEpoch().hashCode());
+ hashCode = prime * hashCode + ((getDomainName() == null) ? 0 : getDomainName().hashCode());
+ hashCode = prime * hashCode + ((getDomainPrefix() == null) ? 0 : getDomainPrefix().hashCode());
+ hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode());
return hashCode;
}
@@ -396,7 +619,6 @@ public ProxyRequestContext clone() {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
}
}
-
}
public static class RequestIdentity implements Serializable, Cloneable {
@@ -413,6 +635,8 @@ public static class RequestIdentity implements Serializable, Cloneable {
private String apiKey;
+ private String principalOrgId;
+
private String sourceIp;
private String cognitoAuthenticationType;
@@ -547,6 +771,29 @@ public RequestIdentity withApiKey(String apiKey) {
return this;
}
+ /**
+ * @return the principal org Id
+ */
+ public String getPrincipalOrgId() {
+ return principalOrgId;
+ }
+
+ /**
+ * @param principalOrgId the principal org Id
+ */
+ public void setPrincipalOrgId(String principalOrgId) {
+ this.principalOrgId = principalOrgId;
+ }
+
+ /**
+ * @param principalOrgId the principal org Id
+ * @return RequestIdentity object
+ */
+ public RequestIdentity withPrincipalOrgId(String principalOrgId) {
+ this.setPrincipalOrgId(principalOrgId);
+ return this;
+ }
+
/**
* @return source ip address
*/
@@ -729,6 +976,8 @@ public String toString() {
sb.append("caller: ").append(getCaller()).append(",");
if (getApiKey() != null)
sb.append("apiKey: ").append(getApiKey()).append(",");
+ if (getPrincipalOrgId() != null)
+ sb.append("principalOrgId: ").append(getPrincipalOrgId()).append(",");
if (getSourceIp() != null)
sb.append("sourceIp: ").append(getSourceIp()).append(",");
if (getCognitoAuthenticationType() != null)
@@ -777,6 +1026,10 @@ public boolean equals(Object obj) {
return false;
if (other.getApiKey() != null && other.getApiKey().equals(this.getApiKey()) == false)
return false;
+ if (other.getPrincipalOrgId() == null ^ this.getPrincipalOrgId() == null)
+ return false;
+ if (other.getPrincipalOrgId() != null && other.getPrincipalOrgId().equals(this.getPrincipalOrgId()) == false)
+ return false;
if (other.getSourceIp() == null ^ this.getSourceIp() == null)
return false;
if (other.getSourceIp() != null && other.getSourceIp().equals(this.getSourceIp()) == false)
@@ -819,6 +1072,7 @@ public int hashCode() {
hashCode = prime * hashCode + ((getCognitoIdentityId() == null) ? 0 : getCognitoIdentityId().hashCode());
hashCode = prime * hashCode + ((getCaller() == null) ? 0 : getCaller().hashCode());
hashCode = prime * hashCode + ((getApiKey() == null) ? 0 : getApiKey().hashCode());
+ hashCode = prime * hashCode + ((getPrincipalOrgId() == null) ? 0 : getPrincipalOrgId().hashCode());
hashCode = prime * hashCode + ((getSourceIp() == null) ? 0 : getSourceIp().hashCode());
hashCode = prime * hashCode + ((getCognitoAuthenticationType() == null) ? 0 : getCognitoAuthenticationType().hashCode());
hashCode = prime * hashCode + ((getCognitoAuthenticationProvider() == null) ? 0 : getCognitoAuthenticationProvider().hashCode());
@@ -844,6 +1098,29 @@ public RequestIdentity clone() {
*/
public APIGatewayProxyRequestEvent() {}
+ /**
+ * @return The payload format version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * @param version The payload format version
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ /**
+ * @param version The payload format version
+ * @return
+ */
+ public APIGatewayProxyRequestEvent withVersion(String version) {
+ this.setVersion(version);
+ return this;
+ }
+
/**
* @return The resource path defined in API Gateway
*/
@@ -958,7 +1235,7 @@ public APIGatewayProxyRequestEvent withMultiValueHeaders(Map headers;
+
+ private Map> multiValueHeaders;
private String body;
@@ -69,6 +72,30 @@ public APIGatewayProxyResponseEvent withHeaders(Map headers) {
return this;
}
+ /**
+ * @return the Http multi value headers to return in the response
+ */
+ public Map> getMultiValueHeaders() {
+ return multiValueHeaders;
+ }
+
+ /**
+ * @param multiValueHeaders the Http multi value headers to return in the response
+ */
+ public void setMultiValueHeaders(Map> multiValueHeaders) {
+ this.multiValueHeaders = multiValueHeaders;
+ }
+
+ /**
+ *
+ * @param multiValueHeaders the Http multi value headers to return in the response
+ * @return APIGatewayProxyResponseEvent
+ */
+ public APIGatewayProxyResponseEvent withMultiValueHeaders(Map> multiValueHeaders) {
+ this.setMultiValueHeaders(multiValueHeaders);
+ return this;
+ }
+
/**
* @return The response body
*/
@@ -130,6 +157,8 @@ public String toString() {
sb.append("statusCode: ").append(getStatusCode()).append(",");
if (getHeaders() != null)
sb.append("headers: ").append(getHeaders().toString()).append(",");
+ if (getMultiValueHeaders() != null)
+ sb.append("multiValueHeaders: ").append(getMultiValueHeaders().toString()).append(",");
if (getBody() != null)
sb.append("body: ").append(getBody());
sb.append("}");
@@ -154,6 +183,10 @@ public boolean equals(Object obj) {
return false;
if (other.getHeaders() != null && other.getHeaders().equals(this.getHeaders()) == false)
return false;
+ if (other.getMultiValueHeaders() == null ^ this.getMultiValueHeaders() == null)
+ return false;
+ if (other.getMultiValueHeaders() != null && other.getMultiValueHeaders().equals(this.getMultiValueHeaders()) == false)
+ return false;
if (other.getBody() == null ^ this.getBody() == null)
return false;
if (other.getBody() != null && other.getBody().equals(this.getBody()) == false)
@@ -168,6 +201,7 @@ public int hashCode() {
hashCode = prime * hashCode + ((getStatusCode() == null) ? 0 : getStatusCode().hashCode());
hashCode = prime * hashCode + ((getHeaders() == null) ? 0 : getHeaders().hashCode());
+ hashCode = prime * hashCode + ((getMultiValueHeaders() == null) ? 0 : getMultiValueHeaders().hashCode());
hashCode = prime * hashCode + ((getBody() == null) ? 0 : getBody().hashCode());
return hashCode;
}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2CustomAuthorizerEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2CustomAuthorizerEvent.java
new file mode 100644
index 000000000..6abfe0513
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2CustomAuthorizerEvent.java
@@ -0,0 +1,80 @@
+package com.amazonaws.services.lambda.runtime.events;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.joda.time.DateTime;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+
+import java.time.Instant;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The V2 API Gateway customer authorizer event object as described - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html
+ *
+ */
+
+@Data
+@Builder(setterPrefix = "with")
+@NoArgsConstructor
+@AllArgsConstructor
+public class APIGatewayV2CustomAuthorizerEvent {
+
+ private String version;
+ private String type;
+ private String routeArn;
+ private List identitySource;
+ private String routeKey;
+ private String rawPath;
+ private String rawQueryString;
+ private List cookies;
+ private Map headers;
+ private Map queryStringParameters;
+ private RequestContext requestContext;
+ private Map pathParameters;
+ private Map stageVariables;
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class RequestContext {
+
+ private static DateTimeFormatter fmt = DateTimeFormat.forPattern("dd/MMM/yyyy:HH:mm:ss Z");
+
+ private String accountId;
+ private String apiId;
+ private String domainName;
+ private String domainPrefix;
+ private Http http;
+ private String requestId;
+ private String routeKey;
+ private String stage;
+ private String time;
+ private long timeEpoch;
+
+ public Instant getTimeEpoch() {
+ return Instant.ofEpochMilli(timeEpoch);
+ }
+
+ public DateTime getTime() {
+ return fmt.parseDateTime(time);
+ }
+ }
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class Http {
+
+ private String method;
+ private String path;
+ private String protocol;
+ private String sourceIp;
+ private String userAgent;
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2HTTPEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2HTTPEvent.java
new file mode 100644
index 000000000..3393822ec
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2HTTPEvent.java
@@ -0,0 +1,117 @@
+/*
+ * 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.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+import java.util.Map;
+
+@AllArgsConstructor
+@Builder(setterPrefix = "with")
+@Data
+@NoArgsConstructor
+/**
+ * API Gateway v2 event: https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html
+ */
+public class APIGatewayV2HTTPEvent {
+ private String version;
+ private String routeKey;
+ private String rawPath;
+ private String rawQueryString;
+ private List cookies;
+ private Map headers;
+ private Map queryStringParameters;
+ private Map pathParameters;
+ private Map stageVariables;
+ private String body;
+ private boolean isBase64Encoded;
+ private RequestContext requestContext;
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class RequestContext {
+ private String routeKey;
+ private String accountId;
+ private String stage;
+ private String apiId;
+ private String domainName;
+ private String domainPrefix;
+ private String time;
+ private long timeEpoch;
+ private Http http;
+ private Authorizer authorizer;
+ private String requestId;
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class Authorizer {
+ private JWT jwt;
+ private Map lambda;
+ private IAM iam;
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class JWT {
+ private Map claims;
+ private List scopes;
+ }
+ }
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class Http {
+ private String method;
+ private String path;
+ private String protocol;
+ private String sourceIp;
+ private String userAgent;
+ }
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class IAM {
+ private String accessKey;
+ private String accountId;
+ private String callerId;
+ private CognitoIdentity cognitoIdentity;
+ private String principalOrgId;
+ private String userArn;
+ private String userId;
+ }
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class CognitoIdentity {
+ private List amr;
+ private String identityId;
+ private String identityPoolId;
+ }
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2HTTPResponse.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2HTTPResponse.java
new file mode 100644
index 000000000..2bd81fad5
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2HTTPResponse.java
@@ -0,0 +1,35 @@
+/*
+ * 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.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+import java.util.Map;
+
+@AllArgsConstructor
+@Builder(setterPrefix = "with")
+@Data
+@NoArgsConstructor
+public class APIGatewayV2HTTPResponse {
+ private int statusCode;
+ private Map headers;
+ private Map> multiValueHeaders;
+ private List cookies;
+ private String body;
+ private boolean isBase64Encoded;
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2ProxyRequestEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2ProxyRequestEvent.java
index 0f2cbb184..c8a641495 100644
--- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2ProxyRequestEvent.java
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2ProxyRequestEvent.java
@@ -1,726 +1,11 @@
package com.amazonaws.services.lambda.runtime.events;
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-
/**
- * @author Tim Gustafson
+ * @deprecated
+ * This class is for use with API Gateway WebSockets, and has been renamed explicitly as {@link APIGatewayV2WebSocketEvent}
+ * To integrate with API Gateway's HTTP API Events, use one of:
+ * * {@link APIGatewayV2HTTPEvent} (payload version 2.0)
+ * * {@link APIGatewayProxyRequestEvent} (payload version 1.0)
*/
-public class APIGatewayV2ProxyRequestEvent implements Serializable, Cloneable {
-
- private static final long serialVersionUID = 5695319264103347099L;
-
- public static class RequestIdentity implements Serializable, Cloneable {
-
- private static final long serialVersionUID = -3276649362684921217L;
-
- private String cognitoIdentityPoolId;
- private String accountId;
- private String cognitoIdentityId;
- private String caller;
- private String apiKey;
- private String sourceIp;
- private String cognitoAuthenticationType;
- private String cognitoAuthenticationProvider;
- private String userArn;
- private String userAgent;
- private String user;
- private String accessKey;
-
- public String getCognitoIdentityPoolId() {
- return cognitoIdentityPoolId;
- }
-
- public void setCognitoIdentityPoolId(String cognitoIdentityPoolId) {
- this.cognitoIdentityPoolId = cognitoIdentityPoolId;
- }
-
- public String getAccountId() {
- return accountId;
- }
-
- public void setAccountId(String accountId) {
- this.accountId = accountId;
- }
-
- public String getCognitoIdentityId() {
- return cognitoIdentityId;
- }
-
- public void setCognitoIdentityId(String cognitoIdentityId) {
- this.cognitoIdentityId = cognitoIdentityId;
- }
-
- public String getCaller() {
- return caller;
- }
-
- public void setCaller(String caller) {
- this.caller = caller;
- }
-
- public String getApiKey() {
- return apiKey;
- }
-
- public void setApiKey(String apiKey) {
- this.apiKey = apiKey;
- }
-
- public String getSourceIp() {
- return sourceIp;
- }
-
- public void setSourceIp(String sourceIp) {
- this.sourceIp = sourceIp;
- }
-
- public String getCognitoAuthenticationType() {
- return cognitoAuthenticationType;
- }
-
- public void setCognitoAuthenticationType(String cognitoAuthenticationType) {
- this.cognitoAuthenticationType = cognitoAuthenticationType;
- }
-
- public String getCognitoAuthenticationProvider() {
- return cognitoAuthenticationProvider;
- }
-
- public void setCognitoAuthenticationProvider(String cognitoAuthenticationProvider) {
- this.cognitoAuthenticationProvider = cognitoAuthenticationProvider;
- }
-
- public String getUserArn() {
- return userArn;
- }
-
- public void setUserArn(String userArn) {
- this.userArn = userArn;
- }
-
- public String getUserAgent() {
- return userAgent;
- }
-
- public void setUserAgent(String userAgent) {
- this.userAgent = userAgent;
- }
-
- public String getUser() {
- return user;
- }
-
- public void setUser(String user) {
- this.user = user;
- }
-
- public String getAccessKey() {
- return accessKey;
- }
-
- public void setAccessKey(String accessKey) {
- this.accessKey = accessKey;
- }
-
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 29 * hash + (this.cognitoIdentityPoolId != null ? this.cognitoIdentityPoolId.hashCode() : 0);
- hash = 29 * hash + (this.accountId != null ? this.accountId.hashCode() : 0);
- hash = 29 * hash + (this.cognitoIdentityId != null ? this.cognitoIdentityId.hashCode() : 0);
- hash = 29 * hash + (this.caller != null ? this.caller.hashCode() : 0);
- hash = 29 * hash + (this.apiKey != null ? this.apiKey.hashCode() : 0);
- hash = 29 * hash + (this.sourceIp != null ? this.sourceIp.hashCode() : 0);
- hash = 29 * hash + (this.cognitoAuthenticationType != null ? this.cognitoAuthenticationType.hashCode() : 0);
- hash = 29 * hash + (this.cognitoAuthenticationProvider != null ? this.cognitoAuthenticationProvider.hashCode() : 0);
- hash = 29 * hash + (this.userArn != null ? this.userArn.hashCode() : 0);
- hash = 29 * hash + (this.userAgent != null ? this.userAgent.hashCode() : 0);
- hash = 29 * hash + (this.user != null ? this.user.hashCode() : 0);
- hash = 29 * hash + (this.accessKey != null ? this.accessKey.hashCode() : 0);
- return hash;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final RequestIdentity other = (RequestIdentity) obj;
- if ((this.cognitoIdentityPoolId == null) ? (other.cognitoIdentityPoolId != null) : !this.cognitoIdentityPoolId.equals(other.cognitoIdentityPoolId)) {
- return false;
- }
- if ((this.accountId == null) ? (other.accountId != null) : !this.accountId.equals(other.accountId)) {
- return false;
- }
- if ((this.cognitoIdentityId == null) ? (other.cognitoIdentityId != null) : !this.cognitoIdentityId.equals(other.cognitoIdentityId)) {
- return false;
- }
- if ((this.caller == null) ? (other.caller != null) : !this.caller.equals(other.caller)) {
- return false;
- }
- if ((this.apiKey == null) ? (other.apiKey != null) : !this.apiKey.equals(other.apiKey)) {
- return false;
- }
- if ((this.sourceIp == null) ? (other.sourceIp != null) : !this.sourceIp.equals(other.sourceIp)) {
- return false;
- }
- if ((this.cognitoAuthenticationType == null) ? (other.cognitoAuthenticationType != null) : !this.cognitoAuthenticationType.equals(other.cognitoAuthenticationType)) {
- return false;
- }
- if ((this.cognitoAuthenticationProvider == null) ? (other.cognitoAuthenticationProvider != null) : !this.cognitoAuthenticationProvider.equals(other.cognitoAuthenticationProvider)) {
- return false;
- }
- if ((this.userArn == null) ? (other.userArn != null) : !this.userArn.equals(other.userArn)) {
- return false;
- }
- if ((this.userAgent == null) ? (other.userAgent != null) : !this.userAgent.equals(other.userAgent)) {
- return false;
- }
- if ((this.user == null) ? (other.user != null) : !this.user.equals(other.user)) {
- return false;
- }
- if ((this.accessKey == null) ? (other.accessKey != null) : !this.accessKey.equals(other.accessKey)) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- return "{cognitoIdentityPoolId=" + cognitoIdentityPoolId
- + ", accountId=" + accountId
- + ", cognitoIdentityId=" + cognitoIdentityId
- + ", caller=" + caller
- + ", apiKey=" + apiKey
- + ", sourceIp=" + sourceIp
- + ", cognitoAuthenticationType=" + cognitoAuthenticationType
- + ", cognitoAuthenticationProvider=" + cognitoAuthenticationProvider
- + ", userArn=" + userArn
- + ", userAgent=" + userAgent
- + ", user=" + user
- + ", accessKey=" + accessKey
- + "}";
- }
- }
-
- public static class RequestContext implements Serializable, Cloneable {
-
- private static final long serialVersionUID = -6641935365992304860L;
-
- private String accountId;
- private String resourceId;
- private String stage;
- private String requestId;
- private RequestIdentity identity;
- private String ResourcePath;
- private Map authorizer;
- private String httpMethod;
- private String apiId;
- private long connectedAt;
- private String connectionId;
- private String domainName;
- private String error;
- private String eventType;
- private String extendedRequestId;
- private String integrationLatency;
- private String messageDirection;
- private String messageId;
- private String requestTime;
- private long requestTimeEpoch;
- private String routeKey;
- private String status;
-
- public String getAccountId() {
- return accountId;
- }
-
- public void setAccountId(String accountId) {
- this.accountId = accountId;
- }
-
- public String getResourceId() {
- return resourceId;
- }
-
- public void setResourceId(String resourceId) {
- this.resourceId = resourceId;
- }
-
- public String getStage() {
- return stage;
- }
-
- public void setStage(String stage) {
- this.stage = stage;
- }
-
- public String getRequestId() {
- return requestId;
- }
-
- public void setRequestId(String requestId) {
- this.requestId = requestId;
- }
-
- public RequestIdentity getIdentity() {
- return identity;
- }
-
- public void setIdentity(RequestIdentity identity) {
- this.identity = identity;
- }
-
- public String getResourcePath() {
- return ResourcePath;
- }
-
- public void setResourcePath(String ResourcePath) {
- this.ResourcePath = ResourcePath;
- }
-
- public Map getAuthorizer() {
- return authorizer;
- }
-
- public void setAuthorizer(Map authorizer) {
- this.authorizer = authorizer;
- }
-
- public String getHttpMethod() {
- return httpMethod;
- }
-
- public void setHttpMethod(String httpMethod) {
- this.httpMethod = httpMethod;
- }
-
- public String getApiId() {
- return apiId;
- }
-
- public void setApiId(String apiId) {
- this.apiId = apiId;
- }
-
- public long getConnectedAt() {
- return connectedAt;
- }
-
- public void setConnectedAt(long connectedAt) {
- this.connectedAt = connectedAt;
- }
-
- public String getConnectionId() {
- return connectionId;
- }
-
- public void setConnectionId(String connectionId) {
- this.connectionId = connectionId;
- }
-
- public String getDomainName() {
- return domainName;
- }
-
- public void setDomainName(String domainName) {
- this.domainName = domainName;
- }
-
- public String getError() {
- return error;
- }
-
- public void setError(String error) {
- this.error = error;
- }
-
- public String getEventType() {
- return eventType;
- }
-
- public void setEventType(String eventType) {
- this.eventType = eventType;
- }
-
- public String getExtendedRequestId() {
- return extendedRequestId;
- }
-
- public void setExtendedRequestId(String extendedRequestId) {
- this.extendedRequestId = extendedRequestId;
- }
-
- public String getIntegrationLatency() {
- return integrationLatency;
- }
-
- public void setIntegrationLatency(String integrationLatency) {
- this.integrationLatency = integrationLatency;
- }
-
- public String getMessageDirection() {
- return messageDirection;
- }
-
- public void setMessageDirection(String messageDirection) {
- this.messageDirection = messageDirection;
- }
-
- public String getMessageId() {
- return messageId;
- }
-
- public void setMessageId(String messageId) {
- this.messageId = messageId;
- }
-
- public String getRequestTime() {
- return requestTime;
- }
-
- public void setRequestTime(String requestTime) {
- this.requestTime = requestTime;
- }
-
- public long getRequestTimeEpoch() {
- return requestTimeEpoch;
- }
-
- public void setRequestTimeEpoch(long requestTimeEpoch) {
- this.requestTimeEpoch = requestTimeEpoch;
- }
-
- public String getRouteKey() {
- return routeKey;
- }
-
- public void setRouteKey(String routeKey) {
- this.routeKey = routeKey;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- @Override
- public int hashCode() {
- int hash = 3;
- hash = 59 * hash + (this.accountId != null ? this.accountId.hashCode() : 0);
- hash = 59 * hash + (this.resourceId != null ? this.resourceId.hashCode() : 0);
- hash = 59 * hash + (this.stage != null ? this.stage.hashCode() : 0);
- hash = 59 * hash + (this.requestId != null ? this.requestId.hashCode() : 0);
- hash = 59 * hash + (this.identity != null ? this.identity.hashCode() : 0);
- hash = 59 * hash + (this.ResourcePath != null ? this.ResourcePath.hashCode() : 0);
- hash = 59 * hash + (this.authorizer != null ? this.authorizer.hashCode() : 0);
- hash = 59 * hash + (this.httpMethod != null ? this.httpMethod.hashCode() : 0);
- hash = 59 * hash + (this.apiId != null ? this.apiId.hashCode() : 0);
- hash = 59 * hash + (int) (this.connectedAt ^ (this.connectedAt >>> 32));
- hash = 59 * hash + (this.connectionId != null ? this.connectionId.hashCode() : 0);
- hash = 59 * hash + (this.domainName != null ? this.domainName.hashCode() : 0);
- hash = 59 * hash + (this.error != null ? this.error.hashCode() : 0);
- hash = 59 * hash + (this.eventType != null ? this.eventType.hashCode() : 0);
- hash = 59 * hash + (this.extendedRequestId != null ? this.extendedRequestId.hashCode() : 0);
- hash = 59 * hash + (this.integrationLatency != null ? this.integrationLatency.hashCode() : 0);
- hash = 59 * hash + (this.messageDirection != null ? this.messageDirection.hashCode() : 0);
- hash = 59 * hash + (this.messageId != null ? this.messageId.hashCode() : 0);
- hash = 59 * hash + (this.requestTime != null ? this.requestTime.hashCode() : 0);
- hash = 59 * hash + (int) (this.requestTimeEpoch ^ (this.requestTimeEpoch >>> 32));
- hash = 59 * hash + (this.routeKey != null ? this.routeKey.hashCode() : 0);
- hash = 59 * hash + (this.status != null ? this.status.hashCode() : 0);
- return hash;
- }
-
- @Override
- public String toString() {
- return "{accountId=" + accountId
- + ", resourceId=" + resourceId
- + ", stage=" + stage
- + ", requestId=" + requestId
- + ", identity=" + identity
- + ", ResourcePath=" + ResourcePath
- + ", authorizer=" + authorizer
- + ", httpMethod=" + httpMethod
- + ", apiId=" + apiId
- + ", connectedAt=" + connectedAt
- + ", connectionId=" + connectionId
- + ", domainName=" + domainName
- + ", error=" + error
- + ", eventType=" + eventType
- + ", extendedRequestId=" + extendedRequestId
- + ", integrationLatency=" + integrationLatency
- + ", messageDirection=" + messageDirection
- + ", messageId=" + messageId
- + ", requestTime=" + requestTime
- + ", requestTimeEpoch=" + requestTimeEpoch
- + ", routeKey=" + routeKey
- + ", status=" + status
- + "}";
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final RequestContext other = (RequestContext) obj;
- if (this.connectedAt != other.connectedAt) {
- return false;
- }
- if (this.requestTimeEpoch != other.requestTimeEpoch) {
- return false;
- }
- if ((this.accountId == null) ? (other.accountId != null) : !this.accountId.equals(other.accountId)) {
- return false;
- }
- if ((this.resourceId == null) ? (other.resourceId != null) : !this.resourceId.equals(other.resourceId)) {
- return false;
- }
- if ((this.stage == null) ? (other.stage != null) : !this.stage.equals(other.stage)) {
- return false;
- }
- if ((this.requestId == null) ? (other.requestId != null) : !this.requestId.equals(other.requestId)) {
- return false;
- }
- if ((this.ResourcePath == null) ? (other.ResourcePath != null) : !this.ResourcePath.equals(other.ResourcePath)) {
- return false;
- }
- if ((this.authorizer == null) ? (other.authorizer != null) : !this.authorizer.equals(other.authorizer)) {
- return false;
- }
- if ((this.httpMethod == null) ? (other.httpMethod != null) : !this.httpMethod.equals(other.httpMethod)) {
- return false;
- }
- if ((this.apiId == null) ? (other.apiId != null) : !this.apiId.equals(other.apiId)) {
- return false;
- }
- if ((this.connectionId == null) ? (other.connectionId != null) : !this.connectionId.equals(other.connectionId)) {
- return false;
- }
- if ((this.domainName == null) ? (other.domainName != null) : !this.domainName.equals(other.domainName)) {
- return false;
- }
- if ((this.error == null) ? (other.error != null) : !this.error.equals(other.error)) {
- return false;
- }
- if ((this.eventType == null) ? (other.eventType != null) : !this.eventType.equals(other.eventType)) {
- return false;
- }
- if ((this.extendedRequestId == null) ? (other.extendedRequestId != null) : !this.extendedRequestId.equals(other.extendedRequestId)) {
- return false;
- }
- if ((this.integrationLatency == null) ? (other.integrationLatency != null) : !this.integrationLatency.equals(other.integrationLatency)) {
- return false;
- }
- if ((this.messageDirection == null) ? (other.messageDirection != null) : !this.messageDirection.equals(other.messageDirection)) {
- return false;
- }
- if ((this.messageId == null) ? (other.messageId != null) : !this.messageId.equals(other.messageId)) {
- return false;
- }
- if ((this.requestTime == null) ? (other.requestTime != null) : !this.requestTime.equals(other.requestTime)) {
- return false;
- }
- if ((this.routeKey == null) ? (other.routeKey != null) : !this.routeKey.equals(other.routeKey)) {
- return false;
- }
- if ((this.status == null) ? (other.status != null) : !this.status.equals(other.status)) {
- return false;
- }
- if (this.identity != other.identity && (this.identity == null || !this.identity.equals(other.identity))) {
- return false;
- }
- return true;
- }
-
- }
-
- private String resource;
- private String path;
- private String httpMethod;
- private Map headers;
- private Map> multiValueHeaders;
- private Map queryStringParameters;
- private Map> multiValueQueryStringParameters;
- private Map pathParameters;
- private Map stageVariables;
- private RequestContext requestContext;
- private String body;
- private boolean isBase64Encoded = false;
-
- public String getResource() {
- return resource;
- }
-
- public void setResource(String resource) {
- this.resource = resource;
- }
-
- public String getPath() {
- return path;
- }
-
- public void setPath(String path) {
- this.path = path;
- }
-
- public String getHttpMethod() {
- return httpMethod;
- }
-
- public void setHttpMethod(String httpMethod) {
- this.httpMethod = httpMethod;
- }
-
- public Map getHeaders() {
- return headers;
- }
-
- public void setHeaders(Map headers) {
- this.headers = headers;
- }
-
- public Map> getMultiValueHeaders() {
- return multiValueHeaders;
- }
-
- public void setMultiValueHeaders(Map> multiValueHeaders) {
- this.multiValueHeaders = multiValueHeaders;
- }
-
- public Map getQueryStringParameters() {
- return queryStringParameters;
- }
-
- public void setQueryStringParameters(Map queryStringParameters) {
- this.queryStringParameters = queryStringParameters;
- }
-
- public Map> getMultiValueQueryStringParameters() {
- return multiValueQueryStringParameters;
- }
-
- public void setMultiValueQueryStringParameters(Map> multiValueQueryStringParameters) {
- this.multiValueQueryStringParameters = multiValueQueryStringParameters;
- }
-
- public Map getPathParameters() {
- return pathParameters;
- }
-
- public void setPathParameters(Map pathParameters) {
- this.pathParameters = pathParameters;
- }
-
- public Map getStageVariables() {
- return stageVariables;
- }
-
- public void setStageVariables(Map stageVariables) {
- this.stageVariables = stageVariables;
- }
-
- public RequestContext getRequestContext() {
- return requestContext;
- }
-
- public void setRequestContext(RequestContext requestContext) {
- this.requestContext = requestContext;
- }
-
- public String getBody() {
- return body;
- }
-
- public void setBody(String body) {
- this.body = body;
- }
-
- public boolean isIsBase64Encoded() {
- return isBase64Encoded;
- }
-
- public void setIsBase64Encoded(boolean isBase64Encoded) {
- this.isBase64Encoded = isBase64Encoded;
- }
-
- @Override
- public int hashCode() {
- int hash = 7;
-
- hash = 43 * hash + Objects.hashCode(this.requestContext);
- hash = 43 * hash + Objects.hashCode(this.body);
- hash = 43 * hash + (this.isBase64Encoded ? 1 : 0);
-
- return hash;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj == null) {
- return false;
- }
-
- if (getClass() != obj.getClass()) {
- return false;
- }
-
- final APIGatewayV2ProxyRequestEvent other = (APIGatewayV2ProxyRequestEvent) obj;
-
- if (this.isBase64Encoded != other.isBase64Encoded) {
- return false;
- }
-
- if (!Objects.equals(this.body, other.body)) {
- return false;
- }
-
- if (!Objects.equals(this.requestContext, other.requestContext)) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("{");
-
- if (requestContext != null) {
- sb.append("requestContext: ").append(requestContext).append(",");
- }
-
- if (body != null) {
- sb.append("body: ").append(body).append(",");
- }
-
- sb.append("isBase64Encoded: ").append(isBase64Encoded).append(",");
-
- sb.append("}");
-
- return sb.toString();
- }
-
-}
+@Deprecated()
+public class APIGatewayV2ProxyRequestEvent extends APIGatewayV2WebSocketEvent {}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2ProxyResponseEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2ProxyResponseEvent.java
index c3ecff89b..d920e784d 100644
--- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2ProxyResponseEvent.java
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2ProxyResponseEvent.java
@@ -1,110 +1,9 @@
package com.amazonaws.services.lambda.runtime.events;
-import java.io.Serializable;
-import java.util.Map;
-
/**
- * @author Tim Gustafson
+ * @deprecated
+ * This class is for responding to API Gateway WebSocket events, and has been renamed explicitly as {@link APIGatewayV2WebSocketResponse}
+ * To response to API Gateway's HTTP API Events, use {@link APIGatewayV2HTTPResponse}
*/
-public class APIGatewayV2ProxyResponseEvent implements Serializable, Cloneable {
-
- private static final long serialVersionUID = -5155789062248356200L;
-
- private boolean isBase64Encoded = false;
- private int statusCode;
- private Map headers;
- private Map multiValueHeaders;
- private String body;
-
- public boolean isIsBase64Encoded() {
- return isBase64Encoded;
- }
-
- public void setIsBase64Encoded(boolean isBase64Encoded) {
- this.isBase64Encoded = isBase64Encoded;
- }
-
- public int getStatusCode() {
- return statusCode;
- }
-
- public void setStatusCode(int statusCode) {
- this.statusCode = statusCode;
- }
-
- public Map getHeaders() {
- return headers;
- }
-
- public void setHeaders(Map headers) {
- this.headers = headers;
- }
-
- public Map getMultiValueHeaders() {
- return multiValueHeaders;
- }
-
- public void setMultiValueHeaders(Map multiValueHeaders) {
- this.multiValueHeaders = multiValueHeaders;
- }
-
- public String getBody() {
- return body;
- }
-
- public void setBody(String body) {
- this.body = body;
- }
-
- @Override
- public int hashCode() {
- int hash = 3;
- hash = 71 * hash + (this.isBase64Encoded ? 1 : 0);
- hash = 71 * hash + this.statusCode;
- hash = 71 * hash + (this.headers != null ? this.headers.hashCode() : 0);
- hash = 71 * hash + (this.multiValueHeaders != null ? this.multiValueHeaders.hashCode() : 0);
- hash = 71 * hash + (this.body != null ? this.body.hashCode() : 0);
- return hash;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final APIGatewayV2ProxyResponseEvent other = (APIGatewayV2ProxyResponseEvent) obj;
- if (this.isBase64Encoded != other.isBase64Encoded) {
- return false;
- }
- if (this.statusCode != other.statusCode) {
- return false;
- }
- if ((this.body == null) ? (other.body != null) : !this.body.equals(other.body)) {
- return false;
- }
- if (this.headers != other.headers && (this.headers == null || !this.headers.equals(other.headers))) {
- return false;
- }
- if (this.multiValueHeaders != other.multiValueHeaders && (this.multiValueHeaders == null || !this.multiValueHeaders.equals(other.multiValueHeaders))) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- return "{isBase64Encoded=" + isBase64Encoded
- + ", statusCode=" + statusCode
- + ", headers=" + headers
- + ", multiValueHeaders=" + multiValueHeaders
- + ", body=" + body
- + "}";
- }
-
-}
+@Deprecated
+public class APIGatewayV2ProxyResponseEvent extends APIGatewayV2WebSocketResponse {}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2WebSocketEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2WebSocketEvent.java
new file mode 100644
index 000000000..cb6ffa991
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2WebSocketEvent.java
@@ -0,0 +1,727 @@
+package com.amazonaws.services.lambda.runtime.events;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * @author Tim Gustafson
+ */
+public class APIGatewayV2WebSocketEvent implements Serializable, Cloneable {
+
+ private static final long serialVersionUID = 5695319264103347099L;
+
+ public static class RequestIdentity implements Serializable, Cloneable {
+
+ private static final long serialVersionUID = -3276649362684921217L;
+
+ private String cognitoIdentityPoolId;
+ private String accountId;
+ private String cognitoIdentityId;
+ private String caller;
+ private String apiKey;
+ private String sourceIp;
+ private String cognitoAuthenticationType;
+ private String cognitoAuthenticationProvider;
+ private String userArn;
+ private String userAgent;
+ private String user;
+ private String accessKey;
+
+ public String getCognitoIdentityPoolId() {
+ return cognitoIdentityPoolId;
+ }
+
+ public void setCognitoIdentityPoolId(String cognitoIdentityPoolId) {
+ this.cognitoIdentityPoolId = cognitoIdentityPoolId;
+ }
+
+ public String getAccountId() {
+ return accountId;
+ }
+
+ public void setAccountId(String accountId) {
+ this.accountId = accountId;
+ }
+
+ public String getCognitoIdentityId() {
+ return cognitoIdentityId;
+ }
+
+ public void setCognitoIdentityId(String cognitoIdentityId) {
+ this.cognitoIdentityId = cognitoIdentityId;
+ }
+
+ public String getCaller() {
+ return caller;
+ }
+
+ public void setCaller(String caller) {
+ this.caller = caller;
+ }
+
+ public String getApiKey() {
+ return apiKey;
+ }
+
+ public void setApiKey(String apiKey) {
+ this.apiKey = apiKey;
+ }
+
+ public String getSourceIp() {
+ return sourceIp;
+ }
+
+ public void setSourceIp(String sourceIp) {
+ this.sourceIp = sourceIp;
+ }
+
+ public String getCognitoAuthenticationType() {
+ return cognitoAuthenticationType;
+ }
+
+ public void setCognitoAuthenticationType(String cognitoAuthenticationType) {
+ this.cognitoAuthenticationType = cognitoAuthenticationType;
+ }
+
+ public String getCognitoAuthenticationProvider() {
+ return cognitoAuthenticationProvider;
+ }
+
+ public void setCognitoAuthenticationProvider(String cognitoAuthenticationProvider) {
+ this.cognitoAuthenticationProvider = cognitoAuthenticationProvider;
+ }
+
+ public String getUserArn() {
+ return userArn;
+ }
+
+ public void setUserArn(String userArn) {
+ this.userArn = userArn;
+ }
+
+ public String getUserAgent() {
+ return userAgent;
+ }
+
+ public void setUserAgent(String userAgent) {
+ this.userAgent = userAgent;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(String user) {
+ this.user = user;
+ }
+
+ public String getAccessKey() {
+ return accessKey;
+ }
+
+ public void setAccessKey(String accessKey) {
+ this.accessKey = accessKey;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 7;
+ hash = 29 * hash + (this.cognitoIdentityPoolId != null ? this.cognitoIdentityPoolId.hashCode() : 0);
+ hash = 29 * hash + (this.accountId != null ? this.accountId.hashCode() : 0);
+ hash = 29 * hash + (this.cognitoIdentityId != null ? this.cognitoIdentityId.hashCode() : 0);
+ hash = 29 * hash + (this.caller != null ? this.caller.hashCode() : 0);
+ hash = 29 * hash + (this.apiKey != null ? this.apiKey.hashCode() : 0);
+ hash = 29 * hash + (this.sourceIp != null ? this.sourceIp.hashCode() : 0);
+ hash = 29 * hash + (this.cognitoAuthenticationType != null ? this.cognitoAuthenticationType.hashCode() : 0);
+ hash = 29 * hash + (this.cognitoAuthenticationProvider != null ? this.cognitoAuthenticationProvider.hashCode() : 0);
+ hash = 29 * hash + (this.userArn != null ? this.userArn.hashCode() : 0);
+ hash = 29 * hash + (this.userAgent != null ? this.userAgent.hashCode() : 0);
+ hash = 29 * hash + (this.user != null ? this.user.hashCode() : 0);
+ hash = 29 * hash + (this.accessKey != null ? this.accessKey.hashCode() : 0);
+ return hash;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final RequestIdentity other = (RequestIdentity) obj;
+ if ((this.cognitoIdentityPoolId == null) ? (other.cognitoIdentityPoolId != null) : !this.cognitoIdentityPoolId.equals(other.cognitoIdentityPoolId)) {
+ return false;
+ }
+ if ((this.accountId == null) ? (other.accountId != null) : !this.accountId.equals(other.accountId)) {
+ return false;
+ }
+ if ((this.cognitoIdentityId == null) ? (other.cognitoIdentityId != null) : !this.cognitoIdentityId.equals(other.cognitoIdentityId)) {
+ return false;
+ }
+ if ((this.caller == null) ? (other.caller != null) : !this.caller.equals(other.caller)) {
+ return false;
+ }
+ if ((this.apiKey == null) ? (other.apiKey != null) : !this.apiKey.equals(other.apiKey)) {
+ return false;
+ }
+ if ((this.sourceIp == null) ? (other.sourceIp != null) : !this.sourceIp.equals(other.sourceIp)) {
+ return false;
+ }
+ if ((this.cognitoAuthenticationType == null) ? (other.cognitoAuthenticationType != null) : !this.cognitoAuthenticationType.equals(other.cognitoAuthenticationType)) {
+ return false;
+ }
+ if ((this.cognitoAuthenticationProvider == null) ? (other.cognitoAuthenticationProvider != null) : !this.cognitoAuthenticationProvider.equals(other.cognitoAuthenticationProvider)) {
+ return false;
+ }
+ if ((this.userArn == null) ? (other.userArn != null) : !this.userArn.equals(other.userArn)) {
+ return false;
+ }
+ if ((this.userAgent == null) ? (other.userAgent != null) : !this.userAgent.equals(other.userAgent)) {
+ return false;
+ }
+ if ((this.user == null) ? (other.user != null) : !this.user.equals(other.user)) {
+ return false;
+ }
+ if ((this.accessKey == null) ? (other.accessKey != null) : !this.accessKey.equals(other.accessKey)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "{cognitoIdentityPoolId=" + cognitoIdentityPoolId
+ + ", accountId=" + accountId
+ + ", cognitoIdentityId=" + cognitoIdentityId
+ + ", caller=" + caller
+ + ", apiKey=" + apiKey
+ + ", sourceIp=" + sourceIp
+ + ", cognitoAuthenticationType=" + cognitoAuthenticationType
+ + ", cognitoAuthenticationProvider=" + cognitoAuthenticationProvider
+ + ", userArn=" + userArn
+ + ", userAgent=" + userAgent
+ + ", user=" + user
+ + ", accessKey=" + accessKey
+ + "}";
+ }
+ }
+
+ public static class RequestContext implements Serializable, Cloneable {
+
+ private static final long serialVersionUID = -6641935365992304860L;
+
+ private String accountId;
+ private String resourceId;
+ private String stage;
+ private String requestId;
+ private RequestIdentity identity;
+ private String ResourcePath;
+ private Map authorizer;
+ private String httpMethod;
+ private String apiId;
+ private long connectedAt;
+ private String connectionId;
+ private String domainName;
+ private String error;
+ private String eventType;
+ private String extendedRequestId;
+ private String integrationLatency;
+ private String messageDirection;
+ private String messageId;
+ private String requestTime;
+ private long requestTimeEpoch;
+ private String routeKey;
+ private String status;
+
+ public String getAccountId() {
+ return accountId;
+ }
+
+ public void setAccountId(String accountId) {
+ this.accountId = accountId;
+ }
+
+ public String getResourceId() {
+ return resourceId;
+ }
+
+ public void setResourceId(String resourceId) {
+ this.resourceId = resourceId;
+ }
+
+ public String getStage() {
+ return stage;
+ }
+
+ public void setStage(String stage) {
+ this.stage = stage;
+ }
+
+ public String getRequestId() {
+ return requestId;
+ }
+
+ public void setRequestId(String requestId) {
+ this.requestId = requestId;
+ }
+
+ public RequestIdentity getIdentity() {
+ return identity;
+ }
+
+ public void setIdentity(RequestIdentity identity) {
+ this.identity = identity;
+ }
+
+ public String getResourcePath() {
+ return ResourcePath;
+ }
+
+ public void setResourcePath(String ResourcePath) {
+ this.ResourcePath = ResourcePath;
+ }
+
+ public Map getAuthorizer() {
+ return authorizer;
+ }
+
+ public void setAuthorizer(Map authorizer) {
+ this.authorizer = authorizer;
+ }
+
+ public String getHttpMethod() {
+ return httpMethod;
+ }
+
+ public void setHttpMethod(String httpMethod) {
+ this.httpMethod = httpMethod;
+ }
+
+ public String getApiId() {
+ return apiId;
+ }
+
+ public void setApiId(String apiId) {
+ this.apiId = apiId;
+ }
+
+ public long getConnectedAt() {
+ return connectedAt;
+ }
+
+ public void setConnectedAt(long connectedAt) {
+ this.connectedAt = connectedAt;
+ }
+
+ public String getConnectionId() {
+ return connectionId;
+ }
+
+ public void setConnectionId(String connectionId) {
+ this.connectionId = connectionId;
+ }
+
+ public String getDomainName() {
+ return domainName;
+ }
+
+ public void setDomainName(String domainName) {
+ this.domainName = domainName;
+ }
+
+ public String getError() {
+ return error;
+ }
+
+ public void setError(String error) {
+ this.error = error;
+ }
+
+ public String getEventType() {
+ return eventType;
+ }
+
+ public void setEventType(String eventType) {
+ this.eventType = eventType;
+ }
+
+ public String getExtendedRequestId() {
+ return extendedRequestId;
+ }
+
+ public void setExtendedRequestId(String extendedRequestId) {
+ this.extendedRequestId = extendedRequestId;
+ }
+
+ public String getIntegrationLatency() {
+ return integrationLatency;
+ }
+
+ public void setIntegrationLatency(String integrationLatency) {
+ this.integrationLatency = integrationLatency;
+ }
+
+ public String getMessageDirection() {
+ return messageDirection;
+ }
+
+ public void setMessageDirection(String messageDirection) {
+ this.messageDirection = messageDirection;
+ }
+
+ public String getMessageId() {
+ return messageId;
+ }
+
+ public void setMessageId(String messageId) {
+ this.messageId = messageId;
+ }
+
+ public String getRequestTime() {
+ return requestTime;
+ }
+
+ public void setRequestTime(String requestTime) {
+ this.requestTime = requestTime;
+ }
+
+ public long getRequestTimeEpoch() {
+ return requestTimeEpoch;
+ }
+
+ public void setRequestTimeEpoch(long requestTimeEpoch) {
+ this.requestTimeEpoch = requestTimeEpoch;
+ }
+
+ public String getRouteKey() {
+ return routeKey;
+ }
+
+ public void setRouteKey(String routeKey) {
+ this.routeKey = routeKey;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 3;
+ hash = 59 * hash + (this.accountId != null ? this.accountId.hashCode() : 0);
+ hash = 59 * hash + (this.resourceId != null ? this.resourceId.hashCode() : 0);
+ hash = 59 * hash + (this.stage != null ? this.stage.hashCode() : 0);
+ hash = 59 * hash + (this.requestId != null ? this.requestId.hashCode() : 0);
+ hash = 59 * hash + (this.identity != null ? this.identity.hashCode() : 0);
+ hash = 59 * hash + (this.ResourcePath != null ? this.ResourcePath.hashCode() : 0);
+ hash = 59 * hash + (this.authorizer != null ? this.authorizer.hashCode() : 0);
+ hash = 59 * hash + (this.httpMethod != null ? this.httpMethod.hashCode() : 0);
+ hash = 59 * hash + (this.apiId != null ? this.apiId.hashCode() : 0);
+ hash = 59 * hash + (int) (this.connectedAt ^ (this.connectedAt >>> 32));
+ hash = 59 * hash + (this.connectionId != null ? this.connectionId.hashCode() : 0);
+ hash = 59 * hash + (this.domainName != null ? this.domainName.hashCode() : 0);
+ hash = 59 * hash + (this.error != null ? this.error.hashCode() : 0);
+ hash = 59 * hash + (this.eventType != null ? this.eventType.hashCode() : 0);
+ hash = 59 * hash + (this.extendedRequestId != null ? this.extendedRequestId.hashCode() : 0);
+ hash = 59 * hash + (this.integrationLatency != null ? this.integrationLatency.hashCode() : 0);
+ hash = 59 * hash + (this.messageDirection != null ? this.messageDirection.hashCode() : 0);
+ hash = 59 * hash + (this.messageId != null ? this.messageId.hashCode() : 0);
+ hash = 59 * hash + (this.requestTime != null ? this.requestTime.hashCode() : 0);
+ hash = 59 * hash + (int) (this.requestTimeEpoch ^ (this.requestTimeEpoch >>> 32));
+ hash = 59 * hash + (this.routeKey != null ? this.routeKey.hashCode() : 0);
+ hash = 59 * hash + (this.status != null ? this.status.hashCode() : 0);
+ return hash;
+ }
+
+ @Override
+ public String toString() {
+ return "{accountId=" + accountId
+ + ", resourceId=" + resourceId
+ + ", stage=" + stage
+ + ", requestId=" + requestId
+ + ", identity=" + identity
+ + ", ResourcePath=" + ResourcePath
+ + ", authorizer=" + authorizer
+ + ", httpMethod=" + httpMethod
+ + ", apiId=" + apiId
+ + ", connectedAt=" + connectedAt
+ + ", connectionId=" + connectionId
+ + ", domainName=" + domainName
+ + ", error=" + error
+ + ", eventType=" + eventType
+ + ", extendedRequestId=" + extendedRequestId
+ + ", integrationLatency=" + integrationLatency
+ + ", messageDirection=" + messageDirection
+ + ", messageId=" + messageId
+ + ", requestTime=" + requestTime
+ + ", requestTimeEpoch=" + requestTimeEpoch
+ + ", routeKey=" + routeKey
+ + ", status=" + status
+ + "}";
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final RequestContext other = (RequestContext) obj;
+ if (this.connectedAt != other.connectedAt) {
+ return false;
+ }
+ if (this.requestTimeEpoch != other.requestTimeEpoch) {
+ return false;
+ }
+ if ((this.accountId == null) ? (other.accountId != null) : !this.accountId.equals(other.accountId)) {
+ return false;
+ }
+ if ((this.resourceId == null) ? (other.resourceId != null) : !this.resourceId.equals(other.resourceId)) {
+ return false;
+ }
+ if ((this.stage == null) ? (other.stage != null) : !this.stage.equals(other.stage)) {
+ return false;
+ }
+ if ((this.requestId == null) ? (other.requestId != null) : !this.requestId.equals(other.requestId)) {
+ return false;
+ }
+ if ((this.ResourcePath == null) ? (other.ResourcePath != null) : !this.ResourcePath.equals(other.ResourcePath)) {
+ return false;
+ }
+ if ((this.authorizer == null) ? (other.authorizer != null) : !this.authorizer.equals(other.authorizer)) {
+ return false;
+ }
+ if ((this.httpMethod == null) ? (other.httpMethod != null) : !this.httpMethod.equals(other.httpMethod)) {
+ return false;
+ }
+ if ((this.apiId == null) ? (other.apiId != null) : !this.apiId.equals(other.apiId)) {
+ return false;
+ }
+ if ((this.connectionId == null) ? (other.connectionId != null) : !this.connectionId.equals(other.connectionId)) {
+ return false;
+ }
+ if ((this.domainName == null) ? (other.domainName != null) : !this.domainName.equals(other.domainName)) {
+ return false;
+ }
+ if ((this.error == null) ? (other.error != null) : !this.error.equals(other.error)) {
+ return false;
+ }
+ if ((this.eventType == null) ? (other.eventType != null) : !this.eventType.equals(other.eventType)) {
+ return false;
+ }
+ if ((this.extendedRequestId == null) ? (other.extendedRequestId != null) : !this.extendedRequestId.equals(other.extendedRequestId)) {
+ return false;
+ }
+ if ((this.integrationLatency == null) ? (other.integrationLatency != null) : !this.integrationLatency.equals(other.integrationLatency)) {
+ return false;
+ }
+ if ((this.messageDirection == null) ? (other.messageDirection != null) : !this.messageDirection.equals(other.messageDirection)) {
+ return false;
+ }
+ if ((this.messageId == null) ? (other.messageId != null) : !this.messageId.equals(other.messageId)) {
+ return false;
+ }
+ if ((this.requestTime == null) ? (other.requestTime != null) : !this.requestTime.equals(other.requestTime)) {
+ return false;
+ }
+ if ((this.routeKey == null) ? (other.routeKey != null) : !this.routeKey.equals(other.routeKey)) {
+ return false;
+ }
+ if ((this.status == null) ? (other.status != null) : !this.status.equals(other.status)) {
+ return false;
+ }
+ if (this.identity != other.identity && (this.identity == null || !this.identity.equals(other.identity))) {
+ return false;
+ }
+ return true;
+ }
+
+ }
+
+ private String resource;
+ private String path;
+ private String httpMethod;
+ private Map headers;
+ private Map> multiValueHeaders;
+ private Map queryStringParameters;
+ private Map> multiValueQueryStringParameters;
+ private Map pathParameters;
+ private Map stageVariables;
+ private RequestContext requestContext;
+ private String body;
+ private boolean isBase64Encoded = false;
+
+ public String getResource() {
+ return resource;
+ }
+
+ public void setResource(String resource) {
+ this.resource = resource;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public String getHttpMethod() {
+ return httpMethod;
+ }
+
+ public void setHttpMethod(String httpMethod) {
+ this.httpMethod = httpMethod;
+ }
+
+ public Map getHeaders() {
+ return headers;
+ }
+
+ public void setHeaders(Map headers) {
+ this.headers = headers;
+ }
+
+ public Map> getMultiValueHeaders() {
+ return multiValueHeaders;
+ }
+
+ public void setMultiValueHeaders(Map> multiValueHeaders) {
+ this.multiValueHeaders = multiValueHeaders;
+ }
+
+ public Map getQueryStringParameters() {
+ return queryStringParameters;
+ }
+
+ public void setQueryStringParameters(Map queryStringParameters) {
+ this.queryStringParameters = queryStringParameters;
+ }
+
+ public Map> getMultiValueQueryStringParameters() {
+ return multiValueQueryStringParameters;
+ }
+
+ public void setMultiValueQueryStringParameters(Map> multiValueQueryStringParameters) {
+ this.multiValueQueryStringParameters = multiValueQueryStringParameters;
+ }
+
+ public Map getPathParameters() {
+ return pathParameters;
+ }
+
+ public void setPathParameters(Map pathParameters) {
+ this.pathParameters = pathParameters;
+ }
+
+ public Map getStageVariables() {
+ return stageVariables;
+ }
+
+ public void setStageVariables(Map stageVariables) {
+ this.stageVariables = stageVariables;
+ }
+
+ public RequestContext getRequestContext() {
+ return requestContext;
+ }
+
+ public void setRequestContext(RequestContext requestContext) {
+ this.requestContext = requestContext;
+ }
+
+ public String getBody() {
+ return body;
+ }
+
+ public void setBody(String body) {
+ this.body = body;
+ }
+
+ public boolean isIsBase64Encoded() {
+ return isBase64Encoded;
+ }
+
+ public void setIsBase64Encoded(boolean isBase64Encoded) {
+ this.isBase64Encoded = isBase64Encoded;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ APIGatewayV2WebSocketEvent that = (APIGatewayV2WebSocketEvent) o;
+
+ if (isBase64Encoded != that.isBase64Encoded) return false;
+ if (resource != null ? !resource.equals(that.resource) : that.resource != null) return false;
+ if (path != null ? !path.equals(that.path) : that.path != null) return false;
+ if (httpMethod != null ? !httpMethod.equals(that.httpMethod) : that.httpMethod != null) return false;
+ if (headers != null ? !headers.equals(that.headers) : that.headers != null) return false;
+ if (multiValueHeaders != null ? !multiValueHeaders.equals(that.multiValueHeaders) : that.multiValueHeaders != null)
+ return false;
+ if (queryStringParameters != null ? !queryStringParameters.equals(that.queryStringParameters) : that.queryStringParameters != null)
+ return false;
+ if (multiValueQueryStringParameters != null ? !multiValueQueryStringParameters.equals(that.multiValueQueryStringParameters) : that.multiValueQueryStringParameters != null)
+ return false;
+ if (pathParameters != null ? !pathParameters.equals(that.pathParameters) : that.pathParameters != null)
+ return false;
+ if (stageVariables != null ? !stageVariables.equals(that.stageVariables) : that.stageVariables != null)
+ return false;
+ if (requestContext != null ? !requestContext.equals(that.requestContext) : that.requestContext != null)
+ return false;
+ return body != null ? body.equals(that.body) : that.body == null;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = resource != null ? resource.hashCode() : 0;
+ result = 31 * result + (path != null ? path.hashCode() : 0);
+ result = 31 * result + (httpMethod != null ? httpMethod.hashCode() : 0);
+ result = 31 * result + (headers != null ? headers.hashCode() : 0);
+ result = 31 * result + (multiValueHeaders != null ? multiValueHeaders.hashCode() : 0);
+ result = 31 * result + (queryStringParameters != null ? queryStringParameters.hashCode() : 0);
+ result = 31 * result + (multiValueQueryStringParameters != null ? multiValueQueryStringParameters.hashCode() : 0);
+ result = 31 * result + (pathParameters != null ? pathParameters.hashCode() : 0);
+ result = 31 * result + (stageVariables != null ? stageVariables.hashCode() : 0);
+ result = 31 * result + (requestContext != null ? requestContext.hashCode() : 0);
+ result = 31 * result + (body != null ? body.hashCode() : 0);
+ result = 31 * result + (isBase64Encoded ? 1 : 0);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("APIGatewayV2WebSocketEvent{");
+ sb.append("resource='").append(resource).append('\'');
+ sb.append(", path='").append(path).append('\'');
+ sb.append(", httpMethod='").append(httpMethod).append('\'');
+ sb.append(", headers=").append(headers);
+ sb.append(", multiValueHeaders=").append(multiValueHeaders);
+ sb.append(", queryStringParameters=").append(queryStringParameters);
+ sb.append(", multiValueQueryStringParameters=").append(multiValueQueryStringParameters);
+ sb.append(", pathParameters=").append(pathParameters);
+ sb.append(", stageVariables=").append(stageVariables);
+ sb.append(", requestContext=").append(requestContext);
+ sb.append(", body='").append(body).append('\'');
+ sb.append(", isBase64Encoded=").append(isBase64Encoded);
+ sb.append('}');
+ return sb.toString();
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2WebSocketResponse.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2WebSocketResponse.java
new file mode 100644
index 000000000..87e4284cd
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2WebSocketResponse.java
@@ -0,0 +1,110 @@
+package com.amazonaws.services.lambda.runtime.events;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * @author Tim Gustafson
+ */
+public class APIGatewayV2WebSocketResponse implements Serializable, Cloneable {
+
+ private static final long serialVersionUID = -5155789062248356200L;
+
+ private boolean isBase64Encoded = false;
+ private int statusCode;
+ private Map headers;
+ private Map multiValueHeaders;
+ private String body;
+
+ public boolean isIsBase64Encoded() {
+ return isBase64Encoded;
+ }
+
+ public void setIsBase64Encoded(boolean isBase64Encoded) {
+ this.isBase64Encoded = isBase64Encoded;
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public void setStatusCode(int statusCode) {
+ this.statusCode = statusCode;
+ }
+
+ public Map getHeaders() {
+ return headers;
+ }
+
+ public void setHeaders(Map headers) {
+ this.headers = headers;
+ }
+
+ public Map getMultiValueHeaders() {
+ return multiValueHeaders;
+ }
+
+ public void setMultiValueHeaders(Map multiValueHeaders) {
+ this.multiValueHeaders = multiValueHeaders;
+ }
+
+ public String getBody() {
+ return body;
+ }
+
+ public void setBody(String body) {
+ this.body = body;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 3;
+ hash = 71 * hash + (this.isBase64Encoded ? 1 : 0);
+ hash = 71 * hash + this.statusCode;
+ hash = 71 * hash + (this.headers != null ? this.headers.hashCode() : 0);
+ hash = 71 * hash + (this.multiValueHeaders != null ? this.multiValueHeaders.hashCode() : 0);
+ hash = 71 * hash + (this.body != null ? this.body.hashCode() : 0);
+ return hash;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final APIGatewayV2WebSocketResponse other = (APIGatewayV2WebSocketResponse) obj;
+ if (this.isBase64Encoded != other.isBase64Encoded) {
+ return false;
+ }
+ if (this.statusCode != other.statusCode) {
+ return false;
+ }
+ if ((this.body == null) ? (other.body != null) : !this.body.equals(other.body)) {
+ return false;
+ }
+ if (this.headers != other.headers && (this.headers == null || !this.headers.equals(other.headers))) {
+ return false;
+ }
+ if (this.multiValueHeaders != other.multiValueHeaders && (this.multiValueHeaders == null || !this.multiValueHeaders.equals(other.multiValueHeaders))) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "{isBase64Encoded=" + isBase64Encoded
+ + ", statusCode=" + statusCode
+ + ", headers=" + headers
+ + ", multiValueHeaders=" + multiValueHeaders
+ + ", body=" + body
+ + "}";
+ }
+
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ActiveMQEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ActiveMQEvent.java
new file mode 100644
index 000000000..e896a223e
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ActiveMQEvent.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2015-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.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import java.util.List;
+import java.util.Map;
+
+/**
+* Represents an Active MQ event sent to Lambda
+* Onboarding Amazon MQ as event source to Lambda
+*/
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder(setterPrefix = "with")
+public class ActiveMQEvent {
+ private String eventSource;
+ private String eventSourceArn;
+ private List messages;
+
+ @Data
+ @NoArgsConstructor
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ public static class ActiveMQMessage {
+ private String messageID;
+ private String messageType;
+ private long timestamp;
+ private int deliveryMode;
+ private String correlationID;
+ private String replyTo;
+ private Destination destination;
+ private boolean redelivered;
+ private String type;
+ private long expiration;
+ private int priority;
+ /** Message data sent to Active MQ broker encooded in Base 64 **/
+ private String data;
+ private long brokerInTime;
+ private long brokerOutTime;
+ private Map properties;
+ }
+
+ @Data
+ @NoArgsConstructor
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ public static class Destination {
+ /** Queue Name **/
+ private String physicalName;
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/AppSyncLambdaAuthorizerEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/AppSyncLambdaAuthorizerEvent.java
new file mode 100644
index 000000000..0bb6c8b06
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/AppSyncLambdaAuthorizerEvent.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2015-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 java.util.Map;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * Class that represents the input to an AppSync Lambda authorizer invocation.
+ */
+@Data
+@Builder(setterPrefix = "with")
+@NoArgsConstructor
+@AllArgsConstructor
+public class AppSyncLambdaAuthorizerEvent {
+
+ private RequestContext requestContext;
+ private String authorizationToken;
+ private Map requestHeaders;
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class RequestContext {
+
+ private String apiId;
+ private String accountId;
+ private String requestId;
+ private String queryDocument;
+ private String operationName;
+ private Map variables;
+ }
+
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/AppSyncLambdaAuthorizerResponse.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/AppSyncLambdaAuthorizerResponse.java
new file mode 100644
index 000000000..4eec5aa3d
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/AppSyncLambdaAuthorizerResponse.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2015-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 java.util.Map;
+import java.util.List;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * Class that represents the output from an AppSync Lambda authorizer invocation.
+ */
+@Data
+@Builder(setterPrefix = "with")
+@NoArgsConstructor
+@AllArgsConstructor
+public class AppSyncLambdaAuthorizerResponse {
+
+ private boolean isAuthorized;
+ private Map resolverContext;
+ private List deniedFields;
+ private int ttlOverride;
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ApplicationLoadBalancerRequestEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ApplicationLoadBalancerRequestEvent.java
new file mode 100644
index 000000000..e7b33117e
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ApplicationLoadBalancerRequestEvent.java
@@ -0,0 +1,48 @@
+package com.amazonaws.services.lambda.runtime.events;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Class to represent the request event from Application Load Balancer.
+ *
+ * @see Using AWS Lambda with an Application Load Balancer
+ *
+ * @author msailes
+ */
+
+@NoArgsConstructor
+@Data
+public class ApplicationLoadBalancerRequestEvent implements Serializable, Cloneable {
+
+ @NoArgsConstructor
+ @Data
+ public static class Elb implements Serializable, Cloneable {
+
+ private String targetGroupArn;
+
+ }
+
+ @NoArgsConstructor
+ @Data
+ public static class RequestContext implements Serializable, Cloneable {
+
+ private Elb elb;
+
+ }
+
+ private RequestContext requestContext;
+ private String httpMethod;
+ private String path;
+ private Map queryStringParameters;
+ private Map> multiValueQueryStringParameters;
+ private Map headers;
+ private Map> multiValueHeaders;
+ private String body;
+ private boolean isBase64Encoded;
+
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ApplicationLoadBalancerResponseEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ApplicationLoadBalancerResponseEvent.java
new file mode 100644
index 000000000..135de143f
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ApplicationLoadBalancerResponseEvent.java
@@ -0,0 +1,29 @@
+package com.amazonaws.services.lambda.runtime.events;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Class to represent the response event to Application Load Balancer.
+ *
+ * @see Using AWS Lambda with an Application Load Balancer
+ *
+ * @author msailes
+ */
+
+@NoArgsConstructor
+@Data
+public class ApplicationLoadBalancerResponseEvent implements Serializable, Cloneable {
+
+ private int statusCode;
+ private String statusDescription;
+ private boolean isBase64Encoded;
+ private Map headers;
+ private Map> multiValueHeaders;
+ private String body;
+
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CloudFormationCustomResourceEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CloudFormationCustomResourceEvent.java
new file mode 100644
index 000000000..37c00a903
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CloudFormationCustomResourceEvent.java
@@ -0,0 +1,50 @@
+/*
+ * 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.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * Class to represent the custom resource request event from CloudFormation.
+ *
+ * CloudFormation invokes your Lambda function asynchronously with this event and includes a callback URL. The function
+ * is responsible for returning a response to the callback URL that indicates success or failure.
+ *
+ * @see Using AWS Lambda with AWS CloudFormation
+ *
+ * @author msailes
+ */
+
+@Data
+@Builder(setterPrefix = "with")
+@NoArgsConstructor
+@AllArgsConstructor
+public class CloudFormationCustomResourceEvent implements Serializable, Cloneable {
+
+ private String requestType;
+ private String serviceToken;
+ private String responseUrl;
+ private String stackId;
+ private String requestId;
+ private String logicalResourceId;
+ private String physicalResourceId;
+ private String resourceType;
+ private Map resourceProperties;
+ private Map oldResourceProperties;
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CloudWatchCompositeAlarmEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CloudWatchCompositeAlarmEvent.java
new file mode 100644
index 000000000..d4090b55b
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CloudWatchCompositeAlarmEvent.java
@@ -0,0 +1,70 @@
+package com.amazonaws.services.lambda.runtime.events;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * Represents an CloudWatch Composite Alarm event. This event occurs when a composite alarm is triggered.
+ *
+ * @see Using Amazon CloudWatch alarms
+ */
+@Data
+@Builder(setterPrefix = "with")
+@NoArgsConstructor
+@AllArgsConstructor
+public class CloudWatchCompositeAlarmEvent {
+ private String source;
+ private String alarmArn;
+ private String accountId;
+ private String time;
+ private String region;
+ private AlarmData alarmData;
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class AlarmData {
+ private String alarmName;
+ private State state;
+ private PreviousState previousState;
+ private Configuration configuration;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class State {
+ private String value;
+ private String reason;
+ private String reasonData;
+ private String timestamp;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class PreviousState {
+ private String value;
+ private String reason;
+ private String reasonData;
+ private String timestamp;
+ private String actionsSuppressedBy;
+ private String actionsSuppressedReason;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class Configuration {
+ private String alarmRule;
+ private String actionsSuppressor;
+ private Integer actionsSuppressorWaitPeriod;
+ private Integer actionsSuppressorExtensionPeriod;
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CloudWatchMetricAlarmEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CloudWatchMetricAlarmEvent.java
new file mode 100644
index 000000000..2b5f503c3
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CloudWatchMetricAlarmEvent.java
@@ -0,0 +1,99 @@
+package com.amazonaws.services.lambda.runtime.events;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Represents an CloudWatch Metric Alarm event. This event occurs when a metric alarm is triggered.
+ *
+ * @see Using Amazon CloudWatch alarms
+ */
+@Data
+@Builder(setterPrefix = "with")
+@NoArgsConstructor
+@AllArgsConstructor
+public class CloudWatchMetricAlarmEvent {
+ private String source;
+ private String alarmArn;
+ private String accountId;
+ private String time;
+ private String region;
+ private AlarmData alarmData;
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class AlarmData {
+ private String alarmName;
+ private State state;
+ private PreviousState previousState;
+ private Configuration configuration;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class State {
+ private String value;
+ private String reason;
+ private String timestamp;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class PreviousState {
+ private String value;
+ private String reason;
+ private String reasonData;
+ private String timestamp;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class Configuration {
+ private String description;
+ private List metrics;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class Metric {
+ private String id;
+ private MetricStat metricStat;
+ private Boolean returnData;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class MetricStat {
+ private MetricDetail metric;
+ private Integer period;
+ private String stat;
+ private String unit;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class MetricDetail {
+ private String namespace;
+ private String name;
+ private Map dimensions;
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolCreateAuthChallengeEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolCreateAuthChallengeEvent.java
new file mode 100644
index 000000000..6074ca9b5
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolCreateAuthChallengeEvent.java
@@ -0,0 +1,124 @@
+/*
+ * 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 Create Auth Challenge Lambda Trigger
+ *
+ * See Create Auth Challenge Lambda Trigger
+ *
+ * @author jvdl
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@ToString(callSuper = true)
+public class CognitoUserPoolCreateAuthChallengeEvent 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 CognitoUserPoolCreateAuthChallengeEvent(
+ 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 create auth challenge trigger.
+ */
+ private Map clientMetadata;
+ /**
+ * The name of the new challenge.
+ */
+ private String challengeName;
+ private ChallengeResult[] session;
+ /**
+ * 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 challengeName, ChallengeResult[] session, boolean userNotFound) {
+ super(userAttributes);
+ this.clientMetadata = clientMetadata;
+ this.session = session;
+ this.userNotFound = userNotFound;
+ this.challengeName = challengeName;
+ }
+ }
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class ChallengeResult {
+ /**
+ * The challenge type. One of: "CUSTOM_CHALLENGE", "PASSWORD_VERIFIER", "SMS_MFA", "DEVICE_SRP_AUTH", "DEVICE_PASSWORD_VERIFIER", or "ADMIN_NO_SRP_AUTH".
+ */
+ private String challengeName;
+ /**
+ * Set to true if the user successfully completed the challenge, or false otherwise.
+ */
+ private boolean challengeResult;
+ /**
+ * Your name for the custom challenge. Used only if challengeName is CUSTOM_CHALLENGE.
+ */
+ private String challengeMetadata;
+ }
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class Response {
+ /**
+ * One or more key-value pairs for the client app to use in the challenge to be presented to the user.
+ * Contains the question that is presented to the user.
+ */
+ private Map publicChallengeParameters;
+ /**
+ * Contains the valid answers for the question in publicChallengeParameters
+ */
+ private Map privateChallengeParameters;
+ /**
+ * Your name for the custom challenge, if this is a custom challenge.
+ */
+ private String challengeMetadata;
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolCustomMessageEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolCustomMessageEvent.java
new file mode 100644
index 000000000..403f85393
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolCustomMessageEvent.java
@@ -0,0 +1,101 @@
+/*
+ * 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 Custom Message Lambda Trigger
+ *
+ * See Custom Message Lambda Trigger
+ *
+ * @author jvdl
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@ToString(callSuper = true)
+public class CognitoUserPoolCustomMessageEvent 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 CognitoUserPoolCustomMessageEvent(
+ 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 custom message trigger.
+ */
+ private Map clientMetadata;
+ /**
+ * A string for you to use as the placeholder for the verification code in the custom message.
+ */
+ private String codeParameter;
+ /**
+ * The username parameter. It is a required request parameter for the admin create user flow.
+ */
+ private String usernameParameter;
+
+ @Builder(setterPrefix = "with")
+ public Request(Map userAttributes, Map clientMetadata, String codeParameter, String usernameParameter) {
+ super(userAttributes);
+ this.clientMetadata = clientMetadata;
+ this.codeParameter = codeParameter;
+ this.usernameParameter = usernameParameter;
+ }
+ }
+
+ @Data
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ public static class Response {
+ /**
+ * The custom SMS message to be sent to your users. Must include the codeParameter value received in the request.
+ */
+ private String smsMessage;
+ /**
+ * The custom email message to be sent to your users. Must include the codeParameter value received in the request.
+ */
+ private String emailMessage;
+ /**
+ * The subject line for the custom message.
+ */
+ private String emailSubject;
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolDefineAuthChallengeEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolDefineAuthChallengeEvent.java
new file mode 100644
index 000000000..8577c9f7a
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolDefineAuthChallengeEvent.java
@@ -0,0 +1,123 @@
+/*
+ * 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 Define Auth Challenge Lambda Trigger
+ *
+ * See Define Auth Challenge Lambda Trigger
+ *
+ * @author jvdl
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@ToString(callSuper = true)
+public class CognitoUserPoolDefineAuthChallengeEvent 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 CognitoUserPoolDefineAuthChallengeEvent(
+ 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 define auth challenge trigger.
+ */
+ private Map clientMetadata;
+
+ private ChallengeResult[] session;
+
+ /**
+ * A Boolean that is populated when PreventUserExistenceErrors is set to ENABLED for your user pool client.
+ * A value of true means that the user id (user name, email address, etc.) did not match any existing users.
+ */
+ private boolean userNotFound;
+
+ @Builder(setterPrefix = "with")
+ public Request(Map userAttributes, Map clientMetadata, ChallengeResult[] session, boolean userNotFound) {
+ super(userAttributes);
+ this.clientMetadata = clientMetadata;
+ this.session = session;
+ this.userNotFound = userNotFound;
+ }
+ }
+
+ @Data
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ public static class ChallengeResult {
+ /**
+ * The challenge type. One of: CUSTOM_CHALLENGE, SRP_A, PASSWORD_VERIFIER, SMS_MFA, DEVICE_SRP_AUTH, DEVICE_PASSWORD_VERIFIER, or ADMIN_NO_SRP_AUTH.
+ */
+ private String challengeName;
+ /**
+ * Set to true if the user successfully completed the challenge, or false otherwise.
+ */
+ private boolean challengeResult;
+ /**
+ * Your name for the custom challenge. Used only if challengeName is CUSTOM_CHALLENGE.
+ */
+ private String challengeMetadata;
+ }
+
+ @Data
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ public static class Response {
+ /**
+ * Name of the next challenge, if you want to present a new challenge to your user.
+ */
+ private String challengeName;
+
+ /**
+ * Set to true if you determine that the user has been sufficiently authenticated by completing the challenges, or false otherwise.
+ */
+ private boolean issueTokens;
+
+ /**
+ * Set to true if you want to terminate the current authentication process, or false otherwise.
+ */
+ private boolean failAuthentication;
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolEvent.java
new file mode 100644
index 000000000..17c4b409d
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolEvent.java
@@ -0,0 +1,89 @@
+/*
+ * 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.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Map;
+
+/**
+ * Represent the base class for all Cognito User Pool Events
+ *
+ * See Customizing User Pool Workflows with Lambda Triggers
+ *
+ * @author jvdl
+ */
+@AllArgsConstructor
+@Data
+@NoArgsConstructor
+public abstract class CognitoUserPoolEvent {
+
+ /**
+ * The version number of your Lambda function.
+ */
+ private String version;
+
+ /**
+ * The name of the event that triggered the Lambda function.
+ */
+ private String triggerSource;
+
+ /**
+ * The AWS Region.
+ */
+ private String region;
+
+ /**
+ * The user pool ID for the user pool.
+ */
+ private String userPoolId;
+
+ /**
+ * The username of the current user.
+ */
+ private String userName;
+
+ /**
+ * The caller context.
+ */
+ private CallerContext callerContext;
+
+ @AllArgsConstructor
+ @Data
+ @NoArgsConstructor
+ public static abstract class Request {
+ /**
+ * One or more pairs of user attribute names and values.
+ */
+ private Map userAttributes;
+ }
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class CallerContext {
+ /**
+ * The AWS SDK version number.
+ */
+ private String awsSdkVersion;
+
+ /**
+ * The ID of the client associated with the user pool.
+ */
+ private String clientId;
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolMigrateUserEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolMigrateUserEvent.java
new file mode 100644
index 000000000..381010a76
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolMigrateUserEvent.java
@@ -0,0 +1,121 @@
+/*
+ * 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 Migrate User Lambda Trigger
+ *
+ * See Migrate User Lambda Trigger
+ *
+ * @author jvdl
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@ToString(callSuper = true)
+public class CognitoUserPoolMigrateUserEvent 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 CognitoUserPoolMigrateUserEvent(
+ 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 {
+ /**
+ * The username entered by the user.
+ */
+ private String userName;
+ /**
+ * The password entered by the user for sign-in. It is not set in the forgot-password flow.
+ */
+ private String password;
+ /**
+ * One or more key-value pairs containing the validation data in the user's sign-in request.
+ */
+ private Map validationData;
+ /**
+ * One or more key-value pairs that you can provide as custom input to the Lambda function that you specify for the migrate user trigger.
+ */
+ private Map clientMetadata;
+
+ @Builder(setterPrefix = "with")
+ public Request(Map userAttributes, Map validationData, Map clientMetadata, String userName, String password) {
+ super(userAttributes);
+ this.validationData = validationData;
+ this.clientMetadata = clientMetadata;
+ this.userName = userName;
+ this.password = password;
+ }
+ }
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class Response {
+
+ /**
+ * It must contain one or more name-value pairs representing user attributes to be stored in the user profile in your user pool.
+ */
+ private Map userAttributes;
+
+ /**
+ * During sign-in, this attribute can be set to CONFIRMED, or not set, to auto-confirm your users and allow them to sign-in with their previous passwords.
+ */
+ private String finalUserStatus;
+
+ /**
+ * This attribute can be set to "SUPPRESS" to suppress the welcome message usually sent by Amazon Cognito to new users.
+ * If this attribute is not returned, the welcome message will be sent.
+ */
+ private String messageAction;
+
+ /**
+ * This attribute can be set to "EMAIL" to send the welcome message by email, or "SMS" to send the welcome message by SMS.
+ * If this attribute is not returned, the welcome message will be sent by SMS.
+ */
+ private String[] desiredDeliveryMediums;
+
+ /**
+ * If this parameter is set to "true" and the phone number or email address specified in the UserAttributes parameter already exists as an alias with a different user, the API call will migrate the alias from the previous user to the newly created user.
+ */
+ private boolean forceAliasCreation;
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPostAuthenticationEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPostAuthenticationEvent.java
new file mode 100644
index 000000000..de1af6565
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPostAuthenticationEvent.java
@@ -0,0 +1,76 @@
+/*
+ * 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.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 Post Authentication Lambda Trigger
+ *
+ * See Post Authentication Lambda Trigger
+ *
+ * @author jvdl
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@ToString(callSuper = true)
+public class CognitoUserPoolPostAuthenticationEvent extends CognitoUserPoolEvent {
+
+ /**
+ * The request from the Amazon Cognito service.
+ */
+ private Request request;
+
+ @Builder(setterPrefix = "with")
+ public CognitoUserPoolPostAuthenticationEvent(
+ String version,
+ String triggerSource,
+ String region,
+ String userPoolId,
+ String userName,
+ CallerContext callerContext,
+ Request request) {
+ super(version, triggerSource, region, userPoolId, userName, callerContext);
+ this.request = request;
+ }
+
+ @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 post authentication trigger.
+ */
+ private Map clientMetadata;
+
+ /**
+ * This flag indicates if the user has signed in on a new device.
+ */
+ private boolean newDeviceUsed;
+
+ @Builder(setterPrefix = "with")
+ public Request(Map userAttributes, Map clientMetadata, boolean newDeviceUsed) {
+ super(userAttributes);
+ this.clientMetadata = clientMetadata;
+ this.newDeviceUsed = newDeviceUsed;
+ }
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPostConfirmationEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPostConfirmationEvent.java
new file mode 100644
index 000000000..4a835489d
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPostConfirmationEvent.java
@@ -0,0 +1,70 @@
+/*
+ * 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.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 Post Confirmation Lambda Trigger
+ *
+ * See Post Confirmation Lambda Trigger
+ *
+ * @author jvdl
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@NoArgsConstructor
+@ToString(callSuper = true)
+public class CognitoUserPoolPostConfirmationEvent extends CognitoUserPoolEvent {
+
+ /**
+ * The request from the Amazon Cognito service.
+ */
+ private Request request;
+
+ @Builder(setterPrefix = "with")
+ public CognitoUserPoolPostConfirmationEvent(
+ String version,
+ String triggerSource,
+ String region,
+ String userPoolId,
+ String userName,
+ CallerContext callerContext,
+ Request request) {
+ super(version, triggerSource, region, userPoolId, userName, callerContext);
+ this.request = request;
+ }
+
+ @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 post confirmation trigger.
+ */
+ private Map clientMetadata;
+
+ @Builder(setterPrefix = "with")
+ public Request(Map userAttributes, Map clientMetadata) {
+ super(userAttributes);
+ this.clientMetadata = clientMetadata;
+ }
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPreAuthenticationEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPreAuthenticationEvent.java
new file mode 100644
index 000000000..110160415
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPreAuthenticationEvent.java
@@ -0,0 +1,77 @@
+/*
+ * 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.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 Authentication Lambda Trigger
+ *
+ * See Pre Authentication Lambda Trigger
+ *
+ * @author jvdl
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@ToString(callSuper = true)
+public class CognitoUserPoolPreAuthenticationEvent extends CognitoUserPoolEvent {
+
+ /**
+ * The request from the Amazon Cognito service.
+ */
+ private Request request;
+
+ @Builder(setterPrefix = "with")
+ public CognitoUserPoolPreAuthenticationEvent(
+ String version,
+ String triggerSource,
+ String region,
+ String userPoolId,
+ String userName,
+ CallerContext callerContext,
+ Request request) {
+ super(version, triggerSource, region, userPoolId, userName, callerContext);
+ this.request = request;
+ }
+
+ @Data
+ @EqualsAndHashCode(callSuper = true)
+ @NoArgsConstructor
+ @ToString(callSuper = true)
+ public static class Request extends CognitoUserPoolEvent.Request {
+ /**
+ * One or more name-value pairs containing the validation data in the request to register a user.
+ * The validation data is set and then passed from the client in the request to register a user.
+ */
+ private Map validationData;
+
+ /**
+ * 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 validationData, boolean userNotFound) {
+ super(userAttributes);
+ this.validationData = validationData;
+ this.userNotFound = userNotFound;
+ }
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPreSignUpEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPreSignUpEvent.java
new file mode 100644
index 000000000..da7a848e5
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPreSignUpEvent.java
@@ -0,0 +1,104 @@
+/*
+ * 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 Pre Sign-up Lambda Trigger
+ *
+ * See Pre Sign-up Lambda Trigger
+ *
+ * @author jvdl
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@ToString(callSuper = true)
+public class CognitoUserPoolPreSignUpEvent 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 CognitoUserPoolPreSignUpEvent(
+ 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 name-value pairs containing the validation data in the request to register a user.
+ * The validation data is set and then passed from the client in the request to register a user.
+ */
+ private Map validationData;
+
+ /**
+ * One or more key-value pairs that you can provide as custom input
+ * to the Lambda function that you specify for the pre sign-up trigger.
+ */
+ private Map clientMetadata;
+
+ @Builder(setterPrefix = "with")
+ public Request(Map userAttributes, Map validationData, Map clientMetadata) {
+ super(userAttributes);
+ this.validationData = validationData;
+ this.clientMetadata = clientMetadata;
+ }
+ }
+
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @Data
+ @NoArgsConstructor
+ public static class Response {
+ /**
+ * Set to true to auto-confirm the user, or false otherwise.
+ */
+ private boolean autoConfirmUser;
+
+ /**
+ * Set to true to set as verified the phone number of a user who is signing up, or false otherwise.
+ * If autoVerifyPhone is set to true, the phone_number attribute must have a valid, non-null value.
+ */
+ private boolean autoVerifyPhone;
+
+ /**
+ * Set to true to set as verified the email of a user who is signing up, or false otherwise.
+ * If autoVerifyEmail is set to true, the email attribute must have a valid, non-null value.
+ */
+ private boolean autoVerifyEmail;
+ }
+}
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPreTokenGenerationEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPreTokenGenerationEvent.java
new file mode 100644
index 000000000..e49ce3c40
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CognitoUserPoolPreTokenGenerationEvent.java
@@ -0,0 +1,125 @@
+/*
+ * 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 Pre Token Generation Lambda Trigger
+ *
+ * See Pre Token Generation Lambda Trigger
+ *
+ * @author jvdl
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@ToString(callSuper = true)
+public class CognitoUserPoolPreTokenGenerationEvent 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 CognitoUserPoolPreTokenGenerationEvent(
+ 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 pre token generation trigger.
+ */
+ private Map clientMetadata;
+
+ /**
+ * The input object containing the current group configuration.
+ */
+ private GroupConfiguration groupConfiguration;
+
+ @Builder(setterPrefix = "with")
+ public Request(Map userAttributes, Map clientMetadata, GroupConfiguration groupConfiguration) {
+ super(userAttributes);
+ this.clientMetadata = clientMetadata;
+ this.groupConfiguration = groupConfiguration;
+ }
+ }
+
+ @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 ClaimsOverrideDetails claimsOverrideDetails;
+ }
+
+ @Data
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ public static class ClaimsOverrideDetails {
+ /**
+ * A map of one or more key-value pairs of claims to add or override.
+ * For group related claims, use groupOverrideDetails instead.
+ */
+ private Map 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
new file mode 100644
index 000000000..e94875614
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ConnectEvent.java
@@ -0,0 +1,92 @@
+/*
+ * 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.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * Class to represent an Amazon Connect contact flow event.
+ *
+ * @see parameters;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class ContactData implements Serializable, Cloneable {
+ private Map attributes;
+ private String channel;
+ private String contactId;
+ private CustomerEndpoint customerEndpoint;
+ private String initialContactId;
+ private String initiationMethod;
+ private String instanceArn;
+ private String previousContactId;
+ private Queue queue;
+ private SystemEndpoint systemEndpoint;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class CustomerEndpoint implements Serializable, Cloneable {
+ private String address;
+ private String type;
+ }
+
+ @Data
+ @Builder(setterPrefix = "with")
+ @NoArgsConstructor
+ @AllArgsConstructor
+ 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/DynamodbEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/DynamodbEvent.java
index 6853e381d..353f587f0 100644
--- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/DynamodbEvent.java
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/DynamodbEvent.java
@@ -1,9 +1,17 @@
-/* Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
-
+/*
+ * Copyright 2015-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 com.amazonaws.services.dynamodbv2.model.Record;
-
import java.io.Serializable;
import java.util.List;
@@ -19,7 +27,7 @@ public class DynamodbEvent implements Serializable, Cloneable {
/**
* The unit of data of an Amazon DynamoDB event
*/
- public static class DynamodbStreamRecord extends Record {
+ public static class DynamodbStreamRecord extends com.amazonaws.services.lambda.runtime.events.models.dynamodb.Record {
private static final long serialVersionUID = 3638381544604354963L;
@@ -52,7 +60,7 @@ public void setEventSourceARN(String eventSourceARN) {
*
* @return A string representation of this object.
*
- * @see java.lang.Object#toString()
+ * @see Object#toString()
*/
@Override
public String toString() {
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/DynamodbTimeWindowEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/DynamodbTimeWindowEvent.java
new file mode 100644
index 000000000..64ed9fb29
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/DynamodbTimeWindowEvent.java
@@ -0,0 +1,83 @@
+/*
+ * 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 com.amazonaws.services.lambda.runtime.events.models.TimeWindow;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Represents an Amazon Dynamodb event when using time windows.
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+public class DynamodbTimeWindowEvent extends DynamodbEvent implements Serializable, Cloneable {
+
+ private static final long serialVersionUID = -5449871161108629510L;
+
+ /**
+ * Time window for the records in the event.
+ */
+ private TimeWindow window;
+
+ /**
+ * State being built up to this invoke in the time window.
+ */
+ private Map state;
+
+ /**
+ * Shard id of the records
+ */
+ private String shardId;
+
+ /**
+ * Dynamodb stream arn.
+ */
+ private String eventSourceArn;
+
+ /**
+ * Set to true for the last invoke of the time window. Subsequent invoke will start a new time window along with a fresh state.
+ */
+ private Boolean isFinalInvokeForWindow;
+
+ /**
+ * Set to true if window is terminated prematurely. Subsequent invoke will continue the same window with a fresh state.
+ */
+ private Boolean isWindowTerminatedEarly;
+
+ @Builder(setterPrefix = "with")
+ public DynamodbTimeWindowEvent(
+ final List records,
+ final TimeWindow window,
+ final Map state,
+ final String shardId,
+ final String eventSourceArn,
+ final Boolean isFinalInvokeForWindow,
+ final Boolean isWindowTerminatedEarly) {
+ this.setRecords(records);
+ this.window = window;
+ this.state = state;
+ this.shardId = shardId;
+ this.eventSourceArn = eventSourceArn;
+ this.isFinalInvokeForWindow = isFinalInvokeForWindow;
+ this.isWindowTerminatedEarly = isWindowTerminatedEarly;
+ }
+}
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
new file mode 100644
index 000000000..aa6c00de3
--- /dev/null
+++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/KafkaEvent.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2015-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.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import java.util.List;
+import java.util.Map;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder(setterPrefix = "with")
+/** Represents a Kafka Event. **/
+public class KafkaEvent {
+ private Map> records;
+ private String eventSource;
+ private String eventSourceArn;
+ private String bootstrapServers;
+
+ @Data
+ @NoArgsConstructor
+ @AllArgsConstructor
+ @Builder(setterPrefix = "with")
+ public static class KafkaEventRecord {
+ private String topic;
+ private int partition;
+ private long offset;
+ private long timestamp;
+ private String timestampType;
+ private String key;
+ private String value;
+ private List