Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Multi-Value Headers and Query String Parameters #61

Merged
merged 1 commit into from
Oct 31, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.amazonaws.services.lambda.runtime.events;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
Expand All @@ -18,8 +19,12 @@ public class APIGatewayProxyRequestEvent implements Serializable, Cloneable {

private Map<String, String> headers;

private Map<String, List<String>> multiValueHeaders;

private Map<String, String> queryStringParameters;

private Map<String, List<String>> multiValueQueryStringParameters;

private Map<String, String> pathParameters;

private Map<String, String> stageVariables;
Expand Down Expand Up @@ -914,6 +919,29 @@ public APIGatewayProxyRequestEvent withHeaders(Map<String, String> headers) {
return this;
}

/**
* @return The multi value headers sent with the request
*/
public Map<String, List<String>> getMultiValueHeaders() {
return multiValueHeaders;
}

/**
* @param multiValueHeaders The multi value headers sent with the request
*/
public void setMultiValueHeaders(Map<String, List<String>> multiValueHeaders) {
this.multiValueHeaders = multiValueHeaders;
}

/**
* @param multiValueHeaders The multi value headers sent with the request
* @return APIGatewayProxyRequestEvent object
*/
public APIGatewayProxyRequestEvent withMultiValueHeaders(Map<String, List<String>> multiValueHeaders) {
this.setMultiValueHeaders(multiValueHeaders);
return this;
}

/**
* @return The query string parameters that were part of the request
*/
Expand All @@ -937,6 +965,29 @@ public APIGatewayProxyRequestEvent withQueryStringParamters(Map<String, String>
return this;
}

/**
* @return The multi value query string parameters that were part of the request
*/
public Map<String, List<String>> getMultiValueQueryStringParameters() {
return multiValueQueryStringParameters;
}

/**
* @param multiValueQueryStringParameters The multi value query string parameters that were part of the request
*/
public void setMultiValueQueryStringParameters(Map<String, List<String>> multiValueQueryStringParameters) {
this.multiValueQueryStringParameters = multiValueQueryStringParameters;
}

/**
* @param multiValueQueryStringParameters The multi value query string parameters that were part of the request
* @return APIGatewayProxyRequestEvent
*/
public APIGatewayProxyRequestEvent withMultiValueQueryStringParameters(Map<String, List<String>> multiValueQueryStringParameters) {
this.setMultiValueQueryStringParameters(multiValueQueryStringParameters);
return this;
}

/**
* @return The path parameters that were part of the request
*/
Expand Down Expand Up @@ -1071,8 +1122,12 @@ public String toString() {
sb.append("httpMethod: ").append(getHttpMethod()).append(",");
if (getHeaders() != null)
sb.append("headers: ").append(getHeaders().toString()).append(",");
if (getMultiValueHeaders() != null)
sb.append("multiValueHeaders: ").append(getMultiValueHeaders().toString()).append(",");
if (getQueryStringParameters() != null)
sb.append("queryStringParameters: ").append(getQueryStringParameters().toString()).append(",");
if (getMultiValueQueryStringParameters() != null)
sb.append("multiValueQueryStringParameters: ").append(getMultiValueQueryStringParameters().toString()).append(",");
if (getPathParameters() != null)
sb.append("pathParameters: ").append(getPathParameters().toString()).append(",");
if (getStageVariables() != null)
Expand Down Expand Up @@ -1113,10 +1168,18 @@ public boolean equals(Object obj) {
return false;
if (other.getHeaders() != null && other.getHeaders().equals(this.getHeaders()) == false)
return false;
if (other.getMultiValueHeaders() == null ^ this.getMultiValueHeaders() == null)
return false;
if (other.getMultiValueHeaders() != null && other.getMultiValueHeaders().equals(this.getMultiValueHeaders()) == false)
return false;
if (other.getQueryStringParameters() == null ^ this.getQueryStringParameters() == null)
return false;
if (other.getQueryStringParameters() != null && other.getQueryStringParameters().equals(this.getQueryStringParameters()) == false)
return false;
if (other.getMultiValueQueryStringParameters() == null ^ this.getMultiValueQueryStringParameters() == null)
return false;
if (other.getMultiValueQueryStringParameters() != null && other.getMultiValueQueryStringParameters().equals(this.getMultiValueQueryStringParameters()) == false)
return false;
if (other.getPathParameters() == null ^ this.getPathParameters() == null)
return false;
if (other.getPathParameters() != null && other.getPathParameters().equals(this.getPathParameters()) == false)
Expand Down Expand Up @@ -1149,7 +1212,9 @@ public int hashCode() {
hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode());
hashCode = prime * hashCode + ((getHttpMethod() == null) ? 0 : getHttpMethod().hashCode());
hashCode = prime * hashCode + ((getHeaders() == null) ? 0 : getHeaders().hashCode());
hashCode = prime * hashCode + ((getMultiValueHeaders() == null) ? 0 : getMultiValueHeaders().hashCode());
hashCode = prime * hashCode + ((getQueryStringParameters() == null) ? 0 : getQueryStringParameters().hashCode());
hashCode = prime * hashCode + ((getMultiValueQueryStringParameters() == null) ? 0 : getMultiValueQueryStringParameters().hashCode());
hashCode = prime * hashCode + ((getPathParameters() == null) ? 0 : getPathParameters().hashCode());
hashCode = prime * hashCode + ((getStageVariables() == null) ? 0 : getStageVariables().hashCode());
hashCode = prime * hashCode + ((getRequestContext() == null) ? 0 : getRequestContext().hashCode());
Expand Down