com.amazonaws.services.securityhub.model.AwsApiGatewayCanarySettings Maven / Gradle / Ivy
Show all versions of aws-java-sdk-securityhub Show documentation
/*
* 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.securityhub.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains information about settings for canary deployment in the stage.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AwsApiGatewayCanarySettings implements Serializable, Cloneable, StructuredPojo {
/**
*
* The percentage of traffic that is diverted to a canary deployment.
*
*/
private Double percentTraffic;
/**
*
* The deployment identifier for the canary deployment.
*
*/
private String deploymentId;
/**
*
* Stage variables that are overridden in the canary release deployment. The variables include new stage variables
* that are introduced in the canary.
*
*
* Each variable is represented as a string-to-string map between the stage variable name and the variable value.
*
*/
private java.util.Map stageVariableOverrides;
/**
*
* Indicates whether the canary deployment uses the stage cache.
*
*/
private Boolean useStageCache;
/**
*
* The percentage of traffic that is diverted to a canary deployment.
*
*
* @param percentTraffic
* The percentage of traffic that is diverted to a canary deployment.
*/
public void setPercentTraffic(Double percentTraffic) {
this.percentTraffic = percentTraffic;
}
/**
*
* The percentage of traffic that is diverted to a canary deployment.
*
*
* @return The percentage of traffic that is diverted to a canary deployment.
*/
public Double getPercentTraffic() {
return this.percentTraffic;
}
/**
*
* The percentage of traffic that is diverted to a canary deployment.
*
*
* @param percentTraffic
* The percentage of traffic that is diverted to a canary deployment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiGatewayCanarySettings withPercentTraffic(Double percentTraffic) {
setPercentTraffic(percentTraffic);
return this;
}
/**
*
* The deployment identifier for the canary deployment.
*
*
* @param deploymentId
* The deployment identifier for the canary deployment.
*/
public void setDeploymentId(String deploymentId) {
this.deploymentId = deploymentId;
}
/**
*
* The deployment identifier for the canary deployment.
*
*
* @return The deployment identifier for the canary deployment.
*/
public String getDeploymentId() {
return this.deploymentId;
}
/**
*
* The deployment identifier for the canary deployment.
*
*
* @param deploymentId
* The deployment identifier for the canary deployment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiGatewayCanarySettings withDeploymentId(String deploymentId) {
setDeploymentId(deploymentId);
return this;
}
/**
*
* Stage variables that are overridden in the canary release deployment. The variables include new stage variables
* that are introduced in the canary.
*
*
* Each variable is represented as a string-to-string map between the stage variable name and the variable value.
*
*
* @return Stage variables that are overridden in the canary release deployment. The variables include new stage
* variables that are introduced in the canary.
*
* Each variable is represented as a string-to-string map between the stage variable name and the variable
* value.
*/
public java.util.Map getStageVariableOverrides() {
return stageVariableOverrides;
}
/**
*
* Stage variables that are overridden in the canary release deployment. The variables include new stage variables
* that are introduced in the canary.
*
*
* Each variable is represented as a string-to-string map between the stage variable name and the variable value.
*
*
* @param stageVariableOverrides
* Stage variables that are overridden in the canary release deployment. The variables include new stage
* variables that are introduced in the canary.
*
* Each variable is represented as a string-to-string map between the stage variable name and the variable
* value.
*/
public void setStageVariableOverrides(java.util.Map stageVariableOverrides) {
this.stageVariableOverrides = stageVariableOverrides;
}
/**
*
* Stage variables that are overridden in the canary release deployment. The variables include new stage variables
* that are introduced in the canary.
*
*
* Each variable is represented as a string-to-string map between the stage variable name and the variable value.
*
*
* @param stageVariableOverrides
* Stage variables that are overridden in the canary release deployment. The variables include new stage
* variables that are introduced in the canary.
*
* Each variable is represented as a string-to-string map between the stage variable name and the variable
* value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiGatewayCanarySettings withStageVariableOverrides(java.util.Map stageVariableOverrides) {
setStageVariableOverrides(stageVariableOverrides);
return this;
}
/**
* Add a single StageVariableOverrides entry
*
* @see AwsApiGatewayCanarySettings#withStageVariableOverrides
* @returns a reference to this object so that method calls can be chained together.
*/
public AwsApiGatewayCanarySettings addStageVariableOverridesEntry(String key, String value) {
if (null == this.stageVariableOverrides) {
this.stageVariableOverrides = new java.util.HashMap();
}
if (this.stageVariableOverrides.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.stageVariableOverrides.put(key, value);
return this;
}
/**
* Removes all the entries added into StageVariableOverrides.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiGatewayCanarySettings clearStageVariableOverridesEntries() {
this.stageVariableOverrides = null;
return this;
}
/**
*
* Indicates whether the canary deployment uses the stage cache.
*
*
* @param useStageCache
* Indicates whether the canary deployment uses the stage cache.
*/
public void setUseStageCache(Boolean useStageCache) {
this.useStageCache = useStageCache;
}
/**
*
* Indicates whether the canary deployment uses the stage cache.
*
*
* @return Indicates whether the canary deployment uses the stage cache.
*/
public Boolean getUseStageCache() {
return this.useStageCache;
}
/**
*
* Indicates whether the canary deployment uses the stage cache.
*
*
* @param useStageCache
* Indicates whether the canary deployment uses the stage cache.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsApiGatewayCanarySettings withUseStageCache(Boolean useStageCache) {
setUseStageCache(useStageCache);
return this;
}
/**
*
* Indicates whether the canary deployment uses the stage cache.
*
*
* @return Indicates whether the canary deployment uses the stage cache.
*/
public Boolean isUseStageCache() {
return this.useStageCache;
}
/**
* 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 (getPercentTraffic() != null)
sb.append("PercentTraffic: ").append(getPercentTraffic()).append(",");
if (getDeploymentId() != null)
sb.append("DeploymentId: ").append(getDeploymentId()).append(",");
if (getStageVariableOverrides() != null)
sb.append("StageVariableOverrides: ").append(getStageVariableOverrides()).append(",");
if (getUseStageCache() != null)
sb.append("UseStageCache: ").append(getUseStageCache());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AwsApiGatewayCanarySettings == false)
return false;
AwsApiGatewayCanarySettings other = (AwsApiGatewayCanarySettings) obj;
if (other.getPercentTraffic() == null ^ this.getPercentTraffic() == null)
return false;
if (other.getPercentTraffic() != null && other.getPercentTraffic().equals(this.getPercentTraffic()) == false)
return false;
if (other.getDeploymentId() == null ^ this.getDeploymentId() == null)
return false;
if (other.getDeploymentId() != null && other.getDeploymentId().equals(this.getDeploymentId()) == false)
return false;
if (other.getStageVariableOverrides() == null ^ this.getStageVariableOverrides() == null)
return false;
if (other.getStageVariableOverrides() != null && other.getStageVariableOverrides().equals(this.getStageVariableOverrides()) == false)
return false;
if (other.getUseStageCache() == null ^ this.getUseStageCache() == null)
return false;
if (other.getUseStageCache() != null && other.getUseStageCache().equals(this.getUseStageCache()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPercentTraffic() == null) ? 0 : getPercentTraffic().hashCode());
hashCode = prime * hashCode + ((getDeploymentId() == null) ? 0 : getDeploymentId().hashCode());
hashCode = prime * hashCode + ((getStageVariableOverrides() == null) ? 0 : getStageVariableOverrides().hashCode());
hashCode = prime * hashCode + ((getUseStageCache() == null) ? 0 : getUseStageCache().hashCode());
return hashCode;
}
@Override
public AwsApiGatewayCanarySettings clone() {
try {
return (AwsApiGatewayCanarySettings) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.securityhub.model.transform.AwsApiGatewayCanarySettingsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}