
com.amazonaws.services.apigateway.model.TestInvokeAuthorizerResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-api-gateway Show documentation
/*
* Copyright 2011-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.apigateway.model;
import java.io.Serializable;
/**
*
* Represents the response of the test invoke request for a custom Authorizer
*
*/
public class TestInvokeAuthorizerResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The HTTP status code that the client would have received. Value is 0 if the authorizer succeeded.
*
*/
private Integer clientStatus;
/**
*
* The Amazon API Gateway execution log for the test authorizer request.
*
*/
private String log;
/**
*
* The execution latency of the test authorizer request.
*
*/
private Long latency;
/**
*
* The principal identity returned by the Authorizer
*
*/
private String principalId;
/**
*
* The JSON policy document returned by the Authorizer
*
*/
private String policy;
private java.util.Map> authorization;
/**
*
* The open identity claims, with
* any supported custom attributes, returned from the Cognito Your User Pool configured for the API.
*
*/
private java.util.Map claims;
/**
*
* The HTTP status code that the client would have received. Value is 0 if the authorizer succeeded.
*
*
* @param clientStatus
* The HTTP status code that the client would have received. Value is 0 if the authorizer succeeded.
*/
public void setClientStatus(Integer clientStatus) {
this.clientStatus = clientStatus;
}
/**
*
* The HTTP status code that the client would have received. Value is 0 if the authorizer succeeded.
*
*
* @return The HTTP status code that the client would have received. Value is 0 if the authorizer succeeded.
*/
public Integer getClientStatus() {
return this.clientStatus;
}
/**
*
* The HTTP status code that the client would have received. Value is 0 if the authorizer succeeded.
*
*
* @param clientStatus
* The HTTP status code that the client would have received. Value is 0 if the authorizer succeeded.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TestInvokeAuthorizerResult withClientStatus(Integer clientStatus) {
setClientStatus(clientStatus);
return this;
}
/**
*
* The Amazon API Gateway execution log for the test authorizer request.
*
*
* @param log
* The Amazon API Gateway execution log for the test authorizer request.
*/
public void setLog(String log) {
this.log = log;
}
/**
*
* The Amazon API Gateway execution log for the test authorizer request.
*
*
* @return The Amazon API Gateway execution log for the test authorizer request.
*/
public String getLog() {
return this.log;
}
/**
*
* The Amazon API Gateway execution log for the test authorizer request.
*
*
* @param log
* The Amazon API Gateway execution log for the test authorizer request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TestInvokeAuthorizerResult withLog(String log) {
setLog(log);
return this;
}
/**
*
* The execution latency of the test authorizer request.
*
*
* @param latency
* The execution latency of the test authorizer request.
*/
public void setLatency(Long latency) {
this.latency = latency;
}
/**
*
* The execution latency of the test authorizer request.
*
*
* @return The execution latency of the test authorizer request.
*/
public Long getLatency() {
return this.latency;
}
/**
*
* The execution latency of the test authorizer request.
*
*
* @param latency
* The execution latency of the test authorizer request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TestInvokeAuthorizerResult withLatency(Long latency) {
setLatency(latency);
return this;
}
/**
*
* The principal identity returned by the Authorizer
*
*
* @param principalId
* The principal identity returned by the Authorizer
*/
public void setPrincipalId(String principalId) {
this.principalId = principalId;
}
/**
*
* The principal identity returned by the Authorizer
*
*
* @return The principal identity returned by the Authorizer
*/
public String getPrincipalId() {
return this.principalId;
}
/**
*
* The principal identity returned by the Authorizer
*
*
* @param principalId
* The principal identity returned by the Authorizer
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TestInvokeAuthorizerResult withPrincipalId(String principalId) {
setPrincipalId(principalId);
return this;
}
/**
*
* The JSON policy document returned by the Authorizer
*
*
* @param policy
* The JSON policy document returned by the Authorizer
*/
public void setPolicy(String policy) {
this.policy = policy;
}
/**
*
* The JSON policy document returned by the Authorizer
*
*
* @return The JSON policy document returned by the Authorizer
*/
public String getPolicy() {
return this.policy;
}
/**
*
* The JSON policy document returned by the Authorizer
*
*
* @param policy
* The JSON policy document returned by the Authorizer
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TestInvokeAuthorizerResult withPolicy(String policy) {
setPolicy(policy);
return this;
}
/**
* @return
*/
public java.util.Map> getAuthorization() {
return authorization;
}
/**
* @param authorization
*/
public void setAuthorization(java.util.Map> authorization) {
this.authorization = authorization;
}
/**
* @param authorization
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TestInvokeAuthorizerResult withAuthorization(java.util.Map> authorization) {
setAuthorization(authorization);
return this;
}
public TestInvokeAuthorizerResult addAuthorizationEntry(String key, java.util.List value) {
if (null == this.authorization) {
this.authorization = new java.util.HashMap>();
}
if (this.authorization.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.authorization.put(key, value);
return this;
}
/**
* Removes all the entries added into Authorization. <p> Returns a reference to this object so that method calls
* can be chained together.
*/
public TestInvokeAuthorizerResult clearAuthorizationEntries() {
this.authorization = null;
return this;
}
/**
*
* The open identity claims, with
* any supported custom attributes, returned from the Cognito Your User Pool configured for the API.
*
*
* @return The open identity
* claims, with any supported custom attributes, returned from the Cognito Your User Pool configured for
* the API.
*/
public java.util.Map getClaims() {
return claims;
}
/**
*
* The open identity claims, with
* any supported custom attributes, returned from the Cognito Your User Pool configured for the API.
*
*
* @param claims
* The open identity
* claims, with any supported custom attributes, returned from the Cognito Your User Pool configured for
* the API.
*/
public void setClaims(java.util.Map claims) {
this.claims = claims;
}
/**
*
* The open identity claims, with
* any supported custom attributes, returned from the Cognito Your User Pool configured for the API.
*
*
* @param claims
* The open identity
* claims, with any supported custom attributes, returned from the Cognito Your User Pool configured for
* the API.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TestInvokeAuthorizerResult withClaims(java.util.Map claims) {
setClaims(claims);
return this;
}
public TestInvokeAuthorizerResult addClaimsEntry(String key, String value) {
if (null == this.claims) {
this.claims = new java.util.HashMap();
}
if (this.claims.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.claims.put(key, value);
return this;
}
/**
* Removes all the entries added into Claims. <p> Returns a reference to this object so that method calls can be
* chained together.
*/
public TestInvokeAuthorizerResult clearClaimsEntries() {
this.claims = null;
return this;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getClientStatus() != null)
sb.append("ClientStatus: " + getClientStatus() + ",");
if (getLog() != null)
sb.append("Log: " + getLog() + ",");
if (getLatency() != null)
sb.append("Latency: " + getLatency() + ",");
if (getPrincipalId() != null)
sb.append("PrincipalId: " + getPrincipalId() + ",");
if (getPolicy() != null)
sb.append("Policy: " + getPolicy() + ",");
if (getAuthorization() != null)
sb.append("Authorization: " + getAuthorization() + ",");
if (getClaims() != null)
sb.append("Claims: " + getClaims());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TestInvokeAuthorizerResult == false)
return false;
TestInvokeAuthorizerResult other = (TestInvokeAuthorizerResult) obj;
if (other.getClientStatus() == null ^ this.getClientStatus() == null)
return false;
if (other.getClientStatus() != null && other.getClientStatus().equals(this.getClientStatus()) == false)
return false;
if (other.getLog() == null ^ this.getLog() == null)
return false;
if (other.getLog() != null && other.getLog().equals(this.getLog()) == false)
return false;
if (other.getLatency() == null ^ this.getLatency() == null)
return false;
if (other.getLatency() != null && other.getLatency().equals(this.getLatency()) == false)
return false;
if (other.getPrincipalId() == null ^ this.getPrincipalId() == null)
return false;
if (other.getPrincipalId() != null && other.getPrincipalId().equals(this.getPrincipalId()) == false)
return false;
if (other.getPolicy() == null ^ this.getPolicy() == null)
return false;
if (other.getPolicy() != null && other.getPolicy().equals(this.getPolicy()) == false)
return false;
if (other.getAuthorization() == null ^ this.getAuthorization() == null)
return false;
if (other.getAuthorization() != null && other.getAuthorization().equals(this.getAuthorization()) == false)
return false;
if (other.getClaims() == null ^ this.getClaims() == null)
return false;
if (other.getClaims() != null && other.getClaims().equals(this.getClaims()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getClientStatus() == null) ? 0 : getClientStatus().hashCode());
hashCode = prime * hashCode + ((getLog() == null) ? 0 : getLog().hashCode());
hashCode = prime * hashCode + ((getLatency() == null) ? 0 : getLatency().hashCode());
hashCode = prime * hashCode + ((getPrincipalId() == null) ? 0 : getPrincipalId().hashCode());
hashCode = prime * hashCode + ((getPolicy() == null) ? 0 : getPolicy().hashCode());
hashCode = prime * hashCode + ((getAuthorization() == null) ? 0 : getAuthorization().hashCode());
hashCode = prime * hashCode + ((getClaims() == null) ? 0 : getClaims().hashCode());
return hashCode;
}
@Override
public TestInvokeAuthorizerResult clone() {
try {
return (TestInvokeAuthorizerResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}