diff --git a/aws-lambda-java-events/pom.xml b/aws-lambda-java-events/pom.xml
index a0f25dc5..a13e94b0 100644
--- a/aws-lambda-java-events/pom.xml
+++ b/aws-lambda-java-events/pom.xml
@@ -1,11 +1,11 @@
- *
- *
- *
- *
- * The data blob, which is base64-encoded when the blob is serialized. The maximum size of the data blob, before - * base64-encoding, is 1,000 KB. - *
- */ - private ByteBuffer data; - - private String recordId; - - private Long approximateArrivalEpoch; - - private Long approximateArrivalTimestamp; - - private Map- * The data blob, which is base64-encoded when the blob is serialized. The maximum size of the data blob, before - * base64-encoding, is 1,000 KB. - *
- *- * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. - * Users of the SDK should not perform Base64 encoding on this field. - *
- *- * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will - * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or - * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future - * major version of the SDK. - *
- * - * @param data - * The data blob, which is base64-encoded when the blob is serialized. The maximum size of the data blob, - * before base64-encoding, is 1,000 KB. - */ - public void setData(ByteBuffer data) { - this.data = data; - } - - /** - *- * The data blob, which is base64-encoded when the blob is serialized. The maximum size of the data blob, before - * base64-encoding, is 1,000 KB. - *
- *- * {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend - * using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent - * {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}. - * Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the - * {@code position}. - *
- * - * @return The data blob, which is base64-encoded when the blob is serialized. The maximum size of the data blob, - * before base64-encoding, is 1,000 KB. - */ - public ByteBuffer getData() { - return this.data; - } - - /** - * @return record id - */ - public String getRecordId() { - return this.recordId; - } - - /** - * @param recordId record id - */ - public void setRecordId(String recordId) { - this.recordId = recordId; - } - - /** - * @param recordId record id - * @return Record - */ - public Record withRecordId(String recordId) { - setRecordId(recordId); - return this; - } - - /** - * @return approximate arrival epoch - */ - public Long getApproximateArrivalEpoch() { - return this.approximateArrivalEpoch; - } - - /** - * @param approximateArrivalEpoch Long epoch - */ - public void setApproximateArrivalEpoch(Long approximateArrivalEpoch) { - this.approximateArrivalEpoch = approximateArrivalEpoch; - } - - /** - * @param approximateArrivalEpoch Long epoch - * @return Record - */ - public Record withApproximateArrivalEpoch(Long approximateArrivalEpoch) { - setApproximateArrivalEpoch(approximateArrivalEpoch); - return this; - } - - /** - * @return approximate arrival timestamp - */ - public Long getApproximateArrivalTimestamp() { - return this.approximateArrivalTimestamp; - } - - /** - * @param approximateArrivalTimestamp approximate arrival timestamp - */ - public void setApproximateArrivalTimestamp(Long approximateArrivalTimestamp) { - this.approximateArrivalTimestamp = approximateArrivalTimestamp; - } - - /** - * @param approximateArrivalTimestamp approximate arrival timestamp - * @return Record - */ - public Record withApproximateArrivalTimestamp(Long approximateArrivalTimestamp) { - setApproximateArrivalTimestamp(approximateArrivalTimestamp); - return this; - } - - /** - * @return kinesis record meta data - */ - public Map+ *
+ * A globally unique identifier for the event that was recorded in this stream record. + *
+ */ + private String eventID; + /** + *+ * The type of data modification that was performed on the DynamoDB table: + *
+ *
+ * INSERT
- a new item was added to the table.
+ *
+ * MODIFY
- one or more of an existing item's attributes were modified.
+ *
+ * REMOVE
- the item was deleted from the table
+ *
+ * The version number of the stream record format. This number is updated whenever the structure of
+ * Record
is modified.
+ *
+ * Client applications must not assume that eventVersion
will remain at a particular value, as this
+ * number is subject to change at any time. In general, eventVersion
will only increase as the
+ * low-level DynamoDB Streams API evolves.
+ *
+ * The AWS service from which the stream record originated. For DynamoDB Streams, this is aws:dynamodb
.
+ *
+ * The region in which the GetRecords
request was received.
+ *
+ * The main body of the stream record, containing all of the DynamoDB-specific fields. + *
+ */ + private StreamRecord dynamodb; + /** + *+ * Items that are deleted by the Time to Live process after expiration have the following fields: + *
+ *+ * Records[].userIdentity.type + *
+ *+ * "Service" + *
+ *+ * Records[].userIdentity.principalId + *
+ *+ * "dynamodb.amazonaws.com" + *
+ *+ * The type of data modification that was performed on the DynamoDB table: + *
+ *
+ * INSERT
- a new item was added to the table.
+ *
+ * MODIFY
- one or more of an existing item's attributes were modified.
+ *
+ * REMOVE
- the item was deleted from the table
+ *
+ * INSERT
- a new item was added to the table.
+ *
+ * MODIFY
- one or more of an existing item's attributes were modified.
+ *
+ * REMOVE
- the item was deleted from the table
+ *
+ * The type of data modification that was performed on the DynamoDB table: + *
+ *
+ * INSERT
- a new item was added to the table.
+ *
+ * MODIFY
- one or more of an existing item's attributes were modified.
+ *
+ * REMOVE
- the item was deleted from the table
+ *
+ * INSERT
- a new item was added to the table.
+ *
+ * MODIFY
- one or more of an existing item's attributes were modified.
+ *
+ * REMOVE
- the item was deleted from the table
+ *
+ * Represents the data for an attribute. + *
+ *+ * Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself. + *
+ *+ * For more information, see Data Types in the Amazon DynamoDB Developer Guide. + *
+ * + * @see AWS API + * Documentation + */ + @NoArgsConstructor + @ToString + @EqualsAndHashCode + public static class AttributeValue implements Serializable, Cloneable { + + /** + *+ * An attribute of type String. For example: + *
+ *
+ * "S": "Hello"
+ *
+ * An attribute of type Number. For example: + *
+ *
+ * "N": "123.45"
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and + * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. + *
+ */ + @JsonProperty("N") + private String n; + /** + *+ * An attribute of type Binary. For example: + *
+ *
+ * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
+ *
+ * An attribute of type String Set. For example: + *
+ *
+ * "SS": ["Giraffe", "Hippo" ,"Zebra"]
+ *
+ * An attribute of type Number Set. For example: + *
+ *
+ * "NS": ["42.2", "-19", "7.5", "3.14"]
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and + * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. + *
+ */ + @JsonProperty("NS") + private java.util.List+ * An attribute of type Binary Set. For example: + *
+ *
+ * "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
+ *
+ * An attribute of type Map. For example: + *
+ *
+ * "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
+ *
+ * An attribute of type List. For example: + *
+ *
+ * "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
+ *
+ * An attribute of type Null. For example: + *
+ *
+ * "NULL": true
+ *
+ * An attribute of type Boolean. For example: + *
+ *
+ * "BOOL": true
+ *
+ * "S": "Hello"
+ */
+ public AttributeValue(String s) {
+ setS(s);
+ }
+
+ /**
+ * Constructs a new DynamodbAttributeValue object. Callers should use the setter or fluent setter (with...) methods to
+ * initialize any additional object members.
+ *
+ * @param sS
+ * An attribute of type String Set. For example:
+ *
+ * An attribute of type String. For example:
+ *
+ * "SS": ["Giraffe", "Hippo" ,"Zebra"]
+ */
+ public AttributeValue(java.util.List"S": "Hello"
+ *
+ * "S": "Hello"
+ */
+
+ public void setS(String s) {
+ this.s = s;
+ }
+
+ /**
+ *
+ * An attribute of type String. For example: + *
+ *
+ * "S": "Hello"
+ *
+ * "S": "Hello"
+ */
+
+ public String getS() {
+ return this.s;
+ }
+
+ /**
+ *
+ * An attribute of type String. For example: + *
+ *
+ * "S": "Hello"
+ *
+ * "S": "Hello"
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withS(String s) {
+ setS(s);
+ return this;
+ }
+
+ /**
+ *
+ * An attribute of type Number. For example: + *
+ *
+ * "N": "123.45"
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and + * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. + *
+ * + * @param n + * An attribute of type Number. For example: + *
+ * "N": "123.45"
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and + * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. + */ + + public void setN(String n) { + this.n = n; + } + + /** + *
+ * An attribute of type Number. For example: + *
+ *
+ * "N": "123.45"
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and + * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. + *
+ * + * @return An attribute of type Number. For example: + *
+ * "N": "123.45"
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages + * and libraries. However, DynamoDB treats them as number type attributes for mathematical operations. + */ + + public String getN() { + return this.n; + } + + /** + *
+ * An attribute of type Number. For example: + *
+ *
+ * "N": "123.45"
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and + * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. + *
+ * + * @param n + * An attribute of type Number. For example: + *
+ * "N": "123.45"
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and + * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. + * @return Returns a reference to this object so that method calls can be chained together. + */ + + public AttributeValue withN(String n) { + setN(n); + return this; + } + + /** + *
+ * An attribute of type Binary. For example: + *
+ *
+ * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
+ *
+ * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. + * Users of the SDK should not perform Base64 encoding on this field. + *
+ *+ * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will + * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or + * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future + * major version of the SDK. + *
+ * + * @param b + * An attribute of type Binary. For example: + *
+ * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
+ */
+
+ public void setB(java.nio.ByteBuffer b) {
+ this.b = b;
+ }
+
+ /**
+ *
+ * An attribute of type Binary. For example: + *
+ *
+ * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
+ *
+ * {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend + * using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent + * {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}. + * Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the + * {@code position}. + *
+ * + * @return An attribute of type Binary. For example: + *
+ * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
+ */
+
+ public java.nio.ByteBuffer getB() {
+ return this.b;
+ }
+
+ /**
+ *
+ * An attribute of type Binary. For example: + *
+ *
+ * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
+ *
+ * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. + * Users of the SDK should not perform Base64 encoding on this field. + *
+ *+ * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will + * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or + * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future + * major version of the SDK. + *
+ * + * @param b + * An attribute of type Binary. For example: + *
+ * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withB(java.nio.ByteBuffer b) {
+ setB(b);
+ return this;
+ }
+
+ /**
+ *
+ * An attribute of type String Set. For example: + *
+ *
+ * "SS": ["Giraffe", "Hippo" ,"Zebra"]
+ *
+ *
+ * An attribute of type String Set. For example:
+ *
+ * "SS": ["Giraffe", "Hippo" ,"Zebra"]
+ */
+
+ public java.util.List"SS": ["Giraffe", "Hippo" ,"Zebra"]
+ *
+ *
+ * An attribute of type String Set. For example:
+ *
+ *
+ * NOTE: This method appends the values to the existing list (if any). Use
+ * {@link #setSS(java.util.Collection)} or {@link #withSS(java.util.Collection)} if you want to override the
+ * existing values.
+ * "SS": ["Giraffe", "Hippo" ,"Zebra"]
+ */
+
+ public void setSS(java.util.Collection"SS": ["Giraffe", "Hippo" ,"Zebra"]
+ *
+ *
+ * An attribute of type String Set. For example:
+ *
+ * "SS": ["Giraffe", "Hippo" ,"Zebra"]
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withSS(String... sS) {
+ if (this.sS == null) {
+ setSS(new java.util.ArrayList"SS": ["Giraffe", "Hippo" ,"Zebra"]
+ *
+ *
+ * An attribute of type Number Set. For example:
+ *
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
+ * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
+ * "SS": ["Giraffe", "Hippo" ,"Zebra"]
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withSS(java.util.Collection"NS": ["42.2", "-19", "7.5", "3.14"]
+ *
+ * "NS": ["42.2", "-19", "7.5", "3.14"]
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages
+ * and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
+ */
+
+ public java.util.List
+ * An attribute of type Number Set. For example:
+ *
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
+ * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
+ * "NS": ["42.2", "-19", "7.5", "3.14"]
+ *
+ * "NS": ["42.2", "-19", "7.5", "3.14"]
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
+ * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
+ */
+
+ public void setNS(java.util.Collection
+ * An attribute of type Number Set. For example:
+ *
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
+ * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
+ *
+ * NOTE: This method appends the values to the existing list (if any). Use
+ * {@link #setNS(java.util.Collection)} or {@link #withNS(java.util.Collection)} if you want to override the
+ * existing values.
+ * "NS": ["42.2", "-19", "7.5", "3.14"]
+ *
+ * "NS": ["42.2", "-19", "7.5", "3.14"]
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
+ * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withNS(String... nS) {
+ if (this.nS == null) {
+ setNS(new java.util.ArrayList
+ * An attribute of type Number Set. For example:
+ *
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
+ * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
+ * "NS": ["42.2", "-19", "7.5", "3.14"]
+ *
+ * "NS": ["42.2", "-19", "7.5", "3.14"]
+ *
+ * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
+ * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withNS(java.util.Collection
+ * An attribute of type Binary Set. For example:
+ *
+ * "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
+ *
+ *
+ * An attribute of type Binary Set. For example:
+ *
+ * "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
+ */
+
+ public java.util.List"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
+ *
+ *
+ * An attribute of type Binary Set. For example:
+ *
+ *
+ * NOTE: This method appends the values to the existing list (if any). Use
+ * {@link #setBS(java.util.Collection)} or {@link #withBS(java.util.Collection)} if you want to override the
+ * existing values.
+ * "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
+ */
+
+ public void setBS(java.util.Collection"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
+ *
+ *
+ * An attribute of type Binary Set. For example:
+ *
+ * "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withBS(java.nio.ByteBuffer... bS) {
+ if (this.bS == null) {
+ setBS(new java.util.ArrayList"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
+ *
+ *
+ * An attribute of type Map. For example:
+ *
+ * "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withBS(java.util.Collection"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
+ *
+ *
+ * An attribute of type Map. For example:
+ *
+ * "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
+ */
+
+ public java.util.Map"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
+ *
+ *
+ * An attribute of type Map. For example:
+ *
+ * "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
+ */
+
+ public void setM(java.util.Map"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
+ *
+ *
+ * An attribute of type List. For example:
+ *
+ * "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withM(java.util.Map"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
+ *
+ *
+ * An attribute of type List. For example:
+ *
+ * "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
+ */
+
+ public java.util.List"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
+ *
+ *
+ * An attribute of type List. For example:
+ *
+ *
+ * NOTE: This method appends the values to the existing list (if any). Use
+ * {@link #setL(java.util.Collection)} or {@link #withL(java.util.Collection)} if you want to override the existing
+ * values.
+ * "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
+ */
+
+ public void setL(java.util.Collection"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
+ *
+ *
+ * An attribute of type List. For example:
+ *
+ * "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withL(AttributeValue... l) {
+ if (this.l == null) {
+ setL(new java.util.ArrayList"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
+ *
+ *
+ * An attribute of type Null. For example:
+ *
+ * "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withL(java.util.Collection"NULL": true
+ *
+ * "NULL": true
+ */
+
+ public void setNULL(Boolean nULLValue) {
+ this.nULLValue = nULLValue;
+ }
+
+ /**
+ *
+ * An attribute of type Null. For example: + *
+ *
+ * "NULL": true
+ *
+ * "NULL": true
+ */
+
+ public Boolean getNULL() {
+ return this.nULLValue;
+ }
+
+ /**
+ *
+ * An attribute of type Null. For example: + *
+ *
+ * "NULL": true
+ *
+ * "NULL": true
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withNULL(Boolean nULLValue) {
+ setNULL(nULLValue);
+ return this;
+ }
+
+ /**
+ *
+ * An attribute of type Null. For example: + *
+ *
+ * "NULL": true
+ *
+ * "NULL": true
+ */
+
+ public Boolean isNULL() {
+ return this.nULLValue;
+ }
+
+ /**
+ *
+ * An attribute of type Boolean. For example: + *
+ *
+ * "BOOL": true
+ *
+ * "BOOL": true
+ */
+
+ public void setBOOL(Boolean bOOL) {
+ this.bOOL = bOOL;
+ }
+
+ /**
+ *
+ * An attribute of type Boolean. For example: + *
+ *
+ * "BOOL": true
+ *
+ * "BOOL": true
+ */
+
+ public Boolean getBOOL() {
+ return this.bOOL;
+ }
+
+ /**
+ *
+ * An attribute of type Boolean. For example: + *
+ *
+ * "BOOL": true
+ *
+ * "BOOL": true
+ * @return Returns a reference to this object so that method calls can be chained together.
+ */
+
+ public AttributeValue withBOOL(Boolean bOOL) {
+ setBOOL(bOOL);
+ return this;
+ }
+
+ /**
+ *
+ * An attribute of type Boolean. For example: + *
+ *
+ * "BOOL": true
+ *
+ * "BOOL": true
+ */
+
+ public Boolean isBOOL() {
+ return this.bOOL;
+ }
+
+ @Override
+ public AttributeValue clone() {
+ try {
+ return (AttributeValue) super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() even though we're Cloneable!", e);
+ }
+ }
+
+ }
+
+ /**
+ *
+ * Contains details about the type of identity that made the request. + *
+ * + * @see AWS API + * Documentation + */ + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class Identity implements Serializable, Cloneable { + + /** + *+ * A unique identifier for the entity that made the call. For Time To Live, the principalId is + * "dynamodb.amazonaws.com". + *
+ */ + private String principalId; + + /** + *+ * The type of the identity. For Time To Live, the type is "Service". + *
+ */ + private String type; + + @Override + public Identity clone() { + try { + return (Identity) super.clone(); + } catch (CloneNotSupportedException e) { + throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); + } + } + + } + + public enum OperationType { + + INSERT("INSERT"), + MODIFY("MODIFY"), + REMOVE("REMOVE"); + + private String value; + + private OperationType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } + + /** + * Use this in place of valueOf. + * + * @param value + * real value + * @return OperationType corresponding to the value + * + * @throws IllegalArgumentException + * If the specified value does not map to one of the known values in this enum. + */ + public static OperationType fromValue(String value) { + if (value == null || "".equals(value)) { + throw new IllegalArgumentException("Value cannot be null or empty!"); + } + + for (OperationType enumEntry : OperationType.values()) { + if (enumEntry.toString().equals(value)) { + return enumEntry; + } + } + throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); + } + } + + /** + *+ * A description of a single data modification that was performed on an item in a DynamoDB table. + *
+ * + * @see AWS API + * Documentation + */ + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class StreamRecord implements Serializable, Cloneable { + + /** + *+ * The approximate date and time when the stream record was created, in UNIX epoch time format. + *
+ */ + @JsonProperty("ApproximateCreationDateTime") + private java.time.Instant approximateCreationDateTime; + /** + *+ * The primary key attribute(s) for the DynamoDB item that was modified. + *
+ */ + @JsonProperty("Keys") + private java.util.Map+ * The item in the DynamoDB table as it appeared after it was modified. + *
+ */ + @JsonProperty("NewImage") + private java.util.Map+ * The item in the DynamoDB table as it appeared before it was modified. + *
+ */ + @JsonProperty("OldImage") + private java.util.Map+ * The sequence number of the stream record. + *
+ */ + @JsonProperty("SequenceNumber") + private String sequenceNumber; + /** + *+ * The size of the stream record, in bytes. + *
+ */ + @JsonProperty("SizeBytes") + private Long sizeBytes; + /** + *+ * The type of data from the modified DynamoDB item that was captured in this stream record: + *
+ *
+ * KEYS_ONLY
- only the key attributes of the modified item.
+ *
+ * NEW_IMAGE
- the entire item, as it appeared after it was modified.
+ *
+ * OLD_IMAGE
- the entire item, as it appeared before it was modified.
+ *
+ * NEW_AND_OLD_IMAGES
- both the new and the old item images of the item.
+ *
+ * The unique identifier of the record within its shard. + *
+ */ + private String sequenceNumber; + /** + *+ * The approximate time that the record was inserted into the stream. + *
+ */ + private java.time.Instant approximateArrivalTimestamp; + /** + *+ * The data blob. The data in the blob is both opaque and immutable to Kinesis Data Streams, which does not inspect, + * interpret, or change the data in the blob in any way. When the data blob (the payload before base64-encoding) is + * added to the partition key size, the total size must not exceed the maximum record size (1 MB). + *
+ *+ * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. + * Users of the SDK should not perform Base64 encoding on this field. + *
+ *+ * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will + * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or + * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future + * major version of the SDK. + *
+ */ + private java.nio.ByteBuffer data; + /** + *+ * Identifies which shard in the stream the data record is assigned to. + *
+ */ + private String partitionKey; + /** + *+ * The encryption type used on the record. This parameter can be one of the following values: + *
+ *
+ * NONE
: Do not encrypt the records in the stream.
+ *
+ * KMS
: Use server-side encryption on the records in the stream using a customer-managed AWS KMS key.
+ *
+ * The data blob, which is base64-encoded when the blob is serialized. The maximum size of the data blob, before + * base64-encoding, is 1,000 KB. + *
+ *+ * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. + * Users of the SDK should not perform Base64 encoding on this field. + *
+ *+ * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will + * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or + * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future + * major version of the SDK. + *
+ */ + private ByteBuffer data; + + private String recordId; + + private Long approximateArrivalEpoch; + + private Long approximateArrivalTimestamp; + + private Map- * Represents the data for an attribute. - *
- *- * Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself. - *
- *- * For more information, see Data Types in the Amazon DynamoDB Developer Guide. - *
- * - * @see AWS API - * Documentation - */ -public class AttributeValue implements Serializable, Cloneable { - - /** - *- * An attribute of type String. For example: - *
- *
- * "S": "Hello"
- *
- * An attribute of type Number. For example: - *
- *
- * "N": "123.45"
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and - * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. - *
- */ - private String n; - /** - *- * An attribute of type Binary. For example: - *
- *
- * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
- *
- * An attribute of type String Set. For example: - *
- *
- * "SS": ["Giraffe", "Hippo" ,"Zebra"]
- *
- * An attribute of type Number Set. For example: - *
- *
- * "NS": ["42.2", "-19", "7.5", "3.14"]
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and - * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. - *
- */ - private java.util.List- * An attribute of type Binary Set. For example: - *
- *
- * "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
- *
- * An attribute of type Map. For example: - *
- *
- * "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
- *
- * An attribute of type List. For example: - *
- *
- * "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
- *
- * An attribute of type Null. For example: - *
- *
- * "NULL": true
- *
- * An attribute of type Boolean. For example: - *
- *
- * "BOOL": true
- *
- * "S": "Hello"
- */
- public AttributeValue(String s) {
- setS(s);
- }
-
- /**
- * Constructs a new DynamodbAttributeValue object. Callers should use the setter or fluent setter (with...) methods to
- * initialize any additional object members.
- *
- * @param sS
- * An attribute of type String Set. For example:
- *
- * An attribute of type String. For example:
- *
- * "SS": ["Giraffe", "Hippo" ,"Zebra"]
- */
- public AttributeValue(java.util.List"S": "Hello"
- *
- * "S": "Hello"
- */
-
- public void setS(String s) {
- this.s = s;
- }
-
- /**
- *
- * An attribute of type String. For example: - *
- *
- * "S": "Hello"
- *
- * "S": "Hello"
- */
-
- public String getS() {
- return this.s;
- }
-
- /**
- *
- * An attribute of type String. For example: - *
- *
- * "S": "Hello"
- *
- * "S": "Hello"
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withS(String s) {
- setS(s);
- return this;
- }
-
- /**
- *
- * An attribute of type Number. For example: - *
- *
- * "N": "123.45"
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and - * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. - *
- * - * @param n - * An attribute of type Number. For example: - *
- * "N": "123.45"
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and - * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. - */ - - public void setN(String n) { - this.n = n; - } - - /** - *
- * An attribute of type Number. For example: - *
- *
- * "N": "123.45"
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and - * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. - *
- * - * @return An attribute of type Number. For example: - *
- * "N": "123.45"
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages - * and libraries. However, DynamoDB treats them as number type attributes for mathematical operations. - */ - - public String getN() { - return this.n; - } - - /** - *
- * An attribute of type Number. For example: - *
- *
- * "N": "123.45"
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and - * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. - *
- * - * @param n - * An attribute of type Number. For example: - *
- * "N": "123.45"
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and - * libraries. However, DynamoDB treats them as number type attributes for mathematical operations. - * @return Returns a reference to this object so that method calls can be chained together. - */ - - public AttributeValue withN(String n) { - setN(n); - return this; - } - - /** - *
- * An attribute of type Binary. For example: - *
- *
- * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
- *
- * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. - * Users of the SDK should not perform Base64 encoding on this field. - *
- *- * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will - * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or - * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future - * major version of the SDK. - *
- * - * @param b - * An attribute of type Binary. For example: - *
- * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
- */
-
- public void setB(java.nio.ByteBuffer b) {
- this.b = b;
- }
-
- /**
- *
- * An attribute of type Binary. For example: - *
- *
- * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
- *
- * {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend - * using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent - * {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}. - * Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the - * {@code position}. - *
- * - * @return An attribute of type Binary. For example: - *
- * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
- */
-
- public java.nio.ByteBuffer getB() {
- return this.b;
- }
-
- /**
- *
- * An attribute of type Binary. For example: - *
- *
- * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
- *
- * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. - * Users of the SDK should not perform Base64 encoding on this field. - *
- *- * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will - * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or - * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future - * major version of the SDK. - *
- * - * @param b - * An attribute of type Binary. For example: - *
- * "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withB(java.nio.ByteBuffer b) {
- setB(b);
- return this;
- }
-
- /**
- *
- * An attribute of type String Set. For example: - *
- *
- * "SS": ["Giraffe", "Hippo" ,"Zebra"]
- *
- *
- * An attribute of type String Set. For example:
- *
- * "SS": ["Giraffe", "Hippo" ,"Zebra"]
- */
-
- public java.util.List"SS": ["Giraffe", "Hippo" ,"Zebra"]
- *
- *
- * An attribute of type String Set. For example:
- *
- *
- * NOTE: This method appends the values to the existing list (if any). Use
- * {@link #setSS(java.util.Collection)} or {@link #withSS(java.util.Collection)} if you want to override the
- * existing values.
- * "SS": ["Giraffe", "Hippo" ,"Zebra"]
- */
-
- public void setSS(java.util.Collection"SS": ["Giraffe", "Hippo" ,"Zebra"]
- *
- *
- * An attribute of type String Set. For example:
- *
- * "SS": ["Giraffe", "Hippo" ,"Zebra"]
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withSS(String... sS) {
- if (this.sS == null) {
- setSS(new java.util.ArrayList"SS": ["Giraffe", "Hippo" ,"Zebra"]
- *
- *
- * An attribute of type Number Set. For example:
- *
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
- * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
- * "SS": ["Giraffe", "Hippo" ,"Zebra"]
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withSS(java.util.Collection"NS": ["42.2", "-19", "7.5", "3.14"]
- *
- * "NS": ["42.2", "-19", "7.5", "3.14"]
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages
- * and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
- */
-
- public java.util.List
- * An attribute of type Number Set. For example:
- *
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
- * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
- * "NS": ["42.2", "-19", "7.5", "3.14"]
- *
- * "NS": ["42.2", "-19", "7.5", "3.14"]
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
- * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
- */
-
- public void setNS(java.util.Collection
- * An attribute of type Number Set. For example:
- *
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
- * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
- *
- * NOTE: This method appends the values to the existing list (if any). Use
- * {@link #setNS(java.util.Collection)} or {@link #withNS(java.util.Collection)} if you want to override the
- * existing values.
- * "NS": ["42.2", "-19", "7.5", "3.14"]
- *
- * "NS": ["42.2", "-19", "7.5", "3.14"]
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
- * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withNS(String... nS) {
- if (this.nS == null) {
- setNS(new java.util.ArrayList
- * An attribute of type Number Set. For example:
- *
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
- * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
- * "NS": ["42.2", "-19", "7.5", "3.14"]
- *
- * "NS": ["42.2", "-19", "7.5", "3.14"]
- *
- * Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and
- * libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withNS(java.util.Collection
- * An attribute of type Binary Set. For example:
- *
- * "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
- *
- *
- * An attribute of type Binary Set. For example:
- *
- * "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
- */
-
- public java.util.List"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
- *
- *
- * An attribute of type Binary Set. For example:
- *
- *
- * NOTE: This method appends the values to the existing list (if any). Use
- * {@link #setBS(java.util.Collection)} or {@link #withBS(java.util.Collection)} if you want to override the
- * existing values.
- * "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
- */
-
- public void setBS(java.util.Collection"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
- *
- *
- * An attribute of type Binary Set. For example:
- *
- * "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withBS(java.nio.ByteBuffer... bS) {
- if (this.bS == null) {
- setBS(new java.util.ArrayList"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
- *
- *
- * An attribute of type Map. For example:
- *
- * "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withBS(java.util.Collection"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
- *
- *
- * An attribute of type Map. For example:
- *
- * "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
- */
-
- public java.util.Map"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
- *
- *
- * An attribute of type Map. For example:
- *
- * "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
- */
-
- public void setM(java.util.Map"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
- *
- *
- * An attribute of type List. For example:
- *
- * "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withM(java.util.Map"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
- *
- *
- * An attribute of type List. For example:
- *
- * "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
- */
-
- public java.util.List"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
- *
- *
- * An attribute of type List. For example:
- *
- *
- * NOTE: This method appends the values to the existing list (if any). Use
- * {@link #setL(java.util.Collection)} or {@link #withL(java.util.Collection)} if you want to override the existing
- * values.
- * "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
- */
-
- public void setL(java.util.Collection"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
- *
- *
- * An attribute of type List. For example:
- *
- * "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withL(AttributeValue... l) {
- if (this.l == null) {
- setL(new java.util.ArrayList"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
- *
- *
- * An attribute of type Null. For example:
- *
- * "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withL(java.util.Collection"NULL": true
- *
- * "NULL": true
- */
-
- public void setNULL(Boolean nULLValue) {
- this.nULLValue = nULLValue;
- }
-
- /**
- *
- * An attribute of type Null. For example: - *
- *
- * "NULL": true
- *
- * "NULL": true
- */
-
- public Boolean getNULL() {
- return this.nULLValue;
- }
-
- /**
- *
- * An attribute of type Null. For example: - *
- *
- * "NULL": true
- *
- * "NULL": true
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withNULL(Boolean nULLValue) {
- setNULL(nULLValue);
- return this;
- }
-
- /**
- *
- * An attribute of type Null. For example: - *
- *
- * "NULL": true
- *
- * "NULL": true
- */
-
- public Boolean isNULL() {
- return this.nULLValue;
- }
-
- /**
- *
- * An attribute of type Boolean. For example: - *
- *
- * "BOOL": true
- *
- * "BOOL": true
- */
-
- public void setBOOL(Boolean bOOL) {
- this.bOOL = bOOL;
- }
-
- /**
- *
- * An attribute of type Boolean. For example: - *
- *
- * "BOOL": true
- *
- * "BOOL": true
- */
-
- public Boolean getBOOL() {
- return this.bOOL;
- }
-
- /**
- *
- * An attribute of type Boolean. For example: - *
- *
- * "BOOL": true
- *
- * "BOOL": true
- * @return Returns a reference to this object so that method calls can be chained together.
- */
-
- public AttributeValue withBOOL(Boolean bOOL) {
- setBOOL(bOOL);
- return this;
- }
-
- /**
- *
- * An attribute of type Boolean. For example: - *
- *
- * "BOOL": true
- *
- * "BOOL": true
- */
-
- public Boolean isBOOL() {
- return this.bOOL;
- }
-
- /**
- * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
- * redacted from this string using a placeholder value.
- *
- * @return A string representation of this object.
- *
- * @see Object#toString()
- */
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("{");
- if (getS() != null)
- sb.append("S: ").append(getS()).append(",");
- if (getN() != null)
- sb.append("N: ").append(getN()).append(",");
- if (getB() != null)
- sb.append("B: ").append(getB()).append(",");
- if (getSS() != null)
- sb.append("SS: ").append(getSS()).append(",");
- if (getNS() != null)
- sb.append("NS: ").append(getNS()).append(",");
- if (getBS() != null)
- sb.append("BS: ").append(getBS()).append(",");
- if (getM() != null)
- sb.append("M: ").append(getM()).append(",");
- if (getL() != null)
- sb.append("L: ").append(getL()).append(",");
- if (getNULL() != null)
- sb.append("NULL: ").append(getNULL()).append(",");
- if (getBOOL() != null)
- sb.append("BOOL: ").append(getBOOL());
- sb.append("}");
- return sb.toString();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
-
- if (obj instanceof AttributeValue == false)
- return false;
- AttributeValue other = (AttributeValue) obj;
- if (other.getS() == null ^ this.getS() == null)
- return false;
- if (other.getS() != null && other.getS().equals(this.getS()) == false)
- return false;
- if (other.getN() == null ^ this.getN() == null)
- return false;
- if (other.getN() != null && other.getN().equals(this.getN()) == false)
- return false;
- if (other.getB() == null ^ this.getB() == null)
- return false;
- if (other.getB() != null && other.getB().equals(this.getB()) == false)
- return false;
- if (other.getSS() == null ^ this.getSS() == null)
- return false;
- if (other.getSS() != null && other.getSS().equals(this.getSS()) == false)
- return false;
- if (other.getNS() == null ^ this.getNS() == null)
- return false;
- if (other.getNS() != null && other.getNS().equals(this.getNS()) == false)
- return false;
- if (other.getBS() == null ^ this.getBS() == null)
- return false;
- if (other.getBS() != null && other.getBS().equals(this.getBS()) == false)
- return false;
- if (other.getM() == null ^ this.getM() == null)
- return false;
- if (other.getM() != null && other.getM().equals(this.getM()) == false)
- return false;
- if (other.getL() == null ^ this.getL() == null)
- return false;
- if (other.getL() != null && other.getL().equals(this.getL()) == false)
- return false;
- if (other.getNULL() == null ^ this.getNULL() == null)
- return false;
- if (other.getNULL() != null && other.getNULL().equals(this.getNULL()) == false)
- return false;
- if (other.getBOOL() == null ^ this.getBOOL() == null)
- return false;
- if (other.getBOOL() != null && other.getBOOL().equals(this.getBOOL()) == false)
- return false;
- return true;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int hashCode = 1;
-
- hashCode = prime * hashCode + ((getS() == null) ? 0 : getS().hashCode());
- hashCode = prime * hashCode + ((getN() == null) ? 0 : getN().hashCode());
- hashCode = prime * hashCode + ((getB() == null) ? 0 : getB().hashCode());
- hashCode = prime * hashCode + ((getSS() == null) ? 0 : getSS().hashCode());
- hashCode = prime * hashCode + ((getNS() == null) ? 0 : getNS().hashCode());
- hashCode = prime * hashCode + ((getBS() == null) ? 0 : getBS().hashCode());
- hashCode = prime * hashCode + ((getM() == null) ? 0 : getM().hashCode());
- hashCode = prime * hashCode + ((getL() == null) ? 0 : getL().hashCode());
- hashCode = prime * hashCode + ((getNULL() == null) ? 0 : getNULL().hashCode());
- hashCode = prime * hashCode + ((getBOOL() == null) ? 0 : getBOOL().hashCode());
- return hashCode;
- }
-
- @Override
- public AttributeValue clone() {
- try {
- return (AttributeValue) super.clone();
- } catch (CloneNotSupportedException e) {
- throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() even though we're Cloneable!", e);
- }
- }
-
-}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/models/dynamodb/Identity.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/models/dynamodb/Identity.java
deleted file mode 100644
index 12b2fbba..00000000
--- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/models/dynamodb/Identity.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * 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.models.dynamodb;
-
-import java.io.Serializable;
-
-/**
- *
- * Contains details about the type of identity that made the request. - *
- * - * @see AWS API - * Documentation - */ -public class Identity implements Serializable, Cloneable { - - /** - *- * A unique identifier for the entity that made the call. For Time To Live, the principalId is - * "dynamodb.amazonaws.com". - *
- */ - private String principalId; - - /** - *- * The type of the identity. For Time To Live, the type is "Service". - *
- */ - private String type; - - /** - *- * A unique identifier for the entity that made the call. For Time To Live, the principalId is - * "dynamodb.amazonaws.com". - *
- * - * @param principalId - * A unique identifier for the entity that made the call. For Time To Live, the principalId is - * "dynamodb.amazonaws.com". - */ - public void setPrincipalId(String principalId) { - this.principalId = principalId; - } - - /** - *- * A unique identifier for the entity that made the call. For Time To Live, the principalId is - * "dynamodb.amazonaws.com". - *
- * - * @return A unique identifier for the entity that made the call. For Time To Live, the principalId is - * "dynamodb.amazonaws.com". - */ - public String getPrincipalId() { - return this.principalId; - } - - /** - *- * A unique identifier for the entity that made the call. For Time To Live, the principalId is - * "dynamodb.amazonaws.com". - *
- * - * @param principalId - * A unique identifier for the entity that made the call. For Time To Live, the principalId is - * "dynamodb.amazonaws.com". - * @return Returns a reference to this object so that method calls can be chained together. - */ - public Identity withPrincipalId(String principalId) { - setPrincipalId(principalId); - return this; - } - - /** - *- * The type of the identity. For Time To Live, the type is "Service". - *
- * - * @param type - * The type of the identity. For Time To Live, the type is "Service". - */ - public void setType(String type) { - this.type = type; - } - - /** - *- * The type of the identity. For Time To Live, the type is "Service". - *
- * - * @return The type of the identity. For Time To Live, the type is "Service". - */ - public String getType() { - return this.type; - } - - /** - *- * The type of the identity. For Time To Live, the type is "Service". - *
- * - * @param type - * The type of the identity. For Time To Live, the type is "Service". - * @return Returns a reference to this object so that method calls can be chained together. - */ - public Identity withType(String type) { - setType(type); - return this; - } - - /** - * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be - * redacted from this string using a placeholder value. - * - * @return A string representation of this object. - * - * @see Object#toString() - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{"); - if (getPrincipalId() != null) - sb.append("PrincipalId: ").append(getPrincipalId()).append(","); - if (getType() != null) - sb.append("Type: ").append(getType()); - sb.append("}"); - return sb.toString(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - - if (obj instanceof Identity == false) - return false; - Identity other = (Identity) obj; - if (other.getPrincipalId() == null ^ this.getPrincipalId() == null) - return false; - if (other.getPrincipalId() != null && other.getPrincipalId().equals(this.getPrincipalId()) == false) - return false; - if (other.getType() == null ^ this.getType() == null) - return false; - if (other.getType() != null && other.getType().equals(this.getType()) == false) - return false; - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int hashCode = 1; - - hashCode = prime * hashCode + ((getPrincipalId() == null) ? 0 : getPrincipalId().hashCode()); - hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); - return hashCode; - } - - @Override - public Identity clone() { - try { - return (Identity) super.clone(); - } catch (CloneNotSupportedException e) { - throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); - } - } - -} diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/models/dynamodb/OperationType.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/models/dynamodb/OperationType.java deleted file mode 100644 index 8d5574ee..00000000 --- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/models/dynamodb/OperationType.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.models.dynamodb; - -public enum OperationType { - - INSERT("INSERT"), - MODIFY("MODIFY"), - REMOVE("REMOVE"); - - private String value; - - private OperationType(String value) { - this.value = value; - } - - @Override - public String toString() { - return this.value; - } - - /** - * Use this in place of valueOf. - * - * @param value - * real value - * @return OperationType corresponding to the value - * - * @throws IllegalArgumentException - * If the specified value does not map to one of the known values in this enum. - */ - public static OperationType fromValue(String value) { - if (value == null || "".equals(value)) { - throw new IllegalArgumentException("Value cannot be null or empty!"); - } - - for (OperationType enumEntry : OperationType.values()) { - if (enumEntry.toString().equals(value)) { - return enumEntry; - } - } - throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); - } -} \ No newline at end of file diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/models/dynamodb/Record.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/models/dynamodb/Record.java deleted file mode 100644 index 81065811..00000000 --- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/models/dynamodb/Record.java +++ /dev/null @@ -1,801 +0,0 @@ -/* - * 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.models.dynamodb; - -import java.io.Serializable; - -/** - *- * A description of a unique event within a stream. - *
- * - * @see AWS API - * Documentation - */ -public class Record implements Serializable, Cloneable { - - /** - *- * A globally unique identifier for the event that was recorded in this stream record. - *
- */ - private String eventID; - /** - *- * The type of data modification that was performed on the DynamoDB table: - *
- *
- * INSERT
- a new item was added to the table.
- *
- * MODIFY
- one or more of an existing item's attributes were modified.
- *
- * REMOVE
- the item was deleted from the table
- *
- * The version number of the stream record format. This number is updated whenever the structure of
- * Record
is modified.
- *
- * Client applications must not assume that eventVersion
will remain at a particular value, as this
- * number is subject to change at any time. In general, eventVersion
will only increase as the
- * low-level DynamoDB Streams API evolves.
- *
- * The AWS service from which the stream record originated. For DynamoDB Streams, this is aws:dynamodb
.
- *
- * The region in which the GetRecords
request was received.
- *
- * The main body of the stream record, containing all of the DynamoDB-specific fields. - *
- */ - private StreamRecord dynamodb; - /** - *- * Items that are deleted by the Time to Live process after expiration have the following fields: - *
- *- * Records[].userIdentity.type - *
- *- * "Service" - *
- *- * Records[].userIdentity.principalId - *
- *- * "dynamodb.amazonaws.com" - *
- *- * A globally unique identifier for the event that was recorded in this stream record. - *
- * - * @param eventID - * A globally unique identifier for the event that was recorded in this stream record. - */ - public void setEventID(String eventID) { - this.eventID = eventID; - } - - /** - *- * A globally unique identifier for the event that was recorded in this stream record. - *
- * - * @return A globally unique identifier for the event that was recorded in this stream record. - */ - public String getEventID() { - return this.eventID; - } - - /** - *- * A globally unique identifier for the event that was recorded in this stream record. - *
- * - * @param eventID - * A globally unique identifier for the event that was recorded in this stream record. - * @return Returns a reference to this object so that method calls can be chained together. - */ - public Record withEventID(String eventID) { - setEventID(eventID); - return this; - } - - /** - *- * The type of data modification that was performed on the DynamoDB table: - *
- *
- * INSERT
- a new item was added to the table.
- *
- * MODIFY
- one or more of an existing item's attributes were modified.
- *
- * REMOVE
- the item was deleted from the table
- *
- * INSERT
- a new item was added to the table.
- *
- * MODIFY
- one or more of an existing item's attributes were modified.
- *
- * REMOVE
- the item was deleted from the table
- *
- * The type of data modification that was performed on the DynamoDB table: - *
- *
- * INSERT
- a new item was added to the table.
- *
- * MODIFY
- one or more of an existing item's attributes were modified.
- *
- * REMOVE
- the item was deleted from the table
- *
- * INSERT
- a new item was added to the table.
- *
- * MODIFY
- one or more of an existing item's attributes were modified.
- *
- * REMOVE
- the item was deleted from the table
- *
- * The type of data modification that was performed on the DynamoDB table: - *
- *
- * INSERT
- a new item was added to the table.
- *
- * MODIFY
- one or more of an existing item's attributes were modified.
- *
- * REMOVE
- the item was deleted from the table
- *
- * INSERT
- a new item was added to the table.
- *
- * MODIFY
- one or more of an existing item's attributes were modified.
- *
- * REMOVE
- the item was deleted from the table
- *
- * The type of data modification that was performed on the DynamoDB table: - *
- *
- * INSERT
- a new item was added to the table.
- *
- * MODIFY
- one or more of an existing item's attributes were modified.
- *
- * REMOVE
- the item was deleted from the table
- *
- * INSERT
- a new item was added to the table.
- *
- * MODIFY
- one or more of an existing item's attributes were modified.
- *
- * REMOVE
- the item was deleted from the table
- *
- * The type of data modification that was performed on the DynamoDB table: - *
- *
- * INSERT
- a new item was added to the table.
- *
- * MODIFY
- one or more of an existing item's attributes were modified.
- *
- * REMOVE
- the item was deleted from the table
- *
- * INSERT
- a new item was added to the table.
- *
- * MODIFY
- one or more of an existing item's attributes were modified.
- *
- * REMOVE
- the item was deleted from the table
- *
- * The version number of the stream record format. This number is updated whenever the structure of
- * Record
is modified.
- *
- * Client applications must not assume that eventVersion
will remain at a particular value, as this
- * number is subject to change at any time. In general, eventVersion
will only increase as the
- * low-level DynamoDB Streams API evolves.
- *
Record
is modified.
- *
- * Client applications must not assume that eventVersion
will remain at a particular value, as
- * this number is subject to change at any time. In general, eventVersion
will only increase as
- * the low-level DynamoDB Streams API evolves.
- */
- public void setEventVersion(String eventVersion) {
- this.eventVersion = eventVersion;
- }
-
- /**
- *
- * The version number of the stream record format. This number is updated whenever the structure of
- * Record
is modified.
- *
- * Client applications must not assume that eventVersion
will remain at a particular value, as this
- * number is subject to change at any time. In general, eventVersion
will only increase as the
- * low-level DynamoDB Streams API evolves.
- *
Record
is modified.
- *
- * Client applications must not assume that eventVersion
will remain at a particular value, as
- * this number is subject to change at any time. In general, eventVersion
will only increase as
- * the low-level DynamoDB Streams API evolves.
- */
- public String getEventVersion() {
- return this.eventVersion;
- }
-
- /**
- *
- * The version number of the stream record format. This number is updated whenever the structure of
- * Record
is modified.
- *
- * Client applications must not assume that eventVersion
will remain at a particular value, as this
- * number is subject to change at any time. In general, eventVersion
will only increase as the
- * low-level DynamoDB Streams API evolves.
- *
Record
is modified.
- *
- * Client applications must not assume that eventVersion
will remain at a particular value, as
- * this number is subject to change at any time. In general, eventVersion
will only increase as
- * the low-level DynamoDB Streams API evolves.
- * @return Returns a reference to this object so that method calls can be chained together.
- */
- public Record withEventVersion(String eventVersion) {
- setEventVersion(eventVersion);
- return this;
- }
-
- /**
- *
- * The AWS service from which the stream record originated. For DynamoDB Streams, this is aws:dynamodb
.
- *
aws:dynamodb
.
- */
- public void setEventSource(String eventSource) {
- this.eventSource = eventSource;
- }
-
- /**
- *
- * The AWS service from which the stream record originated. For DynamoDB Streams, this is aws:dynamodb
.
- *
aws:dynamodb
.
- */
- public String getEventSource() {
- return this.eventSource;
- }
-
- /**
- *
- * The AWS service from which the stream record originated. For DynamoDB Streams, this is aws:dynamodb
.
- *
aws:dynamodb
.
- * @return Returns a reference to this object so that method calls can be chained together.
- */
- public Record withEventSource(String eventSource) {
- setEventSource(eventSource);
- return this;
- }
-
- /**
- *
- * The region in which the GetRecords
request was received.
- *
GetRecords
request was received.
- */
- public void setAwsRegion(String awsRegion) {
- this.awsRegion = awsRegion;
- }
-
- /**
- *
- * The region in which the GetRecords
request was received.
- *
GetRecords
request was received.
- */
- public String getAwsRegion() {
- return this.awsRegion;
- }
-
- /**
- *
- * The region in which the GetRecords
request was received.
- *
GetRecords
request was received.
- * @return Returns a reference to this object so that method calls can be chained together.
- */
- public Record withAwsRegion(String awsRegion) {
- setAwsRegion(awsRegion);
- return this;
- }
-
- /**
- * - * The main body of the stream record, containing all of the DynamoDB-specific fields. - *
- * - * @param dynamodb - * The main body of the stream record, containing all of the DynamoDB-specific fields. - */ - public void setDynamodb(StreamRecord dynamodb) { - this.dynamodb = dynamodb; - } - - /** - *- * The main body of the stream record, containing all of the DynamoDB-specific fields. - *
- * - * @return The main body of the stream record, containing all of the DynamoDB-specific fields. - */ - public StreamRecord getDynamodb() { - return this.dynamodb; - } - - /** - *- * The main body of the stream record, containing all of the DynamoDB-specific fields. - *
- * - * @param dynamodb - * The main body of the stream record, containing all of the DynamoDB-specific fields. - * @return Returns a reference to this object so that method calls can be chained together. - */ - public Record withDynamodb(StreamRecord dynamodb) { - setDynamodb(dynamodb); - return this; - } - - /** - *- * Items that are deleted by the Time to Live process after expiration have the following fields: - *
- *- * Records[].userIdentity.type - *
- *- * "Service" - *
- *- * Records[].userIdentity.principalId - *
- *- * "dynamodb.amazonaws.com" - *
- *- * Records[].userIdentity.type - *
- *- * "Service" - *
- *- * Records[].userIdentity.principalId - *
- *- * "dynamodb.amazonaws.com" - *
- *- * Items that are deleted by the Time to Live process after expiration have the following fields: - *
- *- * Records[].userIdentity.type - *
- *- * "Service" - *
- *- * Records[].userIdentity.principalId - *
- *- * "dynamodb.amazonaws.com" - *
- *- * Records[].userIdentity.type - *
- *- * "Service" - *
- *- * Records[].userIdentity.principalId - *
- *- * "dynamodb.amazonaws.com" - *
- *- * Items that are deleted by the Time to Live process after expiration have the following fields: - *
- *- * Records[].userIdentity.type - *
- *- * "Service" - *
- *- * Records[].userIdentity.principalId - *
- *- * "dynamodb.amazonaws.com" - *
- *- * Records[].userIdentity.type - *
- *- * "Service" - *
- *- * Records[].userIdentity.principalId - *
- *- * "dynamodb.amazonaws.com" - *
- *- * A description of a single data modification that was performed on an item in a DynamoDB table. - *
- * - * @see AWS API - * Documentation - */ -public class StreamRecord implements Serializable, Cloneable { - - /** - *- * The approximate date and time when the stream record was created, in UNIX epoch time format. - *
- */ - private java.util.Date approximateCreationDateTime; - /** - *- * The primary key attribute(s) for the DynamoDB item that was modified. - *
- */ - private java.util.Map- * The item in the DynamoDB table as it appeared after it was modified. - *
- */ - private java.util.Map- * The item in the DynamoDB table as it appeared before it was modified. - *
- */ - private java.util.Map- * The sequence number of the stream record. - *
- */ - private String sequenceNumber; - /** - *- * The size of the stream record, in bytes. - *
- */ - private Long sizeBytes; - /** - *- * The type of data from the modified DynamoDB item that was captured in this stream record: - *
- *
- * KEYS_ONLY
- only the key attributes of the modified item.
- *
- * NEW_IMAGE
- the entire item, as it appeared after it was modified.
- *
- * OLD_IMAGE
- the entire item, as it appeared before it was modified.
- *
- * NEW_AND_OLD_IMAGES
- both the new and the old item images of the item.
- *
- * The approximate date and time when the stream record was created, in UNIX epoch time format. - *
- * - * @param approximateCreationDateTime - * The approximate date and time when the stream record was created, in UNIX epoch time format. - */ - public void setApproximateCreationDateTime(java.util.Date approximateCreationDateTime) { - this.approximateCreationDateTime = approximateCreationDateTime; - } - - /** - *- * The approximate date and time when the stream record was created, in UNIX epoch time format. - *
- * - * @return The approximate date and time when the stream record was created, in UNIX epoch time format. - */ - public java.util.Date getApproximateCreationDateTime() { - return this.approximateCreationDateTime; - } - - /** - *- * The approximate date and time when the stream record was created, in UNIX epoch time format. - *
- * - * @param approximateCreationDateTime - * The approximate date and time when the stream record was created, in UNIX epoch time format. - * @return Returns a reference to this object so that method calls can be chained together. - */ - public StreamRecord withApproximateCreationDateTime(java.util.Date approximateCreationDateTime) { - setApproximateCreationDateTime(approximateCreationDateTime); - return this; - } - - /** - *- * The primary key attribute(s) for the DynamoDB item that was modified. - *
- * - * @return The primary key attribute(s) for the DynamoDB item that was modified. - */ - public java.util.Map- * The primary key attribute(s) for the DynamoDB item that was modified. - *
- * - * @param keys - * The primary key attribute(s) for the DynamoDB item that was modified. - */ - public void setKeys(java.util.Map- * The primary key attribute(s) for the DynamoDB item that was modified. - *
- * - * @param keys - * The primary key attribute(s) for the DynamoDB item that was modified. - * @return Returns a reference to this object so that method calls can be chained together. - */ - public StreamRecord withKeys(java.util.Map- * The item in the DynamoDB table as it appeared after it was modified. - *
- * - * @return The item in the DynamoDB table as it appeared after it was modified. - */ - public java.util.Map- * The item in the DynamoDB table as it appeared after it was modified. - *
- * - * @param newImage - * The item in the DynamoDB table as it appeared after it was modified. - */ - public void setNewImage(java.util.Map- * The item in the DynamoDB table as it appeared after it was modified. - *
- * - * @param newImage - * The item in the DynamoDB table as it appeared after it was modified. - * @return Returns a reference to this object so that method calls can be chained together. - */ - public StreamRecord withNewImage(java.util.Map- * The item in the DynamoDB table as it appeared before it was modified. - *
- * - * @return The item in the DynamoDB table as it appeared before it was modified. - */ - public java.util.Map- * The item in the DynamoDB table as it appeared before it was modified. - *
- * - * @param oldImage - * The item in the DynamoDB table as it appeared before it was modified. - */ - public void setOldImage(java.util.Map- * The item in the DynamoDB table as it appeared before it was modified. - *
- * - * @param oldImage - * The item in the DynamoDB table as it appeared before it was modified. - * @return Returns a reference to this object so that method calls can be chained together. - */ - public StreamRecord withOldImage(java.util.Map- * The sequence number of the stream record. - *
- * - * @param sequenceNumber - * The sequence number of the stream record. - */ - public void setSequenceNumber(String sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - *- * The sequence number of the stream record. - *
- * - * @return The sequence number of the stream record. - */ - public String getSequenceNumber() { - return this.sequenceNumber; - } - - /** - *- * The sequence number of the stream record. - *
- * - * @param sequenceNumber - * The sequence number of the stream record. - * @return Returns a reference to this object so that method calls can be chained together. - */ - public StreamRecord withSequenceNumber(String sequenceNumber) { - setSequenceNumber(sequenceNumber); - return this; - } - - /** - *- * The size of the stream record, in bytes. - *
- * - * @param sizeBytes - * The size of the stream record, in bytes. - */ - public void setSizeBytes(Long sizeBytes) { - this.sizeBytes = sizeBytes; - } - - /** - *- * The size of the stream record, in bytes. - *
- * - * @return The size of the stream record, in bytes. - */ - public Long getSizeBytes() { - return this.sizeBytes; - } - - /** - *- * The size of the stream record, in bytes. - *
- * - * @param sizeBytes - * The size of the stream record, in bytes. - * @return Returns a reference to this object so that method calls can be chained together. - */ - public StreamRecord withSizeBytes(Long sizeBytes) { - setSizeBytes(sizeBytes); - return this; - } - - /** - *- * The type of data from the modified DynamoDB item that was captured in this stream record: - *
- *
- * KEYS_ONLY
- only the key attributes of the modified item.
- *
- * NEW_IMAGE
- the entire item, as it appeared after it was modified.
- *
- * OLD_IMAGE
- the entire item, as it appeared before it was modified.
- *
- * NEW_AND_OLD_IMAGES
- both the new and the old item images of the item.
- *
- * KEYS_ONLY
- only the key attributes of the modified item.
- *
- * NEW_IMAGE
- the entire item, as it appeared after it was modified.
- *
- * OLD_IMAGE
- the entire item, as it appeared before it was modified.
- *
- * NEW_AND_OLD_IMAGES
- both the new and the old item images of the item.
- *
- * The type of data from the modified DynamoDB item that was captured in this stream record: - *
- *
- * KEYS_ONLY
- only the key attributes of the modified item.
- *
- * NEW_IMAGE
- the entire item, as it appeared after it was modified.
- *
- * OLD_IMAGE
- the entire item, as it appeared before it was modified.
- *
- * NEW_AND_OLD_IMAGES
- both the new and the old item images of the item.
- *
- * KEYS_ONLY
- only the key attributes of the modified item.
- *
- * NEW_IMAGE
- the entire item, as it appeared after it was modified.
- *
- * OLD_IMAGE
- the entire item, as it appeared before it was modified.
- *
- * NEW_AND_OLD_IMAGES
- both the new and the old item images of the item.
- *
- * The type of data from the modified DynamoDB item that was captured in this stream record: - *
- *
- * KEYS_ONLY
- only the key attributes of the modified item.
- *
- * NEW_IMAGE
- the entire item, as it appeared after it was modified.
- *
- * OLD_IMAGE
- the entire item, as it appeared before it was modified.
- *
- * NEW_AND_OLD_IMAGES
- both the new and the old item images of the item.
- *
- * KEYS_ONLY
- only the key attributes of the modified item.
- *
- * NEW_IMAGE
- the entire item, as it appeared after it was modified.
- *
- * OLD_IMAGE
- the entire item, as it appeared before it was modified.
- *
- * NEW_AND_OLD_IMAGES
- both the new and the old item images of the item.
- *
- * The unit of data of the Kinesis data stream, which is composed of a sequence number, a partition key, and a data - * blob. - *
- * - * @see AWS API - * Documentation - */ -public class Record implements Serializable, Cloneable { - - /** - *- * The unique identifier of the record within its shard. - *
- */ - private String sequenceNumber; - /** - *- * The approximate time that the record was inserted into the stream. - *
- */ - private java.util.Date approximateArrivalTimestamp; - /** - *- * The data blob. The data in the blob is both opaque and immutable to Kinesis Data Streams, which does not inspect, - * interpret, or change the data in the blob in any way. When the data blob (the payload before base64-encoding) is - * added to the partition key size, the total size must not exceed the maximum record size (1 MB). - *
- */ - private java.nio.ByteBuffer data; - /** - *- * Identifies which shard in the stream the data record is assigned to. - *
- */ - private String partitionKey; - /** - *- * The encryption type used on the record. This parameter can be one of the following values: - *
- *
- * NONE
: Do not encrypt the records in the stream.
- *
- * KMS
: Use server-side encryption on the records in the stream using a customer-managed AWS KMS key.
- *
- * The unique identifier of the record within its shard. - *
- * - * @param sequenceNumber - * The unique identifier of the record within its shard. - */ - public void setSequenceNumber(String sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - *- * The unique identifier of the record within its shard. - *
- * - * @return The unique identifier of the record within its shard. - */ - public String getSequenceNumber() { - return this.sequenceNumber; - } - - /** - *- * The unique identifier of the record within its shard. - *
- * - * @param sequenceNumber - * The unique identifier of the record within its shard. - * @return Returns a reference to this object so that method calls can be chained together. - */ - public Record withSequenceNumber(String sequenceNumber) { - setSequenceNumber(sequenceNumber); - return this; - } - - /** - *- * The approximate time that the record was inserted into the stream. - *
- * - * @param approximateArrivalTimestamp - * The approximate time that the record was inserted into the stream. - */ - public void setApproximateArrivalTimestamp(java.util.Date approximateArrivalTimestamp) { - this.approximateArrivalTimestamp = approximateArrivalTimestamp; - } - - /** - *- * The approximate time that the record was inserted into the stream. - *
- * - * @return The approximate time that the record was inserted into the stream. - */ - public java.util.Date getApproximateArrivalTimestamp() { - return this.approximateArrivalTimestamp; - } - - /** - *- * The approximate time that the record was inserted into the stream. - *
- * - * @param approximateArrivalTimestamp - * The approximate time that the record was inserted into the stream. - * @return Returns a reference to this object so that method calls can be chained together. - */ - public Record withApproximateArrivalTimestamp(java.util.Date approximateArrivalTimestamp) { - setApproximateArrivalTimestamp(approximateArrivalTimestamp); - return this; - } - - /** - *- * The data blob. The data in the blob is both opaque and immutable to Kinesis Data Streams, which does not inspect, - * interpret, or change the data in the blob in any way. When the data blob (the payload before base64-encoding) is - * added to the partition key size, the total size must not exceed the maximum record size (1 MB). - *
- *- * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. - * Users of the SDK should not perform Base64 encoding on this field. - *
- *- * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will - * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or - * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future - * major version of the SDK. - *
- * - * @param data - * The data blob. The data in the blob is both opaque and immutable to Kinesis Data Streams, which does not - * inspect, interpret, or change the data in the blob in any way. When the data blob (the payload before - * base64-encoding) is added to the partition key size, the total size must not exceed the maximum record - * size (1 MB). - */ - public void setData(java.nio.ByteBuffer data) { - this.data = data; - } - - /** - *- * The data blob. The data in the blob is both opaque and immutable to Kinesis Data Streams, which does not inspect, - * interpret, or change the data in the blob in any way. When the data blob (the payload before base64-encoding) is - * added to the partition key size, the total size must not exceed the maximum record size (1 MB). - *
- *- * {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend - * using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent - * {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}. - * Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the - * {@code position}. - *
- * - * @return The data blob. The data in the blob is both opaque and immutable to Kinesis Data Streams, which does not - * inspect, interpret, or change the data in the blob in any way. When the data blob (the payload before - * base64-encoding) is added to the partition key size, the total size must not exceed the maximum record - * size (1 MB). - */ - public java.nio.ByteBuffer getData() { - return this.data; - } - - /** - *- * The data blob. The data in the blob is both opaque and immutable to Kinesis Data Streams, which does not inspect, - * interpret, or change the data in the blob in any way. When the data blob (the payload before base64-encoding) is - * added to the partition key size, the total size must not exceed the maximum record size (1 MB). - *
- *- * The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service. - * Users of the SDK should not perform Base64 encoding on this field. - *
- *- * Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will - * be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or - * ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future - * major version of the SDK. - *
- * - * @param data - * The data blob. The data in the blob is both opaque and immutable to Kinesis Data Streams, which does not - * inspect, interpret, or change the data in the blob in any way. When the data blob (the payload before - * base64-encoding) is added to the partition key size, the total size must not exceed the maximum record - * size (1 MB). - * @return Returns a reference to this object so that method calls can be chained together. - */ - public Record withData(java.nio.ByteBuffer data) { - setData(data); - return this; - } - - /** - *- * Identifies which shard in the stream the data record is assigned to. - *
- * - * @param partitionKey - * Identifies which shard in the stream the data record is assigned to. - */ - public void setPartitionKey(String partitionKey) { - this.partitionKey = partitionKey; - } - - /** - *- * Identifies which shard in the stream the data record is assigned to. - *
- * - * @return Identifies which shard in the stream the data record is assigned to. - */ - public String getPartitionKey() { - return this.partitionKey; - } - - /** - *- * Identifies which shard in the stream the data record is assigned to. - *
- * - * @param partitionKey - * Identifies which shard in the stream the data record is assigned to. - * @return Returns a reference to this object so that method calls can be chained together. - */ - public Record withPartitionKey(String partitionKey) { - setPartitionKey(partitionKey); - return this; - } - - /** - *- * The encryption type used on the record. This parameter can be one of the following values: - *
- *
- * NONE
: Do not encrypt the records in the stream.
- *
- * KMS
: Use server-side encryption on the records in the stream using a customer-managed AWS KMS key.
- *
- * NONE
: Do not encrypt the records in the stream.
- *
- * KMS
: Use server-side encryption on the records in the stream using a customer-managed AWS KMS
- * key.
- *
- * The encryption type used on the record. This parameter can be one of the following values: - *
- *
- * NONE
: Do not encrypt the records in the stream.
- *
- * KMS
: Use server-side encryption on the records in the stream using a customer-managed AWS KMS key.
- *
- * NONE
: Do not encrypt the records in the stream.
- *
- * KMS
: Use server-side encryption on the records in the stream using a customer-managed AWS
- * KMS key.
- *
- * The encryption type used on the record. This parameter can be one of the following values: - *
- *
- * NONE
: Do not encrypt the records in the stream.
- *
- * KMS
: Use server-side encryption on the records in the stream using a customer-managed AWS KMS key.
- *
- * NONE
: Do not encrypt the records in the stream.
- *
- * KMS
: Use server-side encryption on the records in the stream using a customer-managed AWS KMS
- * key.
- *
- * The encryption type used on the record. This parameter can be one of the following values: - *
- *
- * NONE
: Do not encrypt the records in the stream.
- *
- * KMS
: Use server-side encryption on the records in the stream using a customer-managed AWS KMS key.
- *
- * NONE
: Do not encrypt the records in the stream.
- *
- * KMS
: Use server-side encryption on the records in the stream using a customer-managed AWS KMS
- * key.
- *
* import com.amazonaws.services.lambda.runtime.Context;
- * import com.amazonaws.services.lambda.runtime.events.S3ObjectLambdaEvent;
+ * import com.amazonaws.services.lambda.runtime.events.s3.S3ObjectLambdaEvent;
* import org.apache.http.client.fluent.Request;
* import software.amazon.awssdk.services.s3.S3Client;
* import software.amazon.awssdk.services.s3.model.WriteGetObjectResponseRequest;
@@ -53,6 +68,7 @@
@AllArgsConstructor
public class S3ObjectLambdaEvent {
+ @JsonProperty("xAmzRequestId")
private String xAmzRequestId;
private GetObjectContext getObjectContext;
private Configuration configuration;
diff --git a/aws-lambda-java-events/src/main/java/lombok.config b/aws-lambda-java-events/src/main/java/lombok.config
index 531bad71..8f7e8aa1 100644
--- a/aws-lambda-java-events/src/main/java/lombok.config
+++ b/aws-lambda-java-events/src/main/java/lombok.config
@@ -1 +1 @@
-lombok.getter.noIsPrefix = true
+lombok.addLombokGeneratedAnnotation = true
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2CustomAuthorizerEventTest.java b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2CustomAuthorizerEventTest.java
deleted file mode 100644
index 8f1662cd..00000000
--- a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/APIGatewayV2CustomAuthorizerEventTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.amazonaws.services.lambda.runtime.events;
-
-import org.junit.jupiter.api.Test;
-
-import java.time.Instant;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-
-public class APIGatewayV2CustomAuthorizerEventTest {
-
- private static final long TIME_EPOCH = 1601306426515L;
- private static final String TIME = "28/Sep/2020:15:14:43 +0000";
-
- @Test
- public void testEpochLongAsAnInstant() {
- APIGatewayV2CustomAuthorizerEvent customAuthorizerEvent = APIGatewayV2CustomAuthorizerEvent.builder()
- .withRequestContext(APIGatewayV2CustomAuthorizerEvent.RequestContext.builder()
- .withTimeEpoch(TIME_EPOCH)
- .build())
- .build();
-
- assertEquals(Instant.ofEpochMilli(1601306426515L), customAuthorizerEvent.getRequestContext().getTimeEpoch());
- }
-
- @Test
- public void testTimeStringAsDateTime() {
- APIGatewayV2CustomAuthorizerEvent customAuthorizerEvent = APIGatewayV2CustomAuthorizerEvent.builder()
- .withRequestContext(APIGatewayV2CustomAuthorizerEvent.RequestContext.builder()
- .withTime(TIME)
- .build())
- .build();
-
- assertNotNull(customAuthorizerEvent.getRequestContext().getTime());
- }
-}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/EventUtils.java b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/EventUtils.java
new file mode 100644
index 00000000..1d02e075
--- /dev/null
+++ b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/EventUtils.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2022 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.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+public final class EventUtils {
+ public static String readEvent(String filename) throws IOException {
+ Path filePath = Paths.get("src", "test", "resources", "event_models", filename);
+ byte[] bytes = Files.readAllBytes(filePath);
+ return bytesToString(bytes);
+ }
+ public static String bytesToString(byte[] bytes) {
+ return new String(bytes, StandardCharsets.UTF_8);
+ }
+
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/HttpUtils.java b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/HttpUtils.java
index d6ff1aa4..fd60f9f4 100644
--- a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/HttpUtils.java
+++ b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/HttpUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2022 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
@@ -10,6 +10,7 @@
* 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.io.UnsupportedEncodingException;
diff --git a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/IamPolicyResponseTest.java b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/IamPolicyResponseTest.java
deleted file mode 100644
index 4dbbb108..00000000
--- a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/IamPolicyResponseTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package com.amazonaws.services.lambda.runtime.events;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.jupiter.api.Test;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.HashMap;
-import java.util.Map;
-
-import static com.amazonaws.services.lambda.runtime.events.IamPolicyResponse.ALLOW;
-import static com.amazonaws.services.lambda.runtime.events.IamPolicyResponse.EXECUTE_API_INVOKE;
-import static com.amazonaws.services.lambda.runtime.events.IamPolicyResponse.VERSION_2012_10_17;
-import static com.amazonaws.services.lambda.runtime.events.IamPolicyResponse.allowStatement;
-import static com.amazonaws.services.lambda.runtime.events.IamPolicyResponse.denyStatement;
-import static java.util.Collections.singletonList;
-import static java.util.Collections.singletonMap;
-import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson;
-
-public class IamPolicyResponseTest {
-
- private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
-
- @Test
- public void testAllowStatement() throws JsonProcessingException {
- IamPolicyResponse iamPolicyResponse = IamPolicyResponse.builder()
- .withPrincipalId("me")
- .withPolicyDocument(IamPolicyResponse.PolicyDocument.builder()
- .withVersion(VERSION_2012_10_17)
- .withStatement(singletonList(allowStatement("arn:aws:execute-api:eu-west-1:123456789012:1234abc/$deafult/*/*")))
- .build())
- .build();
-
- String json = OBJECT_MAPPER.writeValueAsString(iamPolicyResponse);
-
- assertThatJson(json).isEqualTo(readResource("iamPolicyResponses/allow.json"));
- }
-
- @Test
- public void testDenyStatement() throws JsonProcessingException {
- IamPolicyResponse iamPolicyResponse = IamPolicyResponse.builder()
- .withPrincipalId("me")
- .withPolicyDocument(IamPolicyResponse.PolicyDocument.builder()
- .withVersion(VERSION_2012_10_17)
- .withStatement(singletonList(denyStatement("arn:aws:execute-api:eu-west-1:123456789012:1234abc/$deafult/*/*")))
- .build())
- .build();
-
- String json = OBJECT_MAPPER.writeValueAsString(iamPolicyResponse);
-
- assertThatJson(json).isEqualTo(readResource("iamPolicyResponses/deny.json"));
- }
-
- @Test
- public void testStatementWithCondition() throws JsonProcessingException {
- Map> conditions = new HashMap<>();
- conditions.put("DateGreaterThan", singletonMap("aws:TokenIssueTime", "2020-01-01T00:00:01Z"));
-
- IamPolicyResponse iamPolicyResponse = IamPolicyResponse.builder()
- .withPrincipalId("me")
- .withPolicyDocument(IamPolicyResponse.PolicyDocument.builder()
- .withVersion(VERSION_2012_10_17)
- .withStatement(singletonList(IamPolicyResponse.Statement.builder()
- .withAction(EXECUTE_API_INVOKE)
- .withEffect(ALLOW)
- .withResource(singletonList("arn:aws:execute-api:eu-west-1:123456789012:1234abc/$deafult/*/*"))
- .withCondition(conditions)
- .build()))
- .build())
- .build();
-
- String json = OBJECT_MAPPER.writeValueAsString(iamPolicyResponse);
-
- assertThatJson(json).isEqualTo(readResource("iamPolicyResponses/allow-with-condition.json"));
- }
-
- private String readResource(String name) {
- Path filePath = Paths.get("src", "test", "resources", name);
- byte[] bytes = new byte[0];
- try {
- bytes = Files.readAllBytes(filePath);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new String(bytes, StandardCharsets.UTF_8);
- }
-}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/IamPolicyResponseV1Test.java b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/IamPolicyResponseV1Test.java
deleted file mode 100644
index 9b966179..00000000
--- a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/IamPolicyResponseV1Test.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package com.amazonaws.services.lambda.runtime.events;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.jupiter.api.Test;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.HashMap;
-import java.util.Map;
-
-import static com.amazonaws.services.lambda.runtime.events.IamPolicyResponseV1.ALLOW;
-import static com.amazonaws.services.lambda.runtime.events.IamPolicyResponseV1.EXECUTE_API_INVOKE;
-import static com.amazonaws.services.lambda.runtime.events.IamPolicyResponseV1.VERSION_2012_10_17;
-import static com.amazonaws.services.lambda.runtime.events.IamPolicyResponseV1.allowStatement;
-import static com.amazonaws.services.lambda.runtime.events.IamPolicyResponseV1.denyStatement;
-import static java.util.Collections.singletonList;
-import static java.util.Collections.singletonMap;
-import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson;
-
-public class IamPolicyResponseV1Test {
-
- private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
-
- @Test
- public void testAllowStatement() throws JsonProcessingException {
- IamPolicyResponseV1 iamPolicyResponse = IamPolicyResponseV1.builder()
- .withPrincipalId("me")
- .withPolicyDocument(IamPolicyResponseV1.PolicyDocument.builder()
- .withVersion(VERSION_2012_10_17)
- .withStatement(singletonList(allowStatement("arn:aws:execute-api:eu-west-1:123456789012:1234abc/$deafult/*/*")))
- .build())
- .withUsageIdentifierKey("123ABC")
- .build();
-
- String json = OBJECT_MAPPER.writeValueAsString(iamPolicyResponse);
-
- assertThatJson(json).isEqualTo(readResource("iamPolicyV1Responses/allow.json"));
- }
-
- @Test
- public void testDenyStatement() throws JsonProcessingException {
- IamPolicyResponseV1 iamPolicyResponse = IamPolicyResponseV1.builder()
- .withPrincipalId("me")
- .withPolicyDocument(IamPolicyResponseV1.PolicyDocument.builder()
- .withVersion(VERSION_2012_10_17)
- .withStatement(singletonList(denyStatement("arn:aws:execute-api:eu-west-1:123456789012:1234abc/$deafult/*/*")))
- .build())
- .withUsageIdentifierKey("123ABC")
- .build();
-
- String json = OBJECT_MAPPER.writeValueAsString(iamPolicyResponse);
-
- assertThatJson(json).isEqualTo(readResource("iamPolicyV1Responses/deny.json"));
- }
-
- @Test
- public void testStatementWithCondition() throws JsonProcessingException {
- Map> conditions = new HashMap<>();
- conditions.put("DateGreaterThan", singletonMap("aws:TokenIssueTime", "2020-01-01T00:00:01Z"));
-
- IamPolicyResponseV1 iamPolicyResponse = IamPolicyResponseV1.builder()
- .withPrincipalId("me")
- .withPolicyDocument(IamPolicyResponseV1.PolicyDocument.builder()
- .withVersion(VERSION_2012_10_17)
- .withStatement(singletonList(IamPolicyResponseV1.Statement.builder()
- .withAction(EXECUTE_API_INVOKE)
- .withEffect(ALLOW)
- .withResource(singletonList("arn:aws:execute-api:eu-west-1:123456789012:1234abc/$deafult/*/*"))
- .withCondition(conditions)
- .build()))
- .build())
- .withUsageIdentifierKey("123ABC")
- .build();
-
- String json = OBJECT_MAPPER.writeValueAsString(iamPolicyResponse);
-
- assertThatJson(json).isEqualTo(readResource("iamPolicyV1Responses/allow-with-condition.json"));
- }
-
- private String readResource(String name) {
- Path filePath = Paths.get("src", "test", "resources", name);
- byte[] bytes = new byte[0];
- try {
- bytes = Files.readAllBytes(filePath);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new String(bytes, StandardCharsets.UTF_8);
- }
-}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/LambdaEventSerializersTest.java b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/LambdaEventSerializersTest.java
new file mode 100644
index 00000000..5119e8d4
--- /dev/null
+++ b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/LambdaEventSerializersTest.java
@@ -0,0 +1,531 @@
+/*
+ * Copyright 2022 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.apigateway.*;
+import com.amazonaws.services.lambda.runtime.events.cognito.*;
+import com.amazonaws.services.lambda.runtime.events.dynamodb.DynamodbEvent;
+import com.amazonaws.services.lambda.runtime.events.dynamodb.DynamodbTimeWindowEvent;
+import com.amazonaws.services.lambda.runtime.events.kinesis.*;
+import com.amazonaws.services.lambda.runtime.events.s3.S3BatchEvent;
+import com.amazonaws.services.lambda.runtime.events.s3.S3BatchResponse;
+import com.amazonaws.services.lambda.runtime.events.s3.S3Event;
+import com.amazonaws.services.lambda.runtime.events.s3.S3ObjectLambdaEvent;
+import com.amazonaws.services.lambda.serialization.JacksonPojoSerializer;
+import com.amazonaws.services.lambda.serialization.CustomPojoSerializer;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.ServiceLoader;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class LambdaEventSerializersTest {
+
+ private static final ObjectMapper OBJECT_MAPPER = JacksonPojoSerializer.getInstance().getMapper();
+ private static final CustomPojoSerializer CUSTOM_POJO_SERIALIZER = loadSerializer();
+
+ static public CustomPojoSerializer loadSerializer() {
+ ServiceLoader loader = ServiceLoader.load(CustomPojoSerializer.class);
+
+ return loader.iterator().next();
+ }
+
+ @Test
+ public void testActiveMQEvent() throws IOException {
+ String expected = EventUtils.readEvent("active_mq_event.json");
+ String actual = deserializeSerializeJsonToString(expected, ActiveMQEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testAPIGatewayCustomAuthorizerEvent() throws IOException {
+ String expected = EventUtils.readEvent("api_gateway_custom_authorizer_event.json");
+ String actual = deserializeSerializeJsonToString(expected, APIGatewayCustomAuthorizerEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testAPIGatewayProxyRequestEvent() throws IOException {
+ String expected = EventUtils.readEvent("api_gateway_proxy_request_event.json");
+ String actual = deserializeSerializeJsonToString(expected, APIGatewayProxyRequestEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testAPIGatewayProxyResponseEvent() throws IOException {
+ String expected = EventUtils.readEvent("api_gateway_proxy_response_event.json");
+ String actual = deserializeSerializeJsonToString(expected, APIGatewayProxyResponseEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testAPIGatewayV2CustomAuthorizerEvent() throws IOException {
+ String expected = EventUtils.readEvent("api_gateway_v2_custom_authorizer_event.json");
+ String actual = deserializeSerializeJsonToString(expected, APIGatewayV2CustomAuthorizerEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testAPIGatewayV2HTTPEvent() throws IOException {
+ String expected = EventUtils.readEvent("api_gateway_v2_http_event.json");
+ String actual = deserializeSerializeJsonToString(expected, APIGatewayV2HTTPEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testAPIGatewayV2HTTPResponse() throws IOException {
+ String expected = EventUtils.readEvent("api_gateway_v2_http_response.json");
+ String actual = deserializeSerializeJsonToString(expected, APIGatewayV2HTTPResponse.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testAPIGatewayV2WebSocketEvent() throws IOException {
+ String expected = EventUtils.readEvent("api_gateway_v2_web_socket_event.json");
+ String actual = deserializeSerializeJsonToString(expected, APIGatewayV2WebSocketEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testAPIGatewayV2WebSocketResponse() throws IOException {
+ String expected = EventUtils.readEvent("api_gateway_v2_web_socket_response.json");
+ String actual = deserializeSerializeJsonToString(expected, APIGatewayV2WebSocketResponse.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testApplicationLoadBalancerRequestEvent() throws IOException {
+ String expected = EventUtils.readEvent("application_load_balancer_request_event.json");
+ String actual = deserializeSerializeJsonToString(expected, ApplicationLoadBalancerRequestEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testApplicationLoadBalancerResponseEvent() throws IOException {
+ String expected = EventUtils.readEvent("application_load_balancer_response_event.json");
+ String actual = deserializeSerializeJsonToString(expected, ApplicationLoadBalancerResponseEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testAppSyncLambdaAuthorizerEvent() throws IOException {
+ String expected = EventUtils.readEvent("app_sync_lambda_authorizer_event.json");
+ String actual = deserializeSerializeJsonToString(expected, AppSyncLambdaAuthorizerEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testAppSyncLambdaAuthorizerResponse() throws IOException {
+ String expected = EventUtils.readEvent("app_sync_lambda_authorizer_response.json");
+ String actual = deserializeSerializeJsonToString(expected, AppSyncLambdaAuthorizerResponse.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCloudFormationCustomResourceEvent() throws IOException {
+ String expected = EventUtils.readEvent("cloud_formation_custom_resource_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CloudFormationCustomResourceEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCloudFrontEvent() throws IOException {
+ String expected = EventUtils.readEvent("cloud_front_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CloudFrontEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCloudWatchLogsEvent() throws IOException {
+ String expected = EventUtils.readEvent("cloud_watch_logs_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CloudWatchLogsEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCodeCommitEvent() throws IOException {
+ String expected = EventUtils.readEvent("code_commit_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CodeCommitEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCognitoEvent() throws IOException {
+ String expected = EventUtils.readEvent("cognito_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CognitoEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCognitoUserPoolCreateAuthChallengeEvent() throws IOException {
+ String expected = EventUtils.readEvent("cognito_user_pool_create_auth_challenge_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CognitoUserPoolCreateAuthChallengeEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCognitoUserPoolCustomMessageEvent() throws IOException {
+ String expected = EventUtils.readEvent("cognito_user_pool_custom_message_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CognitoUserPoolCustomMessageEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCognitoUserPoolDefineAuthChallengeEvent() throws IOException {
+ String expected = EventUtils.readEvent("cognito_user_pool_define_auth_challenge_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CognitoUserPoolDefineAuthChallengeEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCognitoUserPoolMigrateUserEvent() throws IOException {
+ String expected = EventUtils.readEvent("cognito_user_pool_migrate_user_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CognitoUserPoolMigrateUserEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCognitoUserPoolPostAuthenticationEvent() throws IOException {
+ String expected = EventUtils.readEvent("cognito_user_pool_post_authentication_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CognitoUserPoolPostAuthenticationEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCognitoUserPoolPostConfirmationEvent() throws IOException {
+ String expected = EventUtils.readEvent("cognito_user_pool_post_confirmation_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CognitoUserPoolPostConfirmationEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCognitoUserPoolPreAuthenticationEvent() throws IOException {
+ String expected = EventUtils.readEvent("cognito_user_pool_pre_authentication_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CognitoUserPoolPreAuthenticationEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCognitoUserPoolPreSignUpEvent() throws IOException {
+ String expected = EventUtils.readEvent("cognito_user_pool_pre_sign_up_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CognitoUserPoolPreSignUpEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCognitoUserPoolPreTokenGenerationEvent() throws IOException {
+ String expected = EventUtils.readEvent("cognito_user_pool_pre_token_generation_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CognitoUserPoolPreTokenGenerationEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testCognitoUserPoolVerifyAuthChallengeResponseEvent() throws IOException {
+ String expected = EventUtils.readEvent("cognito_user_pool_verify_auth_challenge_response_event.json");
+ String actual = deserializeSerializeJsonToString(expected, CognitoUserPoolVerifyAuthChallengeResponseEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testConfigEvent() throws IOException {
+ String expected = EventUtils.readEvent("config_event.json");
+ String actual = deserializeSerializeJsonToString(expected, ConfigEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testConnectEvent() throws IOException {
+ String expected = EventUtils.readEvent("connect_event.json");
+ String actual = deserializeSerializeJsonToString(expected, ConnectEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testDynamodbEvent() throws IOException {
+ String expected = EventUtils.readEvent("dynamodb_event.json");
+ String actual = deserializeSerializeJsonToString(expected, DynamodbEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testDynamodbTimeWindowEvent() throws IOException {
+ String expected = EventUtils.readEvent("dynamodb_time_window_event.json");
+ String actual = deserializeSerializeJsonToString(expected, DynamodbTimeWindowEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testIamPolicyResponse() throws IOException {
+ String expected = EventUtils.readEvent("iam_policy_response.json");
+ String actual = deserializeSerializeJsonToString(expected, IamPolicyResponse.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testIamPolicyResponseV1() throws IOException {
+ String expected = EventUtils.readEvent("iam_policy_response_v1.json");
+ String actual = deserializeSerializeJsonToString(expected, IamPolicyResponseV1.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testIoTButtonEvent() throws IOException {
+ String expected = EventUtils.readEvent("iot_button_event.json");
+ String actual = deserializeSerializeJsonToString(expected, IoTButtonEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testKafkaEvent() throws IOException {
+ String expected = EventUtils.readEvent("kafka_event.json");
+ String actual = deserializeSerializeJsonToString(expected, KafkaEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testKinesisAnalyticsFirehoseInputPreprocessingEvent() throws IOException {
+ String expected = EventUtils.readEvent("kinesis_analytics_firehose_input_preprocessing_event.json");
+ String actual = deserializeSerializeJsonToString(expected, KinesisAnalyticsFirehoseInputPreprocessingEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testKinesisAnalyticsInputPreprocessingResponse() throws IOException {
+ String expected = EventUtils.readEvent("kinesis_analytics_input_preprocessing_response_event.json");
+ String actual = deserializeSerializeJsonToString(expected, KinesisAnalyticsInputPreprocessingResponse.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testKinesisAnalyticsOutputDeliveryEvent() throws IOException {
+ String expected = EventUtils.readEvent("kinesis_analytics_output_delivery_event.json");
+ String actual = deserializeSerializeJsonToString(expected, KinesisAnalyticsOutputDeliveryEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testKinesisAnalyticsOutputDeliveryResponse() throws IOException {
+ String expected = EventUtils.readEvent("kinesis_analytics_output_delivery_response_event.json");
+ String actual = deserializeSerializeJsonToString(expected, KinesisAnalyticsOutputDeliveryResponse.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testKinesisAnalyticsStreamsInputPreprocessingEvent() throws IOException {
+ String expected = EventUtils.readEvent("kinesis_analytics_streams_input_preprocessing_event.json");
+ String actual = deserializeSerializeJsonToString(expected, KinesisAnalyticsStreamsInputPreprocessingEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testKinesisEvent() throws IOException {
+ String expected = EventUtils.readEvent("kinesis_event.json");
+ String actual = deserializeSerializeJsonToString(expected, KinesisEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testKinesisFirehoseEvent() throws IOException {
+ String expected = EventUtils.readEvent("kinesis_firehose_event.json");
+ String actual = deserializeSerializeJsonToString(expected, KinesisFirehoseEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testKinesisTimeWindowEvent() throws IOException {
+ String expected = EventUtils.readEvent("kinesis_time_window_event.json");
+ String actual = deserializeSerializeJsonToString(expected, KinesisTimeWindowEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testLambdaDestinationEvent() throws IOException {
+ String expected = EventUtils.readEvent("lambda_destination_event.json");
+ String actual = deserializeSerializeJsonToString(expected, LambdaDestinationEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testLexEvent() throws IOException {
+ String expected = EventUtils.readEvent("lex_event.json");
+ String actual = deserializeSerializeJsonToString(expected, LexEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testRabbitMQ() throws IOException {
+ String expected = EventUtils.readEvent("rabbit_mq.json");
+ String actual = deserializeSerializeJsonToString(expected, RabbitMQEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testS3BatchEvent() throws IOException {
+ String expected = EventUtils.readEvent("s3_batch_event.json");
+ String actual = deserializeSerializeJsonToString(expected, S3BatchEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testS3BatchResponse() throws IOException {
+ String expected = EventUtils.readEvent("s3_batch_response.json");
+ String actual = deserializeSerializeJsonToString(expected, S3BatchResponse.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testS3Event() throws IOException {
+ String expected = EventUtils.readEvent("s3_event.json");
+ String actual = deserializeSerializeJsonToString(expected, S3Event.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testS3ObjectLambdaEvent() throws IOException {
+ String expected = EventUtils.readEvent("s3_object_lambda_event.json");
+ String actual = deserializeSerializeJsonToString(expected, S3ObjectLambdaEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testScheduledEvent() throws IOException {
+ String expected = EventUtils.readEvent("scheduled_event.json");
+ String actual = deserializeSerializeJsonToString(expected, ScheduledEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testSecretsManagerRotationEvent() throws IOException {
+ String expected = EventUtils.readEvent("secrets_manager_rotation_event.json");
+ String actual = deserializeSerializeJsonToString(expected, SecretsManagerRotationEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testSimpleIAMPolicyResponse() throws IOException {
+ String expected = EventUtils.readEvent("simple_iam_policy_response.json");
+ String actual = deserializeSerializeJsonToString(expected, SimpleIAMPolicyResponse.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testSNSEvent() throws IOException {
+ String expected = EventUtils.readEvent("sns_event.json");
+ String actual = deserializeSerializeJsonToString(expected, SNSEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testSQSBatchResponse() throws IOException {
+ String expected = EventUtils.readEvent("sqs_batch_response.json");
+ String actual = deserializeSerializeJsonToString(expected, SQSBatchResponse.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testSQSEvent() throws IOException {
+ String expected = EventUtils.readEvent("sqs_event.json");
+ String actual = deserializeSerializeJsonToString(expected, SQSEvent.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testStreamsEventResponse() throws IOException {
+ String expected = EventUtils.readEvent("streams_event_response.json");
+ String actual = deserializeSerializeJsonToString(expected, StreamsEventResponse.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ @Test
+ public void testTimeWindowEventResponse() throws IOException {
+ String expected = EventUtils.readEvent("time_window_event_response.json");
+ String actual = deserializeSerializeJsonToString(expected, TimeWindowEventResponse.class);
+
+ assertJsonEqual(expected, actual);
+ }
+
+ private String deserializeSerializeJsonToString(String expected, Class modelClass) throws IOException {
+ T event = CUSTOM_POJO_SERIALIZER.fromJson(expected, modelClass);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ CUSTOM_POJO_SERIALIZER.toJson(event, baos, modelClass);
+ return EventUtils.bytesToString(baos.toByteArray());
+ }
+
+ private void assertJsonEqual(String expected, String actual) throws IOException {
+ Assertions.assertEquals(OBJECT_MAPPER.readTree(expected), OBJECT_MAPPER.readTree(actual));
+ }
+
+}
diff --git a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/models/s3/S3EventNotificationTest.java b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/models/s3/S3EventNotificationTest.java
index 8a3cb072..7d47e7f8 100644
--- a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/models/s3/S3EventNotificationTest.java
+++ b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/models/s3/S3EventNotificationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2022 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
@@ -10,9 +10,12 @@
* 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.models.s3;
import com.amazonaws.services.lambda.runtime.events.HttpUtils;
+import com.amazonaws.services.lambda.runtime.events.s3.S3Event;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -27,9 +30,14 @@ public class S3EventNotificationTest {
public void testGetUrlDecodedKey() {
for (String testKey : KEYS_REQUIRING_URL_ENCODE) {
String urlEncoded = HttpUtils.urlEncode(testKey, false);
- S3EventNotification.S3ObjectEntity entity = new S3EventNotification.S3ObjectEntity(
- urlEncoded, 1L, "E-Tag", "versionId");
+ S3Event.S3ObjectEntity entity = S3Event.S3ObjectEntity.builder()
+ .withKey(urlEncoded)
+ .withSize(1L)
+ .withETag("E-Tag")
+ .withVersionId("versionId")
+ .withSequencer("Happy Sequencer")
+ .build();
Assertions.assertEquals(testKey, entity.getUrlDecodedKey());
}
}
-}
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/active_mq_event.json b/aws-lambda-java-events/src/test/resources/event_models/active_mq_event.json
new file mode 100644
index 00000000..31f1ebe6
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/active_mq_event.json
@@ -0,0 +1,24 @@
+{
+ "eventSource": "aws:mq",
+ "eventSourceArn": "arn:aws:mq:us-west-2:533019413397:broker:shask-test:b-0f5b7522-2b41-4f85-a615-735a4e6d96b5",
+ "messages": [
+ {
+ "messageID": "ID:b-0f5b7522-2b41-4f85-a615-735a4e6d96b5-2.mq.us-west-2.amazonaws.com-34859-1598944546501-4:12:1:1:3",
+ "messageType": "jms/text-message",
+ "timestamp": 1599863938941,
+ "deliveryMode": 1,
+ "correlationID": "",
+ "replyTo": "null",
+ "destination": {
+ "physicalName": "testQueue"
+ },
+ "redelivered": false,
+ "type": "",
+ "expiration": 0,
+ "priority": 0,
+ "data": "RW50ZXIgc29tZSB0ZXh0IGhlcmUgZm9yIHRoZSBtZXNzYWdlIGJvZHkuLi4=",
+ "brokerInTime": 1599863938943,
+ "brokerOutTime": 1599863938944
+ }
+ ]
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/api_gateway_custom_authorizer_event.json b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_custom_authorizer_event.json
new file mode 100644
index 00000000..eb73956e
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_custom_authorizer_event.json
@@ -0,0 +1,41 @@
+{
+ "version": "1.0",
+ "type": "REQUEST",
+ "methodArn": "arn:aws:execute-api:us-east-1:123456789012:abcdef123/test/GET/request",
+ "identitySource": "user1,123",
+ "authorizationToken": "user1,123",
+ "resource": "/request",
+ "path": "/request",
+ "httpMethod": "GET",
+ "headers": {
+ "X-AMZ-Date": "20170718T062915Z",
+ "Accept": "*/*",
+ "HeaderAuth1": "headerValue1",
+ "CloudFront-Viewer-Country": "US",
+ "CloudFront-Forwarded-Proto": "https",
+ "CloudFront-Is-Tablet-Viewer": "false",
+ "CloudFront-Is-Mobile-Viewer": "false",
+ "User-Agent": "..."
+ },
+ "queryStringParameters": {
+ "QueryString1": "queryValue1"
+ },
+ "pathParameters": {},
+ "stageVariables": {
+ "StageVar1": "stageValue1"
+ },
+ "requestContext": {
+ "path": "/request",
+ "accountId": "123456789012",
+ "resourceId": "05c7jb",
+ "stage": "test",
+ "requestId": "...",
+ "identity": {
+ "apiKey": "...",
+ "sourceIp": "..."
+ },
+ "resourcePath": "/request",
+ "httpMethod": "GET",
+ "apiId": "abcdef123"
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-serialization/src/test/resources/event_models/api_gateway_proxy_request_event.json b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_proxy_request_event.json
similarity index 99%
rename from aws-lambda-java-serialization/src/test/resources/event_models/api_gateway_proxy_request_event.json
rename to aws-lambda-java-events/src/test/resources/event_models/api_gateway_proxy_request_event.json
index 66c5d953..d9a26151 100644
--- a/aws-lambda-java-serialization/src/test/resources/event_models/api_gateway_proxy_request_event.json
+++ b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_proxy_request_event.json
@@ -1,5 +1,4 @@
{
- "version": "1.0",
"path": "/test/hello",
"headers": {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
@@ -57,4 +56,4 @@
"stageVariables": {
"stageVarName": "stageVarValue"
}
-}
\ No newline at end of file
+}
diff --git a/aws-lambda-java-serialization/src/test/resources/event_models/api_gateway_proxy_response_event.json b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_proxy_response_event.json
similarity index 99%
rename from aws-lambda-java-serialization/src/test/resources/event_models/api_gateway_proxy_response_event.json
rename to aws-lambda-java-events/src/test/resources/event_models/api_gateway_proxy_response_event.json
index 1b18bcfd..fdc679dd 100644
--- a/aws-lambda-java-serialization/src/test/resources/event_models/api_gateway_proxy_response_event.json
+++ b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_proxy_response_event.json
@@ -20,4 +20,4 @@
"X-Forwarded-Proto": "https"
},
"body": "Hello World"
-}
\ No newline at end of file
+}
diff --git a/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_custom_authorizer_event.json b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_custom_authorizer_event.json
new file mode 100644
index 00000000..06dc6b2e
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_custom_authorizer_event.json
@@ -0,0 +1,50 @@
+{
+ "version": "2.0",
+ "type": "REQUEST",
+ "routeArn": "arn:aws:execute-api:us-east-1:123456789012:abcdef123/test/GET/request",
+ "identitySource": ["user1", "123"],
+ "routeKey": "$default",
+ "rawPath": "/my/path",
+ "rawQueryString": "parameter1=value1¶meter1=value2¶meter2=value",
+ "cookies": ["cookie1", "cookie2"],
+ "headers": {
+ "Header1": "value1",
+ "Header2": "value2"
+ },
+ "queryStringParameters": {
+ "parameter1": "value1,value2",
+ "parameter2": "value"
+ },
+ "requestContext": {
+ "accountId": "123456789012",
+ "apiId": "api-id",
+ "authentication": {
+ "clientCert": {
+ "clientCertPem": "CERT_CONTENT",
+ "subjectDN": "www.example.com",
+ "issuerDN": "Example issuer",
+ "serialNumber": "a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1",
+ "validity": {
+ "notBefore": "May 28 12:30:02 2019 GMT",
+ "notAfter": "Aug 5 09:36:04 2021 GMT"
+ }
+ }
+ },
+ "domainName": "id.execute-api.us-east-1.amazonaws.com",
+ "domainPrefix": "id",
+ "http": {
+ "method": "POST",
+ "path": "/my/path",
+ "protocol": "HTTP/1.1",
+ "sourceIp": "IP",
+ "userAgent": "agent"
+ },
+ "requestId": "id",
+ "routeKey": "$default",
+ "stage": "$default",
+ "time": "12/Mar/2020:19:03:58 +0000",
+ "timeEpoch": 1583348638390
+ },
+ "pathParameters": { "parameter1": "value1" },
+ "stageVariables": { "stageVariable1": "value1", "stageVariable2": "value2" }
+}
diff --git a/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_http_event.json b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_http_event.json
new file mode 100644
index 00000000..88f4e5b4
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_http_event.json
@@ -0,0 +1,69 @@
+{
+ "version": "2.0",
+ "routeKey": "$default",
+ "rawPath": "/my/path",
+ "rawQueryString": "parameter1=value1¶meter1=value2¶meter2=value",
+ "cookies": [
+ "cookie1",
+ "cookie2"
+ ],
+ "headers": {
+ "Header1": "value1",
+ "Header2": "value1,value2"
+ },
+ "queryStringParameters": {
+ "parameter1": "value1,value2",
+ "parameter2": "value"
+ },
+ "requestContext": {
+ "accountId": "123456789012",
+ "apiId": "api-id",
+ "authentication": {
+ "clientCert": {
+ "clientCertPem": "CERT_CONTENT",
+ "subjectDN": "www.example.com",
+ "issuerDN": "Example issuer",
+ "serialNumber": "a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1",
+ "validity": {
+ "notBefore": "May 28 12:30:02 2019 GMT",
+ "notAfter": "Aug 5 09:36:04 2021 GMT"
+ }
+ }
+ },
+ "authorizer": {
+ "jwt": {
+ "claims": {
+ "claim1": "value1",
+ "claim2": "value2"
+ },
+ "scopes": [
+ "scope1",
+ "scope2"
+ ]
+ }
+ },
+ "domainName": "id.execute-api.us-east-1.amazonaws.com",
+ "domainPrefix": "id",
+ "http": {
+ "method": "POST",
+ "path": "/my/path",
+ "protocol": "HTTP/1.1",
+ "sourceIp": "IP",
+ "userAgent": "agent"
+ },
+ "requestId": "id",
+ "routeKey": "$default",
+ "stage": "$default",
+ "time": "12/Mar/2020:19:03:58 +0000",
+ "timeEpoch": 1583348638390
+ },
+ "body": "Hello from Lambda!!",
+ "pathParameters": {
+ "parameter1": "value1"
+ },
+ "isBase64Encoded": false,
+ "stageVariables": {
+ "stageVariable1": "value1",
+ "stageVariable2": "value2"
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_http_response.json b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_http_response.json
new file mode 100644
index 00000000..365d9ca5
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_http_response.json
@@ -0,0 +1,16 @@
+{
+ "body": "",
+ "statusCode": 200,
+ "headers": {
+ "Cache-Control": "max-age=0",
+ "Host": "1234567890.execute-api.us-east-1.amazonaws.com",
+ "Upgrade-Insecure-Requests": "1",
+ "User-Agent": "Custom User Agent String",
+ "Via": "1.1 08f323deadbeefa7af34d5feb414ce27.cloudfront.net (CloudFront)",
+ "X-Amz-Cf-Id": "cDehVQoZnx43VYQb9j2-nvCh-9z396Uhbp027Y2JvkCPNLmGJHqlaA==",
+ "X-Forwarded-For": "127.0.0.1, 127.0.0.2",
+ "X-Forwarded-Port": "443",
+ "X-Forwarded-Proto": "https"
+ },
+ "isBase64Encoded": false
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_web_socket_event.json b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_web_socket_event.json
new file mode 100644
index 00000000..6650f38d
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_web_socket_event.json
@@ -0,0 +1,108 @@
+{
+ "resource": "/{proxy+}",
+ "path": "/hello/world",
+ "httpMethod": "POST",
+ "headers": {
+ "Accept": "*/*",
+ "Accept-Encoding": "gzip, deflate",
+ "cache-control": "no-cache",
+ "CloudFront-Forwarded-Proto": "https",
+ "CloudFront-Is-Desktop-Viewer": "true",
+ "CloudFront-Is-Mobile-Viewer": "false",
+ "CloudFront-Is-SmartTV-Viewer": "false",
+ "CloudFront-Is-Tablet-Viewer": "false",
+ "CloudFront-Viewer-Country": "US",
+ "Content-Type": "application/json",
+ "headerName": "headerValue",
+ "Host": "gy415nuibc.execute-api.us-east-1.amazonaws.com",
+ "Postman-Token": "9f583ef0-ed83-4a38-aef3-eb9ce3f7a57f",
+ "User-Agent": "PostmanRuntime/2.4.5",
+ "Via": "1.1 d98420743a69852491bbdea73f7680bd.cloudfront.net (CloudFront)",
+ "X-Amz-Cf-Id": "pn-PWIJc6thYnZm5P0NMgOUglL1DYtl0gdeJky8tqsg8iS_sgsKD1A==",
+ "X-Forwarded-For": "54.240.196.186, 54.182.214.83",
+ "X-Forwarded-Port": "443",
+ "X-Forwarded-Proto": "https"
+ },
+ "isBase64Encoded": false,
+ "multiValueHeaders": {
+ "Host": [
+ "*.execute-api.eu-central-1.amazonaws.com"
+ ],
+ "Sec-WebSocket-Extensions": [
+ "permessage-deflate; client_max_window_bits"
+ ],
+ "Sec-WebSocket-Key": [
+ "*"
+ ],
+ "Sec-WebSocket-Version": [
+ "13"
+ ],
+ "X-Amzn-Trace-Id": [
+ "Root=*"
+ ],
+ "X-Forwarded-For": [
+ "*.*.*.*"
+ ],
+ "X-Forwarded-Port": [
+ "443"
+ ],
+ "X-Forwarded-Proto": [
+ "https"
+ ]
+ },
+ "queryStringParameters": {
+ "name": "me"
+ },
+ "multiValueQueryStringParameters": {
+ "name": ["me"]
+ },
+ "pathParameters": {
+ "proxy": "hello/world"
+ },
+ "stageVariables": {
+ "stageVariableName": "stageVariableValue"
+ },
+ "requestContext": {
+ "accountId": "12345678912",
+ "resourceId": "roq9wj",
+ "stage": "testStage",
+ "requestId": "deef4878-7910-11e6-8f14-25afc3e9ae33",
+ "identity": {
+ "cognitoIdentityPoolId": "theCognitoIdentityPoolId",
+ "accountId": "theAccountId",
+ "cognitoIdentityId": "theCognitoIdentityId",
+ "caller": "theCaller",
+ "apiKey": "theApiKey",
+ "apiKeyId": "theApiKeyId",
+ "accessKey": "ANEXAMPLEOFACCESSKEY",
+ "sourceIp": "192.168.196.186",
+ "cognitoAuthenticationType": "theCognitoAuthenticationType",
+ "cognitoAuthenticationProvider": "theCognitoAuthenticationProvider",
+ "userArn": "theUserArn",
+ "userAgent": "PostmanRuntime/2.4.5",
+ "user": "theUser"
+ },
+ "resourcePath": "/{proxy+}",
+ "authorizer": {
+ "principalId": "admin",
+ "clientId": 1,
+ "clientName": "Exata"
+ },
+ "httpMethod": "POST",
+ "apiId": "gy415nuibc",
+ "connectedAt": 1547230720092,
+ "connectionId": "TWegAcC4EowCHnA=",
+ "domainName": "*.execute-api.eu-central-1.amazonaws.com",
+ "error": "*",
+ "eventType": "CONNECT",
+ "extendedRequestId": "TWegAcC4EowCHnA=",
+ "integrationLatency": "123",
+ "messageDirection": "IN",
+ "messageId": "messageId",
+ "requestTime": "07/Jan/2019:09:20:57 +0000",
+ "requestTimeEpoch": 0,
+ "routeKey": "$connect",
+ "status": "*"
+ },
+ "body": "{\r\n\t\"a\": 1\r\n}"
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_web_socket_response.json b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_web_socket_response.json
new file mode 100644
index 00000000..8a2bb30d
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/api_gateway_v2_web_socket_response.json
@@ -0,0 +1,43 @@
+{
+ "statusCode": 200,
+ "headers": {
+ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
+ "Accept-Encoding": "gzip, deflate, lzma, sdch, br",
+ "Accept-Language": "en-US,en;q=0.8",
+ "CloudFront-Forwarded-Proto": "https",
+ "CloudFront-Is-Desktop-Viewer": "true",
+ "CloudFront-Is-Mobile-Viewer": "false",
+ "CloudFront-Is-SmartTV-Viewer": "false",
+ "CloudFront-Is-Tablet-Viewer": "false",
+ "CloudFront-Viewer-Country": "US",
+ "Host": "wt6mne2s9k.execute-api.us-west-2.amazonaws.com",
+ "Upgrade-Insecure-Requests": "1",
+ "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 OPR/39.0.2256.48",
+ "Via": "1.1 fb7cca60f0ecd82ce07790c9c5eef16c.cloudfront.net (CloudFront)",
+ "X-Amz-Cf-Id": "nBsWBOrSHMgnaROZJK1wGCZ9PcRcSpq_oSXZNQwQ10OTZL4cimZo3g==",
+ "X-Forwarded-For": "192.168.100.1, 192.168.1.1",
+ "X-Forwarded-Port": "443",
+ "X-Forwarded-Proto": "https"
+ },
+ "multiValueHeaders": {
+ "Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"],
+ "Accept-Encoding": ["gzip, deflate, lzma, sdch, br"],
+ "Accept-Language": ["en-US,en;q=0.8"],
+ "CloudFront-Forwarded-Proto": ["https"],
+ "CloudFront-Is-Desktop-Viewer": ["true"],
+ "CloudFront-Is-Mobile-Viewer": ["false"],
+ "CloudFront-Is-SmartTV-Viewer": ["false"],
+ "CloudFront-Is-Tablet-Viewer": ["false"],
+ "CloudFront-Viewer-Country": ["US"],
+ "Host": ["wt6mne2s9k.execute-api.us-west-2.amazonaws.com"],
+ "Upgrade-Insecure-Requests": ["1"],
+ "User-Agent": ["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 OPR/39.0.2256.48"],
+ "Via": ["1.1 fb7cca60f0ecd82ce07790c9c5eef16c.cloudfront.net (CloudFront)"],
+ "X-Amz-Cf-Id": ["nBsWBOrSHMgnaROZJK1wGCZ9PcRcSpq_oSXZNQwQ10OTZL4cimZo3g=="],
+ "X-Forwarded-For": ["192.168.100.1, 192.168.1.1"],
+ "X-Forwarded-Port": ["443"],
+ "X-Forwarded-Proto": ["https"]
+ },
+ "isBase64Encoded": false,
+ "body": "Hello World"
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/app_sync_lambda_authorizer_event.json b/aws-lambda-java-events/src/test/resources/event_models/app_sync_lambda_authorizer_event.json
new file mode 100644
index 00000000..6dbd74f6
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/app_sync_lambda_authorizer_event.json
@@ -0,0 +1,11 @@
+{
+ "authorizationToken": "ExampleAUTHtoken123123123",
+ "requestContext": {
+ "apiId": "aaaaaa123123123example123",
+ "accountId": "111122223333",
+ "requestId": "f4081827-1111-4444-5555-5cf4695f339f",
+ "queryString": "mutation CreateEvent {...}\n\nquery MyQuery {...}\n",
+ "operationName": "MyQuery",
+ "variables": {}
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/app_sync_lambda_authorizer_response.json b/aws-lambda-java-events/src/test/resources/event_models/app_sync_lambda_authorizer_response.json
new file mode 100644
index 00000000..230ad092
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/app_sync_lambda_authorizer_response.json
@@ -0,0 +1,7 @@
+{
+ "isAuthorized":true,
+ "resolverContext": {
+ "banana":"very yellow",
+ "apple":"very green"
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/application_load_balancer_request_event.json b/aws-lambda-java-events/src/test/resources/event_models/application_load_balancer_request_event.json
new file mode 100644
index 00000000..83f847ec
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/application_load_balancer_request_event.json
@@ -0,0 +1,28 @@
+{
+ "requestContext": {
+ "elb": {
+ "targetGroupArn": "arn:aws:elasticloadbalancing:us-east-2:123456789012:targetgroup/lambda-279XGJDqGZ5rsrHC2Fjr/49e9d65c45c6791a"
+ }
+ },
+ "httpMethod": "GET",
+ "path": "/lambda",
+ "queryStringParameters": {
+ "query": "1234ABCD"
+ },
+ "headers": {
+ "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
+ "accept-encoding": "gzip",
+ "accept-language": "en-US,en;q=0.9",
+ "connection": "keep-alive",
+ "host": "lambda-alb-123578498.us-east-2.elb.amazonaws.com",
+ "upgrade-insecure-requests": "1",
+ "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
+ "x-amzn-trace-id": "Root=1-5c536348-3d683b8b04734faae651f476",
+ "x-forwarded-for": "72.12.164.125",
+ "x-forwarded-port": "80",
+ "x-forwarded-proto": "http",
+ "x-imforwards": "20"
+ },
+ "body": "",
+ "isBase64Encoded": false
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/application_load_balancer_response_event.json b/aws-lambda-java-events/src/test/resources/event_models/application_load_balancer_response_event.json
new file mode 100644
index 00000000..a0936c1a
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/application_load_balancer_response_event.json
@@ -0,0 +1,9 @@
+{
+ "statusCode": 200,
+ "statusDescription": "200 OK",
+ "isBase64Encoded": false,
+ "headers": {
+ "Content-Type": "text/html"
+ },
+ "body": "Hello from Lambda!
"
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/cloud_formation_custom_resource_event.json b/aws-lambda-java-events/src/test/resources/event_models/cloud_formation_custom_resource_event.json
new file mode 100644
index 00000000..458b2c35
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/cloud_formation_custom_resource_event.json
@@ -0,0 +1,13 @@
+{
+ "RequestType": "Create",
+ "ServiceToken": "arn:aws:lambda:us-east-2:123456789012:function:lambda-error-processor-primer-14ROR2T3JKU66",
+ "ResponseURL": "https://cloudformation-custom-resource-response-useast2.s3-us-east-2.amazonaws.com/arn%3Aaws%3Acloudformation%3Aus-east-2%3A123456789012%3Astack/lambda-error-processor/1134083a-2608-1e91-9897-022501a2c456%7Cprimerinvoke%7C5d478078-13e9-baf0-464a-7ef285ecc786?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=1555451971&Signature=28UijZePE5I4dvukKQqM%2F9Rf1o4%3D",
+ "StackId": "arn:aws:cloudformation:us-east-2:123456789012:stack/lambda-error-processor/1134083a-2608-1e91-9897-022501a2c456",
+ "RequestId": "5d478078-13e9-baf0-464a-7ef285ecc786",
+ "LogicalResourceId": "primerinvoke",
+ "ResourceType": "AWS::CloudFormation::CustomResource",
+ "ResourceProperties": {
+ "ServiceToken": "arn:aws:lambda:us-east-2:123456789012:function:lambda-error-processor-primer-14ROR2T3JKU66",
+ "FunctionName": "lambda-error-processor-randomerror-ZWUC391MQAJK"
+ }
+}
diff --git a/aws-lambda-java-serialization/src/test/resources/event_models/cloud_front_event.json b/aws-lambda-java-events/src/test/resources/event_models/cloud_front_event.json
similarity index 99%
rename from aws-lambda-java-serialization/src/test/resources/event_models/cloud_front_event.json
rename to aws-lambda-java-events/src/test/resources/event_models/cloud_front_event.json
index e9167480..4510faff 100644
--- a/aws-lambda-java-serialization/src/test/resources/event_models/cloud_front_event.json
+++ b/aws-lambda-java-events/src/test/resources/event_models/cloud_front_event.json
@@ -27,4 +27,4 @@
}
}
]
-}
\ No newline at end of file
+}
diff --git a/aws-lambda-java-serialization/src/test/resources/event_models/cloud_watch_logs_event.json b/aws-lambda-java-events/src/test/resources/event_models/cloud_watch_logs_event.json
similarity index 99%
rename from aws-lambda-java-serialization/src/test/resources/event_models/cloud_watch_logs_event.json
rename to aws-lambda-java-events/src/test/resources/event_models/cloud_watch_logs_event.json
index 2b455b9b..aa184c1d 100644
--- a/aws-lambda-java-serialization/src/test/resources/event_models/cloud_watch_logs_event.json
+++ b/aws-lambda-java-events/src/test/resources/event_models/cloud_watch_logs_event.json
@@ -2,4 +2,4 @@
"awslogs": {
"data": "H4sIAAAAAAAAAHWPwQqCQBCGX0Xm7EFtK+smZBEUgXoLCdMhFtKV3akI8d0bLYmibvPPN3wz00CJxmQnTO41whwWQRIctmEcB6sQbFC3CjW3XW8kxpOpP+OC22d1Wml1qZkQGtoMsScxaczKN3plG8zlaHIta5KqWsozoTYw3/djzwhpLwivWFGHGpAFe7DL68JlBUk+l7KSN7tCOEJ4M3/qOI49vMHj+zCKdlFqLaU2ZHV2a4Ct/an0/ivdX8oYc1UVX860fQDQiMdxRQEAAA=="
}
-}
\ No newline at end of file
+}
diff --git a/aws-lambda-java-serialization/src/test/resources/event_models/code_commit_event.json b/aws-lambda-java-events/src/test/resources/event_models/code_commit_event.json
similarity index 99%
rename from aws-lambda-java-serialization/src/test/resources/event_models/code_commit_event.json
rename to aws-lambda-java-events/src/test/resources/event_models/code_commit_event.json
index 4e111cdd..620a2d1c 100644
--- a/aws-lambda-java-serialization/src/test/resources/event_models/code_commit_event.json
+++ b/aws-lambda-java-events/src/test/resources/event_models/code_commit_event.json
@@ -24,4 +24,4 @@
"eventTotalParts": 1
}
]
-}
\ No newline at end of file
+}
diff --git a/aws-lambda-java-serialization/src/test/resources/event_models/cognito_event.json b/aws-lambda-java-events/src/test/resources/event_models/cognito_event.json
similarity index 100%
rename from aws-lambda-java-serialization/src/test/resources/event_models/cognito_event.json
rename to aws-lambda-java-events/src/test/resources/event_models/cognito_event.json
diff --git a/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_create_auth_challenge_event.json b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_create_auth_challenge_event.json
new file mode 100644
index 00000000..0188f4fa
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_create_auth_challenge_event.json
@@ -0,0 +1,41 @@
+{
+ "version": "1",
+ "region": "us-west-2",
+ "userPoolId": "",
+ "userName": "",
+ "callerContext": {
+ "awsSdkVersion": "aws-sdk-unknown-unknown",
+ "clientId": ""
+ },
+ "triggerSource": "CreateAuthChallenge_Authentication",
+ "request": {
+ "userAttributes": {
+ "sub": "",
+ "cognito:user_status": "CONFIRMED",
+ "phone_number_verified": "true",
+ "cognito:phone_number_alias": "+12223334455",
+ "phone_number": "+12223334455"
+ },
+ "challengeName": "CUSTOM_CHALLENGE",
+ "session": [
+ {
+ "challengeName": "PASSWORD_VERIFIER",
+ "challengeResult": true,
+ "challengeMetadata": "metadata"
+ }
+ ],
+ "clientMetadata": {
+ "exampleMetadataKey": "example metadata value"
+ },
+ "userNotFound": false
+ },
+ "response": {
+ "publicChallengeParameters": {
+ "a": "b"
+ },
+ "privateChallengeParameters": {
+ "c": "d"
+ },
+ "challengeMetadata": "challengeMetadata"
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_custom_message_event.json b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_custom_message_event.json
new file mode 100644
index 00000000..03ba4d3d
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_custom_message_event.json
@@ -0,0 +1,27 @@
+{
+ "version": "1",
+ "triggerSource": "CustomMessage_SignUp/CustomMessage_ResendCode/CustomMessage_ForgotPassword/CustomMessage_VerifyUserAttribute",
+ "region": "",
+ "userPoolId": "",
+ "userName": "",
+ "callerContext": {
+ "awsSdkVersion": "",
+ "clientId": ""
+ },
+ "request": {
+ "userAttributes": {
+ "phone_number_verified": "true",
+ "email_verified": "false"
+ },
+ "codeParameter": "####",
+ "usernameParameter": "{username}",
+ "clientMetadata": {
+ "exampleMetadataKey": "example metadata value"
+ }
+ },
+ "response": {
+ "smsMessage": "",
+ "emailMessage": "",
+ "emailSubject": ""
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_define_auth_challenge_event.json b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_define_auth_challenge_event.json
new file mode 100644
index 00000000..295f969f
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_define_auth_challenge_event.json
@@ -0,0 +1,36 @@
+{
+ "version": "1",
+ "region": "us-west-2",
+ "userPoolId": "",
+ "userName": "",
+ "callerContext": {
+ "awsSdkVersion": "aws-sdk-unknown-unknown",
+ "clientId": ""
+ },
+ "triggerSource": "DefineAuthChallenge_Authentication",
+ "request": {
+ "userAttributes": {
+ "sub": "",
+ "cognito:user_status": "CONFIRMED",
+ "phone_number_verified": "true",
+ "cognito:phone_number_alias": "+12223334455",
+ "phone_number": "+12223334455"
+ },
+ "session": [
+ {
+ "challengeName": "PASSWORD_VERIFIER",
+ "challengeResult": true,
+ "challengeMetadata": "metadata"
+ }
+ ],
+ "clientMetadata": {
+ "exampleMetadataKey": "example metadata value"
+ },
+ "userNotFound": false
+ },
+ "response": {
+ "challengeName": "challengeName",
+ "issueTokens": true,
+ "failAuthentication": true
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_migrate_user_event.json b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_migrate_user_event.json
new file mode 100644
index 00000000..cb3c8df2
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_migrate_user_event.json
@@ -0,0 +1,33 @@
+{
+ "version": "1",
+ "triggerSource": "UserMigration_Authentication",
+ "region": "",
+ "userPoolId": "",
+ "userName": "",
+ "callerContext": {
+ "awsSdkVersion": "",
+ "clientId": ""
+ },
+ "request": {
+ "password": "",
+ "validationData": {
+ "exampleMetadataKey": "example metadata value"
+ },
+ "clientMetadata": {
+ "exampleMetadataKey": "example metadata value"
+ }
+ },
+ "response": {
+ "userAttributes": {
+ "email": "",
+ "phone_number": ""
+ },
+ "finalUserStatus": "",
+ "messageAction": "",
+ "desiredDeliveryMediums": [
+ "",
+ ""
+ ],
+ "forceAliasCreation": true
+ }
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_post_authentication_event.json b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_post_authentication_event.json
new file mode 100644
index 00000000..d256c9dd
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_post_authentication_event.json
@@ -0,0 +1,22 @@
+{
+ "version": "1",
+ "triggerSource": "PostAuthentication_Authentication",
+ "region": "",
+ "userPoolId": "",
+ "userName": "",
+ "callerContext": {
+ "awsSdkVersion": "",
+ "clientId": ""
+ },
+ "request": {
+ "newDeviceUsed": true,
+ "userAttributes" : {
+ "email": "",
+ "phone_number": ""
+ },
+ "clientMetadata": {
+ "exampleMetadataKey": "example metadata value"
+ }
+ },
+ "response": {}
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_post_confirmation_event.json b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_post_confirmation_event.json
new file mode 100644
index 00000000..2c6e6daa
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_post_confirmation_event.json
@@ -0,0 +1,21 @@
+{
+ "version": "1",
+ "triggerSource": "PostConfirmation_ConfirmSignUp",
+ "region": "",
+ "userPoolId": "",
+ "userName": "",
+ "callerContext": {
+ "awsSdkVersion": "",
+ "clientId": ""
+ },
+ "request": {
+ "userAttributes" : {
+ "email": "",
+ "phone_number": ""
+ },
+ "clientMetadata": {
+ "exampleMetadataKey": "example metadata value"
+ }
+ },
+ "response": {}
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_pre_authentication_event.json b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_pre_authentication_event.json
new file mode 100644
index 00000000..03a81979
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_pre_authentication_event.json
@@ -0,0 +1,22 @@
+{
+ "version": "1",
+ "triggerSource": "PreAuthentication_Authentication",
+ "region": "",
+ "userPoolId": "",
+ "userName": "",
+ "callerContext": {
+ "awsSdkVersion": "",
+ "clientId": ""
+ },
+ "request": {
+ "userAttributes": {
+ "email": ""
+ },
+ "validationData": {
+ "k1": "v1",
+ "k2": "v2"
+ },
+ "userNotFound": false
+ },
+ "response": {}
+}
\ No newline at end of file
diff --git a/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_pre_sign_up_event.json b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_pre_sign_up_event.json
new file mode 100644
index 00000000..f8b72a23
--- /dev/null
+++ b/aws-lambda-java-events/src/test/resources/event_models/cognito_user_pool_pre_sign_up_event.json
@@ -0,0 +1,29 @@
+{
+ "version": "1",
+ "triggerSource": "PreSignUp_SignUp",
+ "region": "",
+ "userPoolId": "",
+ "userName": "",
+ "callerContext": {
+ "awsSdkVersion": "",
+ "clientId": "