Skip to content

Instantly share code, notes, and snippets.

@willh
Last active December 12, 2016 16:03
Show Gist options
  • Save willh/dc55a31467aa6be38497e1de19cf342b to your computer and use it in GitHub Desktop.
Save willh/dc55a31467aa6be38497e1de19cf342b to your computer and use it in GitHub Desktop.
package com.willhamill.lambda.apigateway;
import java.util.Map;
/*
API Gateway Request object defined [mostly] as per AWS documentation:
http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html#api-gateway-simple-proxy-for-lambda-input-format
**WARNING** The AWS docs appear to be somewhat inaccurate in the following way:
- message property does not exist on request
( I suspect a copy/paste error, as this is a response property of the example API in the docs)
- input property contents is the top level object
*/
public class ApiGatewayRequest {
private String resource;
private String path;
private String httpMethod;
private Map<String, String> headers;
private Map<String, String> queryStringParameters;
private Map<String, String> pathParameters;
private Map<String, String> stageVariables;
private RequestContext requestContext;
private String body;
private boolean isBase64Encoded;
public String getResource() {
return resource;
}
public void setResource(String resource) {
this.resource = resource;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getHttpMethod() {
return httpMethod;
}
public void setHttpMethod(String httpMethod) {
this.httpMethod = httpMethod;
}
public Map<String, String> getHeaders() {
return headers;
}
public void setHeaders(Map<String, String> headers) {
this.headers = headers;
}
public Map<String, String> getQueryStringParameters() {
return queryStringParameters;
}
public void setQueryStringParameters(Map<String, String> queryStringParameters) {
this.queryStringParameters = queryStringParameters;
}
public Map<String, String> getPathParameters() {
return pathParameters;
}
public void setPathParameters(Map<String, String> pathParameters) {
this.pathParameters = pathParameters;
}
public Map<String, String> getStageVariables() {
return stageVariables;
}
public void setStageVariables(Map<String, String> stageVariables) {
this.stageVariables = stageVariables;
}
public RequestContext getRequestContext() {
return requestContext;
}
public void setRequestContext(RequestContext requestContext) {
this.requestContext = requestContext;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public boolean isBase64Encoded() {
return isBase64Encoded;
}
public void setBase64Encoded(boolean base64Encoded) {
isBase64Encoded = base64Encoded;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment