
com.amazonaws.services.apigatewayv2.model.UpdateRouteRequest 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;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* Updates a Route.
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UpdateRouteRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The API identifier.
*
*/
private String apiId;
/**
*
* Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
*
*/
private Boolean apiKeyRequired;
/**
*
* The authorization scopes supported by this route.
*
*/
private java.util.List authorizationScopes;
/**
*
* The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for
* using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are NONE for open
* access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda
* authorizer.
*
*/
private String authorizationType;
/**
*
* The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is
* generated by API Gateway when you created the authorizer.
*
*/
private String authorizerId;
/**
*
* The model selection expression for the route. Supported only for WebSocket APIs.
*
*/
private String modelSelectionExpression;
/**
*
* The operation name for the route.
*
*/
private String operationName;
/**
*
* The request models for the route. Supported only for WebSocket APIs.
*
*/
private java.util.Map requestModels;
/**
*
* The request parameters for the route. Supported only for WebSocket APIs.
*
*/
private java.util.Map requestParameters;
/**
*
* The route ID.
*
*/
private String routeId;
/**
*
* The route key for the route.
*
*/
private String routeKey;
/**
*
* The route response selection expression for the route. Supported only for WebSocket APIs.
*
*/
private String routeResponseSelectionExpression;
/**
*
* The target for the route.
*
*/
private String target;
/**
*
* The API identifier.
*
*
* @param apiId
* The API identifier.
*/
public void setApiId(String apiId) {
this.apiId = apiId;
}
/**
*
* The API identifier.
*
*
* @return The API identifier.
*/
public String getApiId() {
return this.apiId;
}
/**
*
* The API identifier.
*
*
* @param apiId
* The API identifier.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withApiId(String apiId) {
setApiId(apiId);
return this;
}
/**
*
* Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
*
*
* @param apiKeyRequired
* Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
*/
public void setApiKeyRequired(Boolean apiKeyRequired) {
this.apiKeyRequired = apiKeyRequired;
}
/**
*
* Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
*
*
* @return Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
*/
public Boolean getApiKeyRequired() {
return this.apiKeyRequired;
}
/**
*
* Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
*
*
* @param apiKeyRequired
* Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withApiKeyRequired(Boolean apiKeyRequired) {
setApiKeyRequired(apiKeyRequired);
return this;
}
/**
*
* Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
*
*
* @return Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
*/
public Boolean isApiKeyRequired() {
return this.apiKeyRequired;
}
/**
*
* The authorization scopes supported by this route.
*
*
* @return The authorization scopes supported by this route.
*/
public java.util.List getAuthorizationScopes() {
return authorizationScopes;
}
/**
*
* The authorization scopes supported by this route.
*
*
* @param authorizationScopes
* The authorization scopes supported by this route.
*/
public void setAuthorizationScopes(java.util.Collection authorizationScopes) {
if (authorizationScopes == null) {
this.authorizationScopes = null;
return;
}
this.authorizationScopes = new java.util.ArrayList(authorizationScopes);
}
/**
*
* The authorization scopes supported by this route.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAuthorizationScopes(java.util.Collection)} or {@link #withAuthorizationScopes(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param authorizationScopes
* The authorization scopes supported by this route.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withAuthorizationScopes(String... authorizationScopes) {
if (this.authorizationScopes == null) {
setAuthorizationScopes(new java.util.ArrayList(authorizationScopes.length));
}
for (String ele : authorizationScopes) {
this.authorizationScopes.add(ele);
}
return this;
}
/**
*
* The authorization scopes supported by this route.
*
*
* @param authorizationScopes
* The authorization scopes supported by this route.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withAuthorizationScopes(java.util.Collection authorizationScopes) {
setAuthorizationScopes(authorizationScopes);
return this;
}
/**
*
* The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for
* using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are NONE for open
* access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda
* authorizer.
*
*
* @param authorizationType
* The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM
* for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are
* NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for
* using a Lambda authorizer.
* @see AuthorizationType
*/
public void setAuthorizationType(String authorizationType) {
this.authorizationType = authorizationType;
}
/**
*
* The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for
* using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are NONE for open
* access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda
* authorizer.
*
*
* @return The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM
* for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are
* NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM
* for using a Lambda authorizer.
* @see AuthorizationType
*/
public String getAuthorizationType() {
return this.authorizationType;
}
/**
*
* The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for
* using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are NONE for open
* access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda
* authorizer.
*
*
* @param authorizationType
* The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM
* for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are
* NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for
* using a Lambda authorizer.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AuthorizationType
*/
public UpdateRouteRequest withAuthorizationType(String authorizationType) {
setAuthorizationType(authorizationType);
return this;
}
/**
*
* The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for
* using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are NONE for open
* access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda
* authorizer.
*
*
* @param authorizationType
* The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM
* for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are
* NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for
* using a Lambda authorizer.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AuthorizationType
*/
public UpdateRouteRequest withAuthorizationType(AuthorizationType authorizationType) {
this.authorizationType = authorizationType.toString();
return this;
}
/**
*
* The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is
* generated by API Gateway when you created the authorizer.
*
*
* @param authorizerId
* The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is
* generated by API Gateway when you created the authorizer.
*/
public void setAuthorizerId(String authorizerId) {
this.authorizerId = authorizerId;
}
/**
*
* The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is
* generated by API Gateway when you created the authorizer.
*
*
* @return The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is
* generated by API Gateway when you created the authorizer.
*/
public String getAuthorizerId() {
return this.authorizerId;
}
/**
*
* The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is
* generated by API Gateway when you created the authorizer.
*
*
* @param authorizerId
* The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is
* generated by API Gateway when you created the authorizer.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withAuthorizerId(String authorizerId) {
setAuthorizerId(authorizerId);
return this;
}
/**
*
* The model selection expression for the route. Supported only for WebSocket APIs.
*
*
* @param modelSelectionExpression
* The model selection expression for the route. Supported only for WebSocket APIs.
*/
public void setModelSelectionExpression(String modelSelectionExpression) {
this.modelSelectionExpression = modelSelectionExpression;
}
/**
*
* The model selection expression for the route. Supported only for WebSocket APIs.
*
*
* @return The model selection expression for the route. Supported only for WebSocket APIs.
*/
public String getModelSelectionExpression() {
return this.modelSelectionExpression;
}
/**
*
* The model selection expression for the route. Supported only for WebSocket APIs.
*
*
* @param modelSelectionExpression
* The model selection expression for the route. Supported only for WebSocket APIs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withModelSelectionExpression(String modelSelectionExpression) {
setModelSelectionExpression(modelSelectionExpression);
return this;
}
/**
*
* The operation name for the route.
*
*
* @param operationName
* The operation name for the route.
*/
public void setOperationName(String operationName) {
this.operationName = operationName;
}
/**
*
* The operation name for the route.
*
*
* @return The operation name for the route.
*/
public String getOperationName() {
return this.operationName;
}
/**
*
* The operation name for the route.
*
*
* @param operationName
* The operation name for the route.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withOperationName(String operationName) {
setOperationName(operationName);
return this;
}
/**
*
* The request models for the route. Supported only for WebSocket APIs.
*
*
* @return The request models for the route. Supported only for WebSocket APIs.
*/
public java.util.Map getRequestModels() {
return requestModels;
}
/**
*
* The request models for the route. Supported only for WebSocket APIs.
*
*
* @param requestModels
* The request models for the route. Supported only for WebSocket APIs.
*/
public void setRequestModels(java.util.Map requestModels) {
this.requestModels = requestModels;
}
/**
*
* The request models for the route. Supported only for WebSocket APIs.
*
*
* @param requestModels
* The request models for the route. Supported only for WebSocket APIs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withRequestModels(java.util.Map requestModels) {
setRequestModels(requestModels);
return this;
}
/**
* Add a single RequestModels entry
*
* @see UpdateRouteRequest#withRequestModels
* @returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest addRequestModelsEntry(String key, String value) {
if (null == this.requestModels) {
this.requestModels = new java.util.HashMap();
}
if (this.requestModels.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.requestModels.put(key, value);
return this;
}
/**
* Removes all the entries added into RequestModels.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest clearRequestModelsEntries() {
this.requestModels = null;
return this;
}
/**
*
* The request parameters for the route. Supported only for WebSocket APIs.
*
*
* @return The request parameters for the route. Supported only for WebSocket APIs.
*/
public java.util.Map getRequestParameters() {
return requestParameters;
}
/**
*
* The request parameters for the route. Supported only for WebSocket APIs.
*
*
* @param requestParameters
* The request parameters for the route. Supported only for WebSocket APIs.
*/
public void setRequestParameters(java.util.Map requestParameters) {
this.requestParameters = requestParameters;
}
/**
*
* The request parameters for the route. Supported only for WebSocket APIs.
*
*
* @param requestParameters
* The request parameters for the route. Supported only for WebSocket APIs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withRequestParameters(java.util.Map requestParameters) {
setRequestParameters(requestParameters);
return this;
}
/**
* Add a single RequestParameters entry
*
* @see UpdateRouteRequest#withRequestParameters
* @returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest addRequestParametersEntry(String key, ParameterConstraints value) {
if (null == this.requestParameters) {
this.requestParameters = new java.util.HashMap();
}
if (this.requestParameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.requestParameters.put(key, value);
return this;
}
/**
* Removes all the entries added into RequestParameters.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest clearRequestParametersEntries() {
this.requestParameters = null;
return this;
}
/**
*
* The route ID.
*
*
* @param routeId
* The route ID.
*/
public void setRouteId(String routeId) {
this.routeId = routeId;
}
/**
*
* The route ID.
*
*
* @return The route ID.
*/
public String getRouteId() {
return this.routeId;
}
/**
*
* The route ID.
*
*
* @param routeId
* The route ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withRouteId(String routeId) {
setRouteId(routeId);
return this;
}
/**
*
* The route key for the route.
*
*
* @param routeKey
* The route key for the route.
*/
public void setRouteKey(String routeKey) {
this.routeKey = routeKey;
}
/**
*
* The route key for the route.
*
*
* @return The route key for the route.
*/
public String getRouteKey() {
return this.routeKey;
}
/**
*
* The route key for the route.
*
*
* @param routeKey
* The route key for the route.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withRouteKey(String routeKey) {
setRouteKey(routeKey);
return this;
}
/**
*
* The route response selection expression for the route. Supported only for WebSocket APIs.
*
*
* @param routeResponseSelectionExpression
* The route response selection expression for the route. Supported only for WebSocket APIs.
*/
public void setRouteResponseSelectionExpression(String routeResponseSelectionExpression) {
this.routeResponseSelectionExpression = routeResponseSelectionExpression;
}
/**
*
* The route response selection expression for the route. Supported only for WebSocket APIs.
*
*
* @return The route response selection expression for the route. Supported only for WebSocket APIs.
*/
public String getRouteResponseSelectionExpression() {
return this.routeResponseSelectionExpression;
}
/**
*
* The route response selection expression for the route. Supported only for WebSocket APIs.
*
*
* @param routeResponseSelectionExpression
* The route response selection expression for the route. Supported only for WebSocket APIs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withRouteResponseSelectionExpression(String routeResponseSelectionExpression) {
setRouteResponseSelectionExpression(routeResponseSelectionExpression);
return this;
}
/**
*
* The target for the route.
*
*
* @param target
* The target for the route.
*/
public void setTarget(String target) {
this.target = target;
}
/**
*
* The target for the route.
*
*
* @return The target for the route.
*/
public String getTarget() {
return this.target;
}
/**
*
* The target for the route.
*
*
* @param target
* The target for the route.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateRouteRequest withTarget(String target) {
setTarget(target);
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 (getApiId() != null)
sb.append("ApiId: ").append(getApiId()).append(",");
if (getApiKeyRequired() != null)
sb.append("ApiKeyRequired: ").append(getApiKeyRequired()).append(",");
if (getAuthorizationScopes() != null)
sb.append("AuthorizationScopes: ").append(getAuthorizationScopes()).append(",");
if (getAuthorizationType() != null)
sb.append("AuthorizationType: ").append(getAuthorizationType()).append(",");
if (getAuthorizerId() != null)
sb.append("AuthorizerId: ").append(getAuthorizerId()).append(",");
if (getModelSelectionExpression() != null)
sb.append("ModelSelectionExpression: ").append(getModelSelectionExpression()).append(",");
if (getOperationName() != null)
sb.append("OperationName: ").append(getOperationName()).append(",");
if (getRequestModels() != null)
sb.append("RequestModels: ").append(getRequestModels()).append(",");
if (getRequestParameters() != null)
sb.append("RequestParameters: ").append(getRequestParameters()).append(",");
if (getRouteId() != null)
sb.append("RouteId: ").append(getRouteId()).append(",");
if (getRouteKey() != null)
sb.append("RouteKey: ").append(getRouteKey()).append(",");
if (getRouteResponseSelectionExpression() != null)
sb.append("RouteResponseSelectionExpression: ").append(getRouteResponseSelectionExpression()).append(",");
if (getTarget() != null)
sb.append("Target: ").append(getTarget());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UpdateRouteRequest == false)
return false;
UpdateRouteRequest other = (UpdateRouteRequest) obj;
if (other.getApiId() == null ^ this.getApiId() == null)
return false;
if (other.getApiId() != null && other.getApiId().equals(this.getApiId()) == false)
return false;
if (other.getApiKeyRequired() == null ^ this.getApiKeyRequired() == null)
return false;
if (other.getApiKeyRequired() != null && other.getApiKeyRequired().equals(this.getApiKeyRequired()) == false)
return false;
if (other.getAuthorizationScopes() == null ^ this.getAuthorizationScopes() == null)
return false;
if (other.getAuthorizationScopes() != null && other.getAuthorizationScopes().equals(this.getAuthorizationScopes()) == false)
return false;
if (other.getAuthorizationType() == null ^ this.getAuthorizationType() == null)
return false;
if (other.getAuthorizationType() != null && other.getAuthorizationType().equals(this.getAuthorizationType()) == false)
return false;
if (other.getAuthorizerId() == null ^ this.getAuthorizerId() == null)
return false;
if (other.getAuthorizerId() != null && other.getAuthorizerId().equals(this.getAuthorizerId()) == false)
return false;
if (other.getModelSelectionExpression() == null ^ this.getModelSelectionExpression() == null)
return false;
if (other.getModelSelectionExpression() != null && other.getModelSelectionExpression().equals(this.getModelSelectionExpression()) == false)
return false;
if (other.getOperationName() == null ^ this.getOperationName() == null)
return false;
if (other.getOperationName() != null && other.getOperationName().equals(this.getOperationName()) == false)
return false;
if (other.getRequestModels() == null ^ this.getRequestModels() == null)
return false;
if (other.getRequestModels() != null && other.getRequestModels().equals(this.getRequestModels()) == false)
return false;
if (other.getRequestParameters() == null ^ this.getRequestParameters() == null)
return false;
if (other.getRequestParameters() != null && other.getRequestParameters().equals(this.getRequestParameters()) == false)
return false;
if (other.getRouteId() == null ^ this.getRouteId() == null)
return false;
if (other.getRouteId() != null && other.getRouteId().equals(this.getRouteId()) == false)
return false;
if (other.getRouteKey() == null ^ this.getRouteKey() == null)
return false;
if (other.getRouteKey() != null && other.getRouteKey().equals(this.getRouteKey()) == false)
return false;
if (other.getRouteResponseSelectionExpression() == null ^ this.getRouteResponseSelectionExpression() == null)
return false;
if (other.getRouteResponseSelectionExpression() != null
&& other.getRouteResponseSelectionExpression().equals(this.getRouteResponseSelectionExpression()) == false)
return false;
if (other.getTarget() == null ^ this.getTarget() == null)
return false;
if (other.getTarget() != null && other.getTarget().equals(this.getTarget()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getApiId() == null) ? 0 : getApiId().hashCode());
hashCode = prime * hashCode + ((getApiKeyRequired() == null) ? 0 : getApiKeyRequired().hashCode());
hashCode = prime * hashCode + ((getAuthorizationScopes() == null) ? 0 : getAuthorizationScopes().hashCode());
hashCode = prime * hashCode + ((getAuthorizationType() == null) ? 0 : getAuthorizationType().hashCode());
hashCode = prime * hashCode + ((getAuthorizerId() == null) ? 0 : getAuthorizerId().hashCode());
hashCode = prime * hashCode + ((getModelSelectionExpression() == null) ? 0 : getModelSelectionExpression().hashCode());
hashCode = prime * hashCode + ((getOperationName() == null) ? 0 : getOperationName().hashCode());
hashCode = prime * hashCode + ((getRequestModels() == null) ? 0 : getRequestModels().hashCode());
hashCode = prime * hashCode + ((getRequestParameters() == null) ? 0 : getRequestParameters().hashCode());
hashCode = prime * hashCode + ((getRouteId() == null) ? 0 : getRouteId().hashCode());
hashCode = prime * hashCode + ((getRouteKey() == null) ? 0 : getRouteKey().hashCode());
hashCode = prime * hashCode + ((getRouteResponseSelectionExpression() == null) ? 0 : getRouteResponseSelectionExpression().hashCode());
hashCode = prime * hashCode + ((getTarget() == null) ? 0 : getTarget().hashCode());
return hashCode;
}
@Override
public UpdateRouteRequest clone() {
return (UpdateRouteRequest) super.clone();
}
}