/* * Copyright 2018-2023 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; import javax.annotation.Generated; /** *

* Represents the response of the test invoke request in the HTTP method. *

*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class TestInvokeMethodResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable { /** *

* The HTTP status code. *

*/ private Integer status; /** *

* The body of the HTTP response. *

*/ private String body; /** *

* The headers of the HTTP response. *

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

* The headers of the HTTP response as a map from string to list of values. *

*/ private java.util.Map> multiValueHeaders; /** *

* The 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 the HTTP response. *

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

* The body of the HTTP response. *

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

* The body of the HTTP response. *

* * @param body * The body of the 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 the HTTP response. *

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

* The headers of the HTTP response. *

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

* The headers of the HTTP response. *

* * @param headers * The headers of the 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; } /** * Add a single Headers entry * * @see TestInvokeMethodResult#withHeaders * @returns a reference to this object so that method calls can be chained together. */ 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. * * @return Returns a reference to this object so that method calls can be chained together. */ public TestInvokeMethodResult clearHeadersEntries() { this.headers = null; return this; } /** *

* The headers of the HTTP response as a map from string to list of values. *

* * @return The headers of the HTTP response as a map from string to list of values. */ public java.util.Map> getMultiValueHeaders() { return multiValueHeaders; } /** *

* The headers of the HTTP response as a map from string to list of values. *

* * @param multiValueHeaders * The headers of the HTTP response as a map from string to list of values. */ public void setMultiValueHeaders(java.util.Map> multiValueHeaders) { this.multiValueHeaders = multiValueHeaders; } /** *

* The headers of the HTTP response as a map from string to list of values. *

* * @param multiValueHeaders * The headers of the HTTP response as a map from string to list of values. * @return Returns a reference to this object so that method calls can be chained together. */ public TestInvokeMethodResult withMultiValueHeaders(java.util.Map> multiValueHeaders) { setMultiValueHeaders(multiValueHeaders); return this; } /** * Add a single MultiValueHeaders entry * * @see TestInvokeMethodResult#withMultiValueHeaders * @returns a reference to this object so that method calls can be chained together. */ public TestInvokeMethodResult addMultiValueHeadersEntry(String key, java.util.List value) { if (null == this.multiValueHeaders) { this.multiValueHeaders = new java.util.HashMap>(); } if (this.multiValueHeaders.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.multiValueHeaders.put(key, value); return this; } /** * Removes all the entries added into MultiValueHeaders. * * @return Returns a reference to this object so that method calls can be chained together. */ public TestInvokeMethodResult clearMultiValueHeadersEntries() { this.multiValueHeaders = null; return this; } /** *

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

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

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

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

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

* * @param log * The 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. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @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: ").append(getStatus()).append(","); if (getBody() != null) sb.append("Body: ").append(getBody()).append(","); if (getHeaders() != null) sb.append("Headers: ").append(getHeaders()).append(","); if (getMultiValueHeaders() != null) sb.append("MultiValueHeaders: ").append(getMultiValueHeaders()).append(","); if (getLog() != null) sb.append("Log: ").append(getLog()).append(","); if (getLatency() != null) sb.append("Latency: ").append(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.getMultiValueHeaders() == null ^ this.getMultiValueHeaders() == null) return false; if (other.getMultiValueHeaders() != null && other.getMultiValueHeaders().equals(this.getMultiValueHeaders()) == 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 + ((getMultiValueHeaders() == null) ? 0 : getMultiValueHeaders().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); } } }