
com.amazonaws.services.apigatewayv2.model.CreateRouteResponseResult Maven / Gradle / Ivy
/*
* Copyright 2015-2020 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.apigatewayv2.model;
import java.io.Serializable;
import javax.annotation.Generated;
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateRouteResponseResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* Represents the model selection expression of a route response. Supported only for WebSocket APIs.
*
*/
private String modelSelectionExpression;
/**
*
* Represents the response models of a route response.
*
*/
private java.util.Map responseModels;
/**
*
* Represents the response parameters of a route response.
*
*/
private java.util.Map responseParameters;
/**
*
* Represents the identifier of a route response.
*
*/
private String routeResponseId;
/**
*
* Represents the route response key of a route response.
*
*/
private String routeResponseKey;
/**
*
* Represents the model selection expression of a route response. Supported only for WebSocket APIs.
*
*
* @param modelSelectionExpression
* Represents the model selection expression of a route response. Supported only for WebSocket APIs.
*/
public void setModelSelectionExpression(String modelSelectionExpression) {
this.modelSelectionExpression = modelSelectionExpression;
}
/**
*
* Represents the model selection expression of a route response. Supported only for WebSocket APIs.
*
*
* @return Represents the model selection expression of a route response. Supported only for WebSocket APIs.
*/
public String getModelSelectionExpression() {
return this.modelSelectionExpression;
}
/**
*
* Represents the model selection expression of a route response. Supported only for WebSocket APIs.
*
*
* @param modelSelectionExpression
* Represents the model selection expression of a route response. Supported only for WebSocket APIs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRouteResponseResult withModelSelectionExpression(String modelSelectionExpression) {
setModelSelectionExpression(modelSelectionExpression);
return this;
}
/**
*
* Represents the response models of a route response.
*
*
* @return Represents the response models of a route response.
*/
public java.util.Map getResponseModels() {
return responseModels;
}
/**
*
* Represents the response models of a route response.
*
*
* @param responseModels
* Represents the response models of a route response.
*/
public void setResponseModels(java.util.Map responseModels) {
this.responseModels = responseModels;
}
/**
*
* Represents the response models of a route response.
*
*
* @param responseModels
* Represents the response models of a route response.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRouteResponseResult withResponseModels(java.util.Map responseModels) {
setResponseModels(responseModels);
return this;
}
/**
* Add a single ResponseModels entry
*
* @see CreateRouteResponseResult#withResponseModels
* @returns a reference to this object so that method calls can be chained together.
*/
public CreateRouteResponseResult addResponseModelsEntry(String key, String value) {
if (null == this.responseModels) {
this.responseModels = new java.util.HashMap();
}
if (this.responseModels.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.responseModels.put(key, value);
return this;
}
/**
* Removes all the entries added into ResponseModels.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRouteResponseResult clearResponseModelsEntries() {
this.responseModels = null;
return this;
}
/**
*
* Represents the response parameters of a route response.
*
*
* @return Represents the response parameters of a route response.
*/
public java.util.Map getResponseParameters() {
return responseParameters;
}
/**
*
* Represents the response parameters of a route response.
*
*
* @param responseParameters
* Represents the response parameters of a route response.
*/
public void setResponseParameters(java.util.Map responseParameters) {
this.responseParameters = responseParameters;
}
/**
*
* Represents the response parameters of a route response.
*
*
* @param responseParameters
* Represents the response parameters of a route response.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRouteResponseResult withResponseParameters(java.util.Map responseParameters) {
setResponseParameters(responseParameters);
return this;
}
/**
* Add a single ResponseParameters entry
*
* @see CreateRouteResponseResult#withResponseParameters
* @returns a reference to this object so that method calls can be chained together.
*/
public CreateRouteResponseResult addResponseParametersEntry(String key, ParameterConstraints value) {
if (null == this.responseParameters) {
this.responseParameters = new java.util.HashMap();
}
if (this.responseParameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.responseParameters.put(key, value);
return this;
}
/**
* Removes all the entries added into ResponseParameters.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRouteResponseResult clearResponseParametersEntries() {
this.responseParameters = null;
return this;
}
/**
*
* Represents the identifier of a route response.
*
*
* @param routeResponseId
* Represents the identifier of a route response.
*/
public void setRouteResponseId(String routeResponseId) {
this.routeResponseId = routeResponseId;
}
/**
*
* Represents the identifier of a route response.
*
*
* @return Represents the identifier of a route response.
*/
public String getRouteResponseId() {
return this.routeResponseId;
}
/**
*
* Represents the identifier of a route response.
*
*
* @param routeResponseId
* Represents the identifier of a route response.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRouteResponseResult withRouteResponseId(String routeResponseId) {
setRouteResponseId(routeResponseId);
return this;
}
/**
*
* Represents the route response key of a route response.
*
*
* @param routeResponseKey
* Represents the route response key of a route response.
*/
public void setRouteResponseKey(String routeResponseKey) {
this.routeResponseKey = routeResponseKey;
}
/**
*
* Represents the route response key of a route response.
*
*
* @return Represents the route response key of a route response.
*/
public String getRouteResponseKey() {
return this.routeResponseKey;
}
/**
*
* Represents the route response key of a route response.
*
*
* @param routeResponseKey
* Represents the route response key of a route response.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRouteResponseResult withRouteResponseKey(String routeResponseKey) {
setRouteResponseKey(routeResponseKey);
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 (getModelSelectionExpression() != null)
sb.append("ModelSelectionExpression: ").append(getModelSelectionExpression()).append(",");
if (getResponseModels() != null)
sb.append("ResponseModels: ").append(getResponseModels()).append(",");
if (getResponseParameters() != null)
sb.append("ResponseParameters: ").append(getResponseParameters()).append(",");
if (getRouteResponseId() != null)
sb.append("RouteResponseId: ").append(getRouteResponseId()).append(",");
if (getRouteResponseKey() != null)
sb.append("RouteResponseKey: ").append(getRouteResponseKey());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateRouteResponseResult == false)
return false;
CreateRouteResponseResult other = (CreateRouteResponseResult) obj;
if (other.getModelSelectionExpression() == null ^ this.getModelSelectionExpression() == null)
return false;
if (other.getModelSelectionExpression() != null && other.getModelSelectionExpression().equals(this.getModelSelectionExpression()) == false)
return false;
if (other.getResponseModels() == null ^ this.getResponseModels() == null)
return false;
if (other.getResponseModels() != null && other.getResponseModels().equals(this.getResponseModels()) == false)
return false;
if (other.getResponseParameters() == null ^ this.getResponseParameters() == null)
return false;
if (other.getResponseParameters() != null && other.getResponseParameters().equals(this.getResponseParameters()) == false)
return false;
if (other.getRouteResponseId() == null ^ this.getRouteResponseId() == null)
return false;
if (other.getRouteResponseId() != null && other.getRouteResponseId().equals(this.getRouteResponseId()) == false)
return false;
if (other.getRouteResponseKey() == null ^ this.getRouteResponseKey() == null)
return false;
if (other.getRouteResponseKey() != null && other.getRouteResponseKey().equals(this.getRouteResponseKey()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getModelSelectionExpression() == null) ? 0 : getModelSelectionExpression().hashCode());
hashCode = prime * hashCode + ((getResponseModels() == null) ? 0 : getResponseModels().hashCode());
hashCode = prime * hashCode + ((getResponseParameters() == null) ? 0 : getResponseParameters().hashCode());
hashCode = prime * hashCode + ((getRouteResponseId() == null) ? 0 : getRouteResponseId().hashCode());
hashCode = prime * hashCode + ((getRouteResponseKey() == null) ? 0 : getRouteResponseKey().hashCode());
return hashCode;
}
@Override
public CreateRouteResponseResult clone() {
try {
return (CreateRouteResponseResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}