All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.apigateway.model.TestInvokeMethodResult Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon API Gateway module holds the client classes that are used for communicating with Amazon API Gateway

There is a newer version: 1.11.78
Show newest version
/*
 * 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 in HTTP method. *

*/ public class TestInvokeMethodResult implements Serializable, Cloneable { /** *

* The HTTP status code. *

*/ private Integer status; /** *

* The body of HTTP response. *

*/ private String body; /** *

* The headers of HTTP response. *

*/ private java.util.Map headers; /** *

* The Amazon API Gateway execution log for the test invoke request. *

*/ private String log; /** *

* The execution latency of the test invoke request. *

*/ private Long latency; /** *

* The HTTP status code. *

* * @param status * The HTTP status code. */ public void setStatus(Integer status) { this.status = status; } /** *

* The HTTP status code. *

* * @return The HTTP status code. */ public Integer getStatus() { return this.status; } /** *

* The HTTP status code. *

* * @param status * The HTTP status code. * @return Returns a reference to this object so that method calls can be * chained together. */ public TestInvokeMethodResult withStatus(Integer status) { setStatus(status); return this; } /** *

* The body of HTTP response. *

* * @param body * The body of HTTP response. */ public void setBody(String body) { this.body = body; } /** *

* The body of HTTP response. *

* * @return The body of HTTP response. */ public String getBody() { return this.body; } /** *

* The body of HTTP response. *

* * @param body * The body of HTTP response. * @return Returns a reference to this object so that method calls can be * chained together. */ public TestInvokeMethodResult withBody(String body) { setBody(body); return this; } /** *

* The headers of HTTP response. *

* * @return The headers of HTTP response. */ public java.util.Map getHeaders() { return headers; } /** *

* The headers of HTTP response. *

* * @param headers * The headers of HTTP response. */ public void setHeaders(java.util.Map headers) { this.headers = headers; } /** *

* The headers of HTTP response. *

* * @param headers * The headers of HTTP response. * @return Returns a reference to this object so that method calls can be * chained together. */ public TestInvokeMethodResult withHeaders( java.util.Map headers) { setHeaders(headers); return this; } public TestInvokeMethodResult addHeadersEntry(String key, String value) { if (null == this.headers) { this.headers = new java.util.HashMap(); } if (this.headers.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.headers.put(key, value); return this; } /** * Removes all the entries added into Headers. <p> Returns a reference to * this object so that method calls can be chained together. */ public TestInvokeMethodResult clearHeadersEntries() { this.headers = null; return this; } /** *

* The Amazon API Gateway execution log for the test invoke request. *

* * @param log * The Amazon API Gateway execution log for the test invoke request. */ public void setLog(String log) { this.log = log; } /** *

* The Amazon API Gateway execution log for the test invoke request. *

* * @return The Amazon API Gateway execution log for the test invoke request. */ public String getLog() { return this.log; } /** *

* The Amazon API Gateway execution log for the test invoke request. *

* * @param log * The Amazon API Gateway execution log for the test invoke request. * @return Returns a reference to this object so that method calls can be * chained together. */ public TestInvokeMethodResult withLog(String log) { setLog(log); return this; } /** *

* The execution latency of the test invoke request. *

* * @param latency * The execution latency of the test invoke request. */ public void setLatency(Long latency) { this.latency = latency; } /** *

* The execution latency of the test invoke request. *

* * @return The execution latency of the test invoke request. */ public Long getLatency() { return this.latency; } /** *

* The execution latency of the test invoke request. *

* * @param latency * The execution latency of the test invoke request. * @return Returns a reference to this object so that method calls can be * chained together. */ public TestInvokeMethodResult withLatency(Long latency) { setLatency(latency); 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 (getStatus() != null) sb.append("Status: " + getStatus() + ","); if (getBody() != null) sb.append("Body: " + getBody() + ","); if (getHeaders() != null) sb.append("Headers: " + getHeaders() + ","); if (getLog() != null) sb.append("Log: " + getLog() + ","); if (getLatency() != null) sb.append("Latency: " + getLatency()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TestInvokeMethodResult == false) return false; TestInvokeMethodResult other = (TestInvokeMethodResult) obj; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getBody() == null ^ this.getBody() == null) return false; if (other.getBody() != null && other.getBody().equals(this.getBody()) == false) return false; if (other.getHeaders() == null ^ this.getHeaders() == null) return false; if (other.getHeaders() != null && other.getHeaders().equals(this.getHeaders()) == 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; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getBody() == null) ? 0 : getBody().hashCode()); hashCode = prime * hashCode + ((getHeaders() == null) ? 0 : getHeaders().hashCode()); hashCode = prime * hashCode + ((getLog() == null) ? 0 : getLog().hashCode()); hashCode = prime * hashCode + ((getLatency() == null) ? 0 : getLatency().hashCode()); return hashCode; } @Override public TestInvokeMethodResult clone() { try { return (TestInvokeMethodResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy