@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAutoScalingGroupName() == null) ? 0 : getAutoScalingGroupName().hashCode()); hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getHonorCooldown() == null) ? 0 : getHonorCooldown().hashCode()); hashCode = prime * hashCode + ((getMetricValue() == null) ? 0 : getMetricValue().hashCode()); hashCode = prime * hashCode + ((getBreachThreshold() == null) ? 0 : getBreachThreshold().hashCode()); return hashCode; }
/** * <p> * The name of the Auto Scaling group. * </p> * * @param autoScalingGroupName * The name of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ public ExecutePolicyRequest withAutoScalingGroupName(String autoScalingGroupName) { setAutoScalingGroupName(autoScalingGroupName); return this; }
/** * <p> * The breach threshold for the alarm. * </p> * <p> * This parameter is required if the policy type is <code>StepScaling</code> and not supported otherwise. * </p> * * @param breachThreshold * The breach threshold for the alarm.</p> * <p> * This parameter is required if the policy type is <code>StepScaling</code> and not supported otherwise. * @return Returns a reference to this object so that method calls can be chained together. */ public ExecutePolicyRequest withBreachThreshold(Double breachThreshold) { setBreachThreshold(breachThreshold); return this; }
/** * <p> * The name or ARN of the policy. * </p> * * @param policyName * The name or ARN of the policy. * @return Returns a reference to this object so that method calls can be chained together. */ public ExecutePolicyRequest withPolicyName(String policyName) { setPolicyName(policyName); return this; }
/** * <p> * Indicates whether Amazon EC2 Auto Scaling waits for the cooldown period to complete before executing the policy. * </p> * <p> * This parameter is not supported if the policy type is <code>StepScaling</code>. * </p> * <p> * For more information, see <a href="http://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html">Scaling * Cooldowns</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>. * </p> * * @param honorCooldown * Indicates whether Amazon EC2 Auto Scaling waits for the cooldown period to complete before executing the * policy.</p> * <p> * This parameter is not supported if the policy type is <code>StepScaling</code>. * </p> * <p> * For more information, see <a * href="http://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html">Scaling Cooldowns</a> in the * <i>Amazon EC2 Auto Scaling User Guide</i>. * @return Returns a reference to this object so that method calls can be chained together. */ public ExecutePolicyRequest withHonorCooldown(Boolean honorCooldown) { setHonorCooldown(honorCooldown); return this; }
setMetricValue(metricValue); return this;
return false; ExecutePolicyRequest other = (ExecutePolicyRequest) obj; if (other.getAutoScalingGroupName() == null ^ this.getAutoScalingGroupName() == null) return false; if (other.getAutoScalingGroupName() != null && other.getAutoScalingGroupName().equals(this.getAutoScalingGroupName()) == false) return false; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getHonorCooldown() == null ^ this.getHonorCooldown() == null) return false; if (other.getHonorCooldown() != null && other.getHonorCooldown().equals(this.getHonorCooldown()) == false) return false; if (other.getMetricValue() == null ^ this.getMetricValue() == null) return false; if (other.getMetricValue() != null && other.getMetricValue().equals(this.getMetricValue()) == false) return false; if (other.getBreachThreshold() == null ^ this.getBreachThreshold() == null) return false; if (other.getBreachThreshold() != null && other.getBreachThreshold().equals(this.getBreachThreshold()) == false) return false; return true;
/** * 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 (getAutoScalingGroupName() != null) sb.append("AutoScalingGroupName: ").append(getAutoScalingGroupName()).append(","); if (getPolicyName() != null) sb.append("PolicyName: ").append(getPolicyName()).append(","); if (getHonorCooldown() != null) sb.append("HonorCooldown: ").append(getHonorCooldown()).append(","); if (getMetricValue() != null) sb.append("MetricValue: ").append(getMetricValue()).append(","); if (getBreachThreshold() != null) sb.append("BreachThreshold: ").append(getBreachThreshold()); sb.append("}"); return sb.toString(); }
public Request<ExecutePolicyRequest> marshall(ExecutePolicyRequest executePolicyRequest) { if (executePolicyRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<ExecutePolicyRequest> request = new DefaultRequest<ExecutePolicyRequest>(executePolicyRequest, "AmazonAutoScaling"); request.addParameter("Action", "ExecutePolicy"); request.addParameter("Version", "2011-01-01"); request.setHttpMethod(HttpMethodName.POST); if (executePolicyRequest.getAutoScalingGroupName() != null) { request.addParameter("AutoScalingGroupName", StringUtils.fromString(executePolicyRequest.getAutoScalingGroupName())); } if (executePolicyRequest.getPolicyName() != null) { request.addParameter("PolicyName", StringUtils.fromString(executePolicyRequest.getPolicyName())); } if (executePolicyRequest.getHonorCooldown() != null) { request.addParameter("HonorCooldown", StringUtils.fromBoolean(executePolicyRequest.getHonorCooldown())); } if (executePolicyRequest.getMetricValue() != null) { request.addParameter("MetricValue", StringUtils.fromDouble(executePolicyRequest.getMetricValue())); } if (executePolicyRequest.getBreachThreshold() != null) { request.addParameter("BreachThreshold", StringUtils.fromDouble(executePolicyRequest.getBreachThreshold())); } return request; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAutoScalingGroupName() == null) ? 0 : getAutoScalingGroupName().hashCode()); hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getHonorCooldown() == null) ? 0 : getHonorCooldown().hashCode()); hashCode = prime * hashCode + ((getMetricValue() == null) ? 0 : getMetricValue().hashCode()); hashCode = prime * hashCode + ((getBreachThreshold() == null) ? 0 : getBreachThreshold().hashCode()); return hashCode; }
ExecutePolicyRequest other = (ExecutePolicyRequest) obj; if (other.getAutoScalingGroupName() == null ^ this.getAutoScalingGroupName() == null) return false; if (other.getAutoScalingGroupName() != null && other.getAutoScalingGroupName().equals(this.getAutoScalingGroupName()) == false) return false; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getHonorCooldown() == null ^ this.getHonorCooldown() == null) return false; if (other.getHonorCooldown() != null && other.getHonorCooldown().equals(this.getHonorCooldown()) == false) return false; if (other.getMetricValue() == null ^ this.getMetricValue() == null) return false; if (other.getMetricValue() != null && other.getMetricValue().equals(this.getMetricValue()) == false) return false; if (other.getBreachThreshold() == null ^ this.getBreachThreshold() == null) return false; if (other.getBreachThreshold() != null && other.getBreachThreshold().equals(this.getBreachThreshold()) == false) return false; return true;
/** * 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 (getAutoScalingGroupName() != null) sb.append("AutoScalingGroupName: " + getAutoScalingGroupName() + ","); if (getPolicyName() != null) sb.append("PolicyName: " + getPolicyName() + ","); if (getHonorCooldown() != null) sb.append("HonorCooldown: " + getHonorCooldown() + ","); if (getMetricValue() != null) sb.append("MetricValue: " + getMetricValue() + ","); if (getBreachThreshold() != null) sb.append("BreachThreshold: " + getBreachThreshold()); sb.append("}"); return sb.toString(); }
if (executePolicyRequest.getAutoScalingGroupName() != null) { prefix = "AutoScalingGroupName"; String autoScalingGroupName = executePolicyRequest.getAutoScalingGroupName(); request.addParameter(prefix, StringUtils.fromString(autoScalingGroupName)); if (executePolicyRequest.getPolicyName() != null) { prefix = "PolicyName"; String policyName = executePolicyRequest.getPolicyName(); request.addParameter(prefix, StringUtils.fromString(policyName)); if (executePolicyRequest.getHonorCooldown() != null) { prefix = "HonorCooldown"; Boolean honorCooldown = executePolicyRequest.getHonorCooldown(); request.addParameter(prefix, StringUtils.fromBoolean(honorCooldown)); if (executePolicyRequest.getMetricValue() != null) { prefix = "MetricValue"; Double metricValue = executePolicyRequest.getMetricValue(); request.addParameter(prefix, StringUtils.fromDouble(metricValue)); if (executePolicyRequest.getBreachThreshold() != null) { prefix = "BreachThreshold"; Double breachThreshold = executePolicyRequest.getBreachThreshold(); request.addParameter(prefix, StringUtils.fromDouble(breachThreshold));