From 8c37e8d8016ae3b02e02d75a974d2ab444c22457 Mon Sep 17 00:00:00 2001 From: lucasam Date: Sun, 28 Jul 2019 17:01:49 -0300 Subject: [PATCH 1/5] Add missing fields to API Gateway request context: * extendedRequestId * requestTime * requestTimeEpoch * domainName * protocol * connectionId * routeKey * messageId * eventType * messageDirection * connectedAt Fixes issues https://github.com/aws/aws-lambda-java-libs/issues/88 https://github.com/aws/aws-lambda-java-libs/issues/76 https://github.com/aws/aws-lambda-java-libs/issues/71 https://github.com/aws/aws-lambda-java-libs/issues/41 --- .../events/APIGatewayProxyRequestEvent.java | 366 +++++++++++++++++- 1 file changed, 362 insertions(+), 4 deletions(-) diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java index 68ca91da1..1ba304e6a 100644 --- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java +++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java @@ -62,6 +62,28 @@ public static class ProxyRequestContext implements Serializable, Cloneable { private Map authorizer; + private String extendedRequestId; + + private String requestTime; + + private Long requestTimeEpoch; + + private String domainName; + + private String protocol; + + private String connectionId; + + private String routeKey; + + private String messageId; + + private String eventType; + + private String messageDirection; + + private Long connectedAt; + /** * default constructor */ @@ -282,6 +304,265 @@ public ProxyRequestContext withPath(String path) { return this; } + /** + * @return The API Gateway Extended Request Id + */ + public String getExtendedRequestId() { + return extendedRequestId; + } + + /** + * @param extendedRequestId The API Gateway Extended Request Id + */ + public void setExtendedRequestId(String extendedRequestId) { + this.extendedRequestId = extendedRequestId; + } + + /** + * @param extendedRequestId The API Gateway Extended Request Id + * @return ProxyRequestContext object + */ + public ProxyRequestContext withExtendedRequestId(String extendedRequestId) { + this.setExtendedRequestId(extendedRequestId); + return this; + } + + /** + * @return The CLF-formatted request time (dd/MMM/yyyy:HH:mm:ss +-hhmm). + */ + public String getRequestTime() { + return requestTime; + } + + /** + * @param requestTime The CLF-formatted request time (dd/MMM/yyyy:HH:mm:ss +-hhmm). + */ + public void setRequestTime(String requestTime) { + this.requestTime = requestTime; + } + + /** + * @param requestTime The CLF-formatted request time (dd/MMM/yyyy:HH:mm:ss +-hhmm). + * @return ProxyRequestContext object + */ + public ProxyRequestContext withRequestTime(String requestTime) { + this.setRequestTime(requestTime); + return this; + } + + /** + * @return The Epoch-formatted request time (in millis) + */ + public Long getRequestTimeEpoch() { + return requestTimeEpoch; + } + + /** + * @param requestTimeEpoch The Epoch-formatted request time (in millis) + */ + public void setRequestTimeEpoch(Long requestTimeEpoch) { + this.requestTimeEpoch = requestTimeEpoch; + } + + /** + * @param requestTimeEpoch The Epoch-formatted request time (in millis) + * @return ProxyRequestContext object + */ + public ProxyRequestContext withRequestTimeEpoch(Long requestTimeEpoch) { + this.setRequestTimeEpoch(requestTimeEpoch); + return this; + } + + /** + * @return The full domain name used to invoke the API. This should be the same as the incoming Host header. + */ + public String getDomainName() { + return domainName; + } + + /** + * @param domainName The full domain name used to invoke the API. + * This should be the same as the incoming Host header. + */ + public void setDomainName(String domainName) { + this.domainName = domainName; + } + + /** + * @param domainName The full domain name used to invoke the API. + * This should be the same as the incoming Host header. + * @return ProxyRequestContext object + */ + public ProxyRequestContext withDomainName(String domainName) { + this.setDomainName(domainName); + return this; + } + + /** + * @return The request protocol, for example, HTTP/1.1. + */ + public String getProtocol() { + return protocol; + } + + /** + * @param protocol The request protocol, for example, HTTP/1.1. + */ + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + /** + * @param protocol The request protocol, for example, HTTP/1.1. + * @return ProxyRequestContext object + */ + public ProxyRequestContext withProtocol(String protocol) { + this.setProtocol(protocol); + return this; + } + /** + * @return A unique ID for the connection that can be used to make a callback to the client. (Websocket API Gateway) + */ + public String getConnectionId() { + return connectionId; + } + + /** + * @param connectionId A unique ID for the connection that can be used to make a callback to the client. + * (Websocket API Gateway) + */ + public void setConnectionId(String connectionId) { + this.connectionId = connectionId; + } + + /** + * @param connectionId A unique ID for the connection that can be used to make a callback to the client. + * (Websocket API Gateway) + * @return ProxyRequestContext object + */ + public ProxyRequestContext withConnectionId(String connectionId) { + this.setConnectionId(connectionId); + return this; + } + + /** + * @return The selected route key. (Websocket API Gateway) + */ + public String getRouteKey() { + return routeKey; + } + + /** + * @param routeKey The selected route key. (Websocket API Gateway) + */ + public void setRouteKey(String routeKey) { + this.routeKey = routeKey; + } + + /** + * @param routeKey The selected route key. (Websocket API Gateway) + * @return ProxyRequestContext object + */ + public ProxyRequestContext withRouteKey(String routeKey) { + this.setRouteKey(routeKey); + return this; + } + + /** + * @return A unique server-side ID for a message. Available only when the eventType is MESSAGE. + * (Websocket API Gateway) + */ + public String getMessageId() { + return messageId; + } + + /** + * @param messageId A unique server-side ID for a message. Available only when the eventType is MESSAGE. + * (Websocket API Gateway) + */ + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + /** + * @param messageId A unique server-side ID for a message. Available only when the eventType is MESSAGE. + * (Websocket API Gateway) + * @return ProxyRequestContext object + */ + public ProxyRequestContext withMessageId(String messageId) { + this.setMessageId(messageId); + return this; + } + + /** + * @return The event type: CONNECT, MESSAGE, or DISCONNECT. (Websocket API Gateway) + */ + public String getEventType() { + return eventType; + } + + /** + * @param eventType The event type: CONNECT, MESSAGE, or DISCONNECT. (Websocket API Gateway) + */ + public void setEventType(String eventType) { + this.eventType = eventType; + } + + /** + * @param eventType The event type: CONNECT, MESSAGE, or DISCONNECT. (Websocket API Gateway) + * @return ProxyRequestContext object + */ + public ProxyRequestContext withEventType(String eventType) { + this.setEventType(eventType); + return this; + } + + /** + * @return Message direction IN, OUT. (Websocket API Gateway) + */ + public String getMessageDirection() { + return messageDirection; + } + + /** + * @param messageDirection Message direction IN, OUT. (Websocket API Gateway) + */ + public void setMessageDirection(String messageDirection) { + this.messageDirection = messageDirection; + } + + /** + * @param messageDirection Message direction IN, OUT. (Websocket API Gateway) + * @return ProxyRequestContext object + */ + public ProxyRequestContext withMessageDirection(String messageDirection) { + this.setMessageDirection(messageDirection); + return this; + } + + /** + * @return The Epoch-formatted Websocket connection time in millis. (Websocket API Gateway) + */ + public Long getConnectedAt() { + return connectedAt; + } + + /** + * @param connectedAt The Epoch-formatted Websocket connection time in millis. (Websocket API Gateway) + */ + public void setConnectedAt(Long connectedAt) { + this.connectedAt = connectedAt; + } + + /** + * @param connectedAt The Epoch-formatted Websocket connection time in millis. (Websocket API Gateway) + * @return ProxyRequestContext object + */ + public ProxyRequestContext withConnectedAt(Long connectedAt) { + this.setConnectedAt(connectedAt); + return this; + } + /** * Returns a string representation of this object; useful for testing and debugging. * @@ -307,12 +588,34 @@ public String toString() { sb.append("resourcePath: ").append(getResourcePath()).append(","); if (getHttpMethod() != null) sb.append("httpMethod: ").append(getHttpMethod()).append(","); - if (getApiId() != null) - sb.append("apiId: ").append(getApiId()).append(","); if (getPath() != null) sb.append("path: ").append(getPath()).append(","); if (getAuthorizer() != null) - sb.append("authorizer: ").append(getAuthorizer().toString()); + sb.append("authorizer: ").append(getAuthorizer().toString()).append(","); + if (getExtendedRequestId() != null) + sb.append("extendedRequestId: ").append(getExtendedRequestId()).append(","); + if (getRequestTime() != null) + sb.append("requestTime: ").append(getRequestTime()).append(","); + if (getProtocol() != null) + sb.append("protocol: ").append(getProtocol()).append(","); + if (getRequestTimeEpoch() != null) + sb.append("requestTimeEpoch: ").append(getRequestTimeEpoch()).append(","); + if (getDomainName() != null) + sb.append("domainName: ").append(getDomainName()).append(","); + if (getConnectionId() != null) + sb.append("connectionId: ").append(getConnectionId()).append(","); + if (getRouteKey() != null) + sb.append("routeKey: ").append(getRouteKey()).append(","); + if (getMessageId() != null) + sb.append("messageId: ").append(getMessageId()).append(","); + if (getEventType() != null) + sb.append("eventType: ").append(getEventType()).append(","); + if (getMessageDirection() != null) + sb.append("messageDirection: ").append(getMessageDirection()).append(","); + if (getConnectedAt() != null) + sb.append("connectedAt: ").append(getConnectedAt()).append(","); + if (getApiId() != null) + sb.append("apiId: ").append(getApiId()); sb.append("}"); return sb.toString(); } @@ -367,6 +670,50 @@ public boolean equals(Object obj) { return false; if (other.getAuthorizer() != null && !other.getAuthorizer().equals(this.getAuthorizer())) return false; + if (other.getExtendedRequestId() == null ^ this.getExtendedRequestId() == null) + return false; + if (other.getExtendedRequestId() != null && other.getExtendedRequestId().equals(this.getExtendedRequestId()) == false) + return false; + if (other.getRequestTime() == null ^ this.getRequestTime() == null) + return false; + if (other.getRequestTime() != null && other.getRequestTime().equals(this.getRequestTime()) == false) + return false; + if (other.getRequestTimeEpoch() == null ^ this.getRequestTimeEpoch() == null) + return false; + if (other.getRequestTimeEpoch() != null && other.getRequestTimeEpoch().equals(this.getRequestTimeEpoch()) == false) + return false; + if (other.getDomainName() == null ^ this.getDomainName() == null) + return false; + if (other.getDomainName() != null && other.getDomainName().equals(this.getDomainName()) == false) + return false; + if (other.getProtocol() == null ^ this.getProtocol() == null) + return false; + if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == false) + return false; + if (other.getConnectionId() == null ^ this.getConnectionId() == null) + return false; + if (other.getConnectionId() != null && other.getConnectionId().equals(this.getConnectionId()) == false) + return false; + if (other.getRouteKey() == null ^ this.getRouteKey() == null) + return false; + if (other.getRouteKey() != null && other.getRouteKey().equals(this.getRouteKey()) == false) + return false; + if (other.getMessageId() == null ^ this.getMessageId() == null) + return false; + if (other.getMessageId() != null && other.getMessageId().equals(this.getMessageId()) == false) + return false; + if (other.getEventType() == null ^ this.getEventType() == null) + return false; + if (other.getEventType() != null && other.getEventType().equals(this.getEventType()) == false) + return false; + if (other.getMessageDirection() == null ^ this.getMessageDirection() == null) + return false; + if (other.getMessageDirection() != null && other.getMessageDirection().equals(this.getMessageDirection()) == false) + return false; + if (other.getConnectedAt() == null ^ this.getConnectedAt() == null) + return false; + if (other.getConnectedAt() != null && other.getConnectedAt().equals(this.getConnectedAt()) == false) + return false; return true; } @@ -385,6 +732,17 @@ public int hashCode() { hashCode = prime * hashCode + ((getApiId() == null) ? 0 : getApiId().hashCode()); hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode()); hashCode = prime * hashCode + ((getAuthorizer() == null) ? 0 : getAuthorizer().hashCode()); + hashCode = prime * hashCode + ((getExtendedRequestId() == null) ? 0 : getExtendedRequestId().hashCode()); + hashCode = prime * hashCode + ((getRequestTime() == null) ? 0 : getRequestTime().hashCode()); + hashCode = prime * hashCode + ((getRequestTimeEpoch() == null) ? 0 : getRequestTimeEpoch().hashCode()); + hashCode = prime * hashCode + ((getDomainName() == null) ? 0 : getDomainName().hashCode()); + hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode()); + hashCode = prime * hashCode + ((getConnectionId() == null) ? 0 : getConnectionId().hashCode()); + hashCode = prime * hashCode + ((getRouteKey() == null) ? 0 : getRouteKey().hashCode()); + hashCode = prime * hashCode + ((getMessageId() == null) ? 0 : getMessageId().hashCode()); + hashCode = prime * hashCode + ((getEventType() == null) ? 0 : getEventType().hashCode()); + hashCode = prime * hashCode + ((getMessageDirection() == null) ? 0 : getMessageDirection().hashCode()); + hashCode = prime * hashCode + ((getConnectedAt() == null) ? 0 : getConnectedAt().hashCode()); return hashCode; } @@ -1135,7 +1493,7 @@ public APIGatewayProxyRequestEvent withIsBase64Encoded(Boolean isBase64Encoded) this.setIsBase64Encoded(isBase64Encoded); return this; } - + /** * Returns a string representation of this object; useful for testing and debugging. * From d29408f1aeb006d547ee242a1135baaa1385ccac Mon Sep 17 00:00:00 2001 From: lucasam Date: Thu, 1 Aug 2019 16:05:38 -0300 Subject: [PATCH 2/5] Removed websocket related fields because it was addressed at https://github.com/aws/aws-lambda-java-libs/pull/92 --- aws-lambda-java-events/pom.xml | 2 +- .../events/APIGatewayProxyRequestEvent.java | 222 ++---------------- 2 files changed, 27 insertions(+), 197 deletions(-) diff --git a/aws-lambda-java-events/pom.xml b/aws-lambda-java-events/pom.xml index 93105bea5..4ea444d46 100644 --- a/aws-lambda-java-events/pom.xml +++ b/aws-lambda-java-events/pom.xml @@ -3,7 +3,7 @@ com.amazonaws aws-lambda-java-events - 2.2.6 + 2.2.7-SNAPSHOT jar AWS Lambda Java Events Library diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java index 1ba304e6a..f976955a4 100644 --- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java +++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java @@ -70,19 +70,9 @@ public static class ProxyRequestContext implements Serializable, Cloneable { private String domainName; - private String protocol; - - private String connectionId; - - private String routeKey; - - private String messageId; + private String domainPrefix; - private String eventType; - - private String messageDirection; - - private Long connectedAt; + private String protocol; /** * default constructor @@ -399,167 +389,47 @@ public ProxyRequestContext withDomainName(String domainName) { } /** - * @return The request protocol, for example, HTTP/1.1. - */ - public String getProtocol() { - return protocol; - } - - /** - * @param protocol The request protocol, for example, HTTP/1.1. - */ - public void setProtocol(String protocol) { - this.protocol = protocol; - } - - /** - * @param protocol The request protocol, for example, HTTP/1.1. - * @return ProxyRequestContext object - */ - public ProxyRequestContext withProtocol(String protocol) { - this.setProtocol(protocol); - return this; - } - /** - * @return A unique ID for the connection that can be used to make a callback to the client. (Websocket API Gateway) - */ - public String getConnectionId() { - return connectionId; - } - - /** - * @param connectionId A unique ID for the connection that can be used to make a callback to the client. - * (Websocket API Gateway) - */ - public void setConnectionId(String connectionId) { - this.connectionId = connectionId; - } - - /** - * @param connectionId A unique ID for the connection that can be used to make a callback to the client. - * (Websocket API Gateway) - * @return ProxyRequestContext object - */ - public ProxyRequestContext withConnectionId(String connectionId) { - this.setConnectionId(connectionId); - return this; - } - - /** - * @return The selected route key. (Websocket API Gateway) - */ - public String getRouteKey() { - return routeKey; - } - - /** - * @param routeKey The selected route key. (Websocket API Gateway) - */ - public void setRouteKey(String routeKey) { - this.routeKey = routeKey; - } - - /** - * @param routeKey The selected route key. (Websocket API Gateway) - * @return ProxyRequestContext object - */ - public ProxyRequestContext withRouteKey(String routeKey) { - this.setRouteKey(routeKey); - return this; - } - - /** - * @return A unique server-side ID for a message. Available only when the eventType is MESSAGE. - * (Websocket API Gateway) + * @return The first label of the domainName. This is often used as a caller/customer identifier. */ - public String getMessageId() { - return messageId; + public String getDomainPrefix() { + return domainPrefix; } /** - * @param messageId A unique server-side ID for a message. Available only when the eventType is MESSAGE. - * (Websocket API Gateway) + * @param domainPrefix The first label of the domainName. This is often used as a caller/customer identifier. */ - public void setMessageId(String messageId) { - this.messageId = messageId; + public void setDomainPrefix(String domainPrefix) { + this.domainPrefix = domainPrefix; } /** - * @param messageId A unique server-side ID for a message. Available only when the eventType is MESSAGE. - * (Websocket API Gateway) - * @return ProxyRequestContext object - */ - public ProxyRequestContext withMessageId(String messageId) { - this.setMessageId(messageId); - return this; - } - - /** - * @return The event type: CONNECT, MESSAGE, or DISCONNECT. (Websocket API Gateway) - */ - public String getEventType() { - return eventType; - } - - /** - * @param eventType The event type: CONNECT, MESSAGE, or DISCONNECT. (Websocket API Gateway) - */ - public void setEventType(String eventType) { - this.eventType = eventType; - } - - /** - * @param eventType The event type: CONNECT, MESSAGE, or DISCONNECT. (Websocket API Gateway) - * @return ProxyRequestContext object - */ - public ProxyRequestContext withEventType(String eventType) { - this.setEventType(eventType); - return this; - } - - /** - * @return Message direction IN, OUT. (Websocket API Gateway) - */ - public String getMessageDirection() { - return messageDirection; - } - - /** - * @param messageDirection Message direction IN, OUT. (Websocket API Gateway) - */ - public void setMessageDirection(String messageDirection) { - this.messageDirection = messageDirection; - } - - /** - * @param messageDirection Message direction IN, OUT. (Websocket API Gateway) - * @return ProxyRequestContext object + * @param domainPrefix The first label of the domainName. This is often used as a caller/customer identifier. + * @return */ - public ProxyRequestContext withMessageDirection(String messageDirection) { - this.setMessageDirection(messageDirection); + public ProxyRequestContext withDomainPrefix(String domainPrefix) { + this.setDomainPrefix(domainPrefix); return this; } - /** - * @return The Epoch-formatted Websocket connection time in millis. (Websocket API Gateway) + * @return The request protocol, for example, HTTP/1.1. */ - public Long getConnectedAt() { - return connectedAt; + public String getProtocol() { + return protocol; } /** - * @param connectedAt The Epoch-formatted Websocket connection time in millis. (Websocket API Gateway) + * @param protocol The request protocol, for example, HTTP/1.1. */ - public void setConnectedAt(Long connectedAt) { - this.connectedAt = connectedAt; + public void setProtocol(String protocol) { + this.protocol = protocol; } /** - * @param connectedAt The Epoch-formatted Websocket connection time in millis. (Websocket API Gateway) + * @param protocol The request protocol, for example, HTTP/1.1. * @return ProxyRequestContext object */ - public ProxyRequestContext withConnectedAt(Long connectedAt) { - this.setConnectedAt(connectedAt); + public ProxyRequestContext withProtocol(String protocol) { + this.setProtocol(protocol); return this; } @@ -588,6 +458,8 @@ public String toString() { sb.append("resourcePath: ").append(getResourcePath()).append(","); if (getHttpMethod() != null) sb.append("httpMethod: ").append(getHttpMethod()).append(","); + if (getApiId() != null) + sb.append("apiId: ").append(getApiId()); if (getPath() != null) sb.append("path: ").append(getPath()).append(","); if (getAuthorizer() != null) @@ -600,22 +472,10 @@ public String toString() { sb.append("protocol: ").append(getProtocol()).append(","); if (getRequestTimeEpoch() != null) sb.append("requestTimeEpoch: ").append(getRequestTimeEpoch()).append(","); + if (getDomainPrefix() != null) + sb.append("domainPrefix: ").append(getDomainPrefix()).append(","); if (getDomainName() != null) - sb.append("domainName: ").append(getDomainName()).append(","); - if (getConnectionId() != null) - sb.append("connectionId: ").append(getConnectionId()).append(","); - if (getRouteKey() != null) - sb.append("routeKey: ").append(getRouteKey()).append(","); - if (getMessageId() != null) - sb.append("messageId: ").append(getMessageId()).append(","); - if (getEventType() != null) - sb.append("eventType: ").append(getEventType()).append(","); - if (getMessageDirection() != null) - sb.append("messageDirection: ").append(getMessageDirection()).append(","); - if (getConnectedAt() != null) - sb.append("connectedAt: ").append(getConnectedAt()).append(","); - if (getApiId() != null) - sb.append("apiId: ").append(getApiId()); + sb.append("domainName: ").append(getDomainName()); sb.append("}"); return sb.toString(); } @@ -690,30 +550,6 @@ public boolean equals(Object obj) { return false; if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == false) return false; - if (other.getConnectionId() == null ^ this.getConnectionId() == null) - return false; - if (other.getConnectionId() != null && other.getConnectionId().equals(this.getConnectionId()) == false) - return false; - if (other.getRouteKey() == null ^ this.getRouteKey() == null) - return false; - if (other.getRouteKey() != null && other.getRouteKey().equals(this.getRouteKey()) == false) - return false; - if (other.getMessageId() == null ^ this.getMessageId() == null) - return false; - if (other.getMessageId() != null && other.getMessageId().equals(this.getMessageId()) == false) - return false; - if (other.getEventType() == null ^ this.getEventType() == null) - return false; - if (other.getEventType() != null && other.getEventType().equals(this.getEventType()) == false) - return false; - if (other.getMessageDirection() == null ^ this.getMessageDirection() == null) - return false; - if (other.getMessageDirection() != null && other.getMessageDirection().equals(this.getMessageDirection()) == false) - return false; - if (other.getConnectedAt() == null ^ this.getConnectedAt() == null) - return false; - if (other.getConnectedAt() != null && other.getConnectedAt().equals(this.getConnectedAt()) == false) - return false; return true; } @@ -737,12 +573,6 @@ public int hashCode() { hashCode = prime * hashCode + ((getRequestTimeEpoch() == null) ? 0 : getRequestTimeEpoch().hashCode()); hashCode = prime * hashCode + ((getDomainName() == null) ? 0 : getDomainName().hashCode()); hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode()); - hashCode = prime * hashCode + ((getConnectionId() == null) ? 0 : getConnectionId().hashCode()); - hashCode = prime * hashCode + ((getRouteKey() == null) ? 0 : getRouteKey().hashCode()); - hashCode = prime * hashCode + ((getMessageId() == null) ? 0 : getMessageId().hashCode()); - hashCode = prime * hashCode + ((getEventType() == null) ? 0 : getEventType().hashCode()); - hashCode = prime * hashCode + ((getMessageDirection() == null) ? 0 : getMessageDirection().hashCode()); - hashCode = prime * hashCode + ((getConnectedAt() == null) ? 0 : getConnectedAt().hashCode()); return hashCode; } From 46135bc2e07c120e2b6cb908f8bc3e72ba4ab7d3 Mon Sep 17 00:00:00 2001 From: lucasam Date: Thu, 1 Aug 2019 16:11:42 -0300 Subject: [PATCH 3/5] Revert unwanted change --- aws-lambda-java-events/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws-lambda-java-events/pom.xml b/aws-lambda-java-events/pom.xml index 4ea444d46..93105bea5 100644 --- a/aws-lambda-java-events/pom.xml +++ b/aws-lambda-java-events/pom.xml @@ -3,7 +3,7 @@ com.amazonaws aws-lambda-java-events - 2.2.7-SNAPSHOT + 2.2.6 jar AWS Lambda Java Events Library From acc06794595e1fdd26567dde2a787a87c818b757 Mon Sep 17 00:00:00 2001 From: lucasam Date: Thu, 1 Aug 2019 16:13:04 -0300 Subject: [PATCH 4/5] Add domain prefix to equals --- .../lambda/runtime/events/APIGatewayProxyRequestEvent.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java index f976955a4..dbc9958e1 100644 --- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java +++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java @@ -546,6 +546,10 @@ public boolean equals(Object obj) { return false; if (other.getDomainName() != null && other.getDomainName().equals(this.getDomainName()) == false) return false; + if (other.getDomainPrefix() == null ^ this.getDomainPrefix() == null) + return false; + if (other.getDomainPrefix() != null && other.getDomainPrefix().equals(this.getDomainPrefix()) == false) + return false; if (other.getProtocol() == null ^ this.getProtocol() == null) return false; if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == false) From 7fe00558ec8d778e276bc01971b3966b34843c23 Mon Sep 17 00:00:00 2001 From: lucasam Date: Thu, 1 Aug 2019 16:13:55 -0300 Subject: [PATCH 5/5] Add domain prefix to hashcode --- .../lambda/runtime/events/APIGatewayProxyRequestEvent.java | 1 + 1 file changed, 1 insertion(+) diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java index dbc9958e1..1825de7fd 100644 --- a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java +++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyRequestEvent.java @@ -576,6 +576,7 @@ public int hashCode() { hashCode = prime * hashCode + ((getRequestTime() == null) ? 0 : getRequestTime().hashCode()); hashCode = prime * hashCode + ((getRequestTimeEpoch() == null) ? 0 : getRequestTimeEpoch().hashCode()); hashCode = prime * hashCode + ((getDomainName() == null) ? 0 : getDomainName().hashCode()); + hashCode = prime * hashCode + ((getDomainPrefix() == null) ? 0 : getDomainPrefix().hashCode()); hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode()); return hashCode; }