Skip to content

Commit 8dc5ba8

Browse files
msailescarlzogh
andauthored
Add API Gateway multiValueHeaders field (#228)
https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html Co-authored-by: Carl Zogheib <[email protected]>
1 parent b1b43e6 commit 8dc5ba8

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/APIGatewayProxyResponseEvent.java

+34
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.amazonaws.services.lambda.runtime.events;
22

33
import java.io.Serializable;
4+
import java.util.List;
45
import java.util.Map;
56

67
/**
@@ -13,6 +14,8 @@ public class APIGatewayProxyResponseEvent implements Serializable, Cloneable {
1314
private Integer statusCode;
1415

1516
private Map<String, String> headers;
17+
18+
private Map<String, List<String>> multiValueHeaders;
1619

1720
private String body;
1821

@@ -69,6 +72,30 @@ public APIGatewayProxyResponseEvent withHeaders(Map<String, String> headers) {
6972
return this;
7073
}
7174

75+
/**
76+
* @return the Http multi value headers to return in the response
77+
*/
78+
public Map<String, List<String>> getMultiValueHeaders() {
79+
return multiValueHeaders;
80+
}
81+
82+
/**
83+
* @param multiValueHeaders the Http multi value headers to return in the response
84+
*/
85+
public void setMultiValueHeaders(Map<String, List<String>> multiValueHeaders) {
86+
this.multiValueHeaders = multiValueHeaders;
87+
}
88+
89+
/**
90+
*
91+
* @param multiValueHeaders the Http multi value headers to return in the response
92+
* @return APIGatewayProxyResponseEvent
93+
*/
94+
public APIGatewayProxyResponseEvent withMultiValueHeaders(Map<String, List<String>> multiValueHeaders) {
95+
this.setMultiValueHeaders(multiValueHeaders);
96+
return this;
97+
}
98+
7299
/**
73100
* @return The response body
74101
*/
@@ -130,6 +157,8 @@ public String toString() {
130157
sb.append("statusCode: ").append(getStatusCode()).append(",");
131158
if (getHeaders() != null)
132159
sb.append("headers: ").append(getHeaders().toString()).append(",");
160+
if (getMultiValueHeaders() != null)
161+
sb.append("multiValueHeaders: ").append(getMultiValueHeaders().toString()).append(",");
133162
if (getBody() != null)
134163
sb.append("body: ").append(getBody());
135164
sb.append("}");
@@ -154,6 +183,10 @@ public boolean equals(Object obj) {
154183
return false;
155184
if (other.getHeaders() != null && other.getHeaders().equals(this.getHeaders()) == false)
156185
return false;
186+
if (other.getMultiValueHeaders() == null ^ this.getMultiValueHeaders() == null)
187+
return false;
188+
if (other.getMultiValueHeaders() != null && other.getMultiValueHeaders().equals(this.getMultiValueHeaders()) == false)
189+
return false;
157190
if (other.getBody() == null ^ this.getBody() == null)
158191
return false;
159192
if (other.getBody() != null && other.getBody().equals(this.getBody()) == false)
@@ -168,6 +201,7 @@ public int hashCode() {
168201

169202
hashCode = prime * hashCode + ((getStatusCode() == null) ? 0 : getStatusCode().hashCode());
170203
hashCode = prime * hashCode + ((getHeaders() == null) ? 0 : getHeaders().hashCode());
204+
hashCode = prime * hashCode + ((getMultiValueHeaders() == null) ? 0 : getMultiValueHeaders().hashCode());
171205
hashCode = prime * hashCode + ((getBody() == null) ? 0 : getBody().hashCode());
172206
return hashCode;
173207
}

0 commit comments

Comments
 (0)