Skip to content

Issue 227: Added the multiValueHeaders param as described in the deve… #228

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

Merged
merged 5 commits into from
Mar 23, 2021
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 @@ -13,6 +14,8 @@ public class APIGatewayProxyResponseEvent implements Serializable, Cloneable {
private Integer statusCode;

private Map<String, String> headers;

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

private String body;

Expand Down Expand Up @@ -69,6 +72,30 @@ public APIGatewayProxyResponseEvent withHeaders(Map<String, String> headers) {
return this;
}

/**
* @return the Http multi value headers to return in the response
*/
public Map<String, List<String>> getMultiValueHeaders() {
return multiValueHeaders;
}

/**
* @param multiValueHeaders the Http multi value headers to return in the response
*/
public void setMultiValueHeaders(Map<String, List<String>> multiValueHeaders) {
this.multiValueHeaders = multiValueHeaders;
}

/**
*
* @param multiValueHeaders the Http multi value headers to return in the response
* @return APIGatewayProxyResponseEvent
*/
public APIGatewayProxyResponseEvent withMultiValueHeaders(Map<String, List<String>> multiValueHeaders) {
this.setMultiValueHeaders(multiValueHeaders);
return this;
}

/**
* @return The response body
*/
Expand Down Expand Up @@ -130,6 +157,8 @@ public String toString() {
sb.append("statusCode: ").append(getStatusCode()).append(",");
if (getHeaders() != null)
sb.append("headers: ").append(getHeaders().toString()).append(",");
if (getMultiValueHeaders() != null)
sb.append("multiValueHeaders: ").append(getMultiValueHeaders().toString()).append(",");
if (getBody() != null)
sb.append("body: ").append(getBody());
sb.append("}");
Expand All @@ -154,6 +183,10 @@ public boolean equals(Object obj) {
return false;
if (other.getHeaders() != null && other.getHeaders().equals(this.getHeaders()) == false)
return false;
if (other.getMultiValueHeaders() == null ^ this.getMultiValueHeaders() == null)
return false;
if (other.getMultiValueHeaders() != null && other.getMultiValueHeaders().equals(this.getMultiValueHeaders()) == false)
return false;
if (other.getBody() == null ^ this.getBody() == null)
return false;
if (other.getBody() != null && other.getBody().equals(this.getBody()) == false)
Expand All @@ -168,6 +201,7 @@ public int hashCode() {

hashCode = prime * hashCode + ((getStatusCode() == null) ? 0 : getStatusCode().hashCode());
hashCode = prime * hashCode + ((getHeaders() == null) ? 0 : getHeaders().hashCode());
hashCode = prime * hashCode + ((getMultiValueHeaders() == null) ? 0 : getMultiValueHeaders().hashCode());
hashCode = prime * hashCode + ((getBody() == null) ? 0 : getBody().hashCode());
return hashCode;
}
Expand Down