Skip to content

Adding support for OperationName in the APIGatewayProxyRequestEvent #126

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 1 commit into from
May 8, 2020
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
Expand Up @@ -50,6 +50,8 @@ public static class ProxyRequestContext implements Serializable, Cloneable {

private String requestId;

private String operationName;

private RequestIdentity identity;

private String resourcePath;
Expand Down Expand Up @@ -282,6 +284,25 @@ public ProxyRequestContext withPath(String path) {
return this;
}

/**
* @return The name of the operation being performed
* */
public String getOperationName() {
return operationName;
}

/**
* @param operationName The name of the operation being performed
* */
public void setOperationName(String operationName) {
this.operationName = operationName;
}

public ProxyRequestContext withOperationName(String operationName) {
this.setOperationName(operationName);
return this;
}

/**
* Returns a string representation of this object; useful for testing and debugging.
*
Expand Down Expand Up @@ -313,6 +334,8 @@ public String toString() {
sb.append("path: ").append(getPath()).append(",");
if (getAuthorizer() != null)
sb.append("authorizer: ").append(getAuthorizer().toString());
if (getOperationName() != null)
sb.append("operationName: ").append(getOperationName().toString());
sb.append("}");
return sb.toString();
}
Expand Down Expand Up @@ -367,6 +390,10 @@ public boolean equals(Object obj) {
return false;
if (other.getAuthorizer() != null && !other.getAuthorizer().equals(this.getAuthorizer()))
return false;
if (other.getOperationName() == null ^ this.getOperationName() == null)
return false;
if (other.getOperationName() != null && !other.getOperationName().equals(this.getOperationName()))
return false;
return true;
}

Expand All @@ -385,6 +412,7 @@ 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 + ((getOperationName() == null) ? 0: getOperationName().hashCode());
return hashCode;
}

Expand All @@ -396,7 +424,6 @@ public ProxyRequestContext clone() {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
}
}

}

public static class RequestIdentity implements Serializable, Cloneable {
Expand Down Expand Up @@ -958,7 +985,7 @@ public APIGatewayProxyRequestEvent withMultiValueHeaders(Map<String, List<String
this.setMultiValueHeaders(multiValueHeaders);
return this;
}

/**
* @return The query string parameters that were part of the request
*/
Expand Down Expand Up @@ -1135,7 +1162,7 @@ public APIGatewayProxyRequestEvent withIsBase64Encoded(Boolean isBase64Encoded)
this.setIsBase64Encoded(isBase64Encoded);
return this;
}

/**
* Returns a string representation of this object; useful for testing and debugging.
*
Expand Down