/* * 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; /** *
* Information about the instances distribution. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails implements Serializable, Cloneable, StructuredPojo { /** *
* How to allocate instance types to fulfill On-Demand capacity. The valid value is prioritized
.
*
* The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. *
*/ private Integer onDemandBaseCapacity; /** *
* The percentage of On-Demand Instances and Spot Instances for additional capacity beyond
* OnDemandBaseCapacity
.
*
* How to allocate instances across Spot Instance pools. Valid values are as follows: *
*
* lowest-price
*
* capacity-optimized
*
* capacity-optimized-prioritized
*
* The number of Spot Instance pools across which to allocate your Spot Instances. *
*/ private Integer spotInstancePools; /** ** The maximum price per unit hour that you are willing to pay for a Spot Instance. *
*/ private String spotMaxPrice; /** *
* How to allocate instance types to fulfill On-Demand capacity. The valid value is prioritized
.
*
prioritized
.
*/
public void setOnDemandAllocationStrategy(String onDemandAllocationStrategy) {
this.onDemandAllocationStrategy = onDemandAllocationStrategy;
}
/**
*
* How to allocate instance types to fulfill On-Demand capacity. The valid value is prioritized
.
*
prioritized
* .
*/
public String getOnDemandAllocationStrategy() {
return this.onDemandAllocationStrategy;
}
/**
*
* How to allocate instance types to fulfill On-Demand capacity. The valid value is prioritized
.
*
prioritized
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails withOnDemandAllocationStrategy(String onDemandAllocationStrategy) {
setOnDemandAllocationStrategy(onDemandAllocationStrategy);
return this;
}
/**
* * The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. *
* * @param onDemandBaseCapacity * The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. */ public void setOnDemandBaseCapacity(Integer onDemandBaseCapacity) { this.onDemandBaseCapacity = onDemandBaseCapacity; } /** ** The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. *
* * @return The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. */ public Integer getOnDemandBaseCapacity() { return this.onDemandBaseCapacity; } /** ** The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. *
* * @param onDemandBaseCapacity * The minimum amount of the Auto Scaling group's capacity that must be fulfilled by On-Demand Instances. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails withOnDemandBaseCapacity(Integer onDemandBaseCapacity) { setOnDemandBaseCapacity(onDemandBaseCapacity); return this; } /** *
* The percentage of On-Demand Instances and Spot Instances for additional capacity beyond
* OnDemandBaseCapacity
.
*
OnDemandBaseCapacity
.
*/
public void setOnDemandPercentageAboveBaseCapacity(Integer onDemandPercentageAboveBaseCapacity) {
this.onDemandPercentageAboveBaseCapacity = onDemandPercentageAboveBaseCapacity;
}
/**
*
* The percentage of On-Demand Instances and Spot Instances for additional capacity beyond
* OnDemandBaseCapacity
.
*
OnDemandBaseCapacity
.
*/
public Integer getOnDemandPercentageAboveBaseCapacity() {
return this.onDemandPercentageAboveBaseCapacity;
}
/**
*
* The percentage of On-Demand Instances and Spot Instances for additional capacity beyond
* OnDemandBaseCapacity
.
*
OnDemandBaseCapacity
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails withOnDemandPercentageAboveBaseCapacity(
Integer onDemandPercentageAboveBaseCapacity) {
setOnDemandPercentageAboveBaseCapacity(onDemandPercentageAboveBaseCapacity);
return this;
}
/**
* * How to allocate instances across Spot Instance pools. Valid values are as follows: *
*
* lowest-price
*
* capacity-optimized
*
* capacity-optimized-prioritized
*
* lowest-price
*
* capacity-optimized
*
* capacity-optimized-prioritized
*
* How to allocate instances across Spot Instance pools. Valid values are as follows: *
*
* lowest-price
*
* capacity-optimized
*
* capacity-optimized-prioritized
*
* lowest-price
*
* capacity-optimized
*
* capacity-optimized-prioritized
*
* How to allocate instances across Spot Instance pools. Valid values are as follows: *
*
* lowest-price
*
* capacity-optimized
*
* capacity-optimized-prioritized
*
* lowest-price
*
* capacity-optimized
*
* capacity-optimized-prioritized
*
* The number of Spot Instance pools across which to allocate your Spot Instances. *
* * @param spotInstancePools * The number of Spot Instance pools across which to allocate your Spot Instances. */ public void setSpotInstancePools(Integer spotInstancePools) { this.spotInstancePools = spotInstancePools; } /** ** The number of Spot Instance pools across which to allocate your Spot Instances. *
* * @return The number of Spot Instance pools across which to allocate your Spot Instances. */ public Integer getSpotInstancePools() { return this.spotInstancePools; } /** ** The number of Spot Instance pools across which to allocate your Spot Instances. *
* * @param spotInstancePools * The number of Spot Instance pools across which to allocate your Spot Instances. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails withSpotInstancePools(Integer spotInstancePools) { setSpotInstancePools(spotInstancePools); return this; } /** ** The maximum price per unit hour that you are willing to pay for a Spot Instance. *
* * @param spotMaxPrice * The maximum price per unit hour that you are willing to pay for a Spot Instance. */ public void setSpotMaxPrice(String spotMaxPrice) { this.spotMaxPrice = spotMaxPrice; } /** ** The maximum price per unit hour that you are willing to pay for a Spot Instance. *
* * @return The maximum price per unit hour that you are willing to pay for a Spot Instance. */ public String getSpotMaxPrice() { return this.spotMaxPrice; } /** ** The maximum price per unit hour that you are willing to pay for a Spot Instance. *
* * @param spotMaxPrice * The maximum price per unit hour that you are willing to pay for a Spot Instance. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails withSpotMaxPrice(String spotMaxPrice) { setSpotMaxPrice(spotMaxPrice); 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 (getOnDemandAllocationStrategy() != null) sb.append("OnDemandAllocationStrategy: ").append(getOnDemandAllocationStrategy()).append(","); if (getOnDemandBaseCapacity() != null) sb.append("OnDemandBaseCapacity: ").append(getOnDemandBaseCapacity()).append(","); if (getOnDemandPercentageAboveBaseCapacity() != null) sb.append("OnDemandPercentageAboveBaseCapacity: ").append(getOnDemandPercentageAboveBaseCapacity()).append(","); if (getSpotAllocationStrategy() != null) sb.append("SpotAllocationStrategy: ").append(getSpotAllocationStrategy()).append(","); if (getSpotInstancePools() != null) sb.append("SpotInstancePools: ").append(getSpotInstancePools()).append(","); if (getSpotMaxPrice() != null) sb.append("SpotMaxPrice: ").append(getSpotMaxPrice()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails == false) return false; AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails other = (AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails) obj; if (other.getOnDemandAllocationStrategy() == null ^ this.getOnDemandAllocationStrategy() == null) return false; if (other.getOnDemandAllocationStrategy() != null && other.getOnDemandAllocationStrategy().equals(this.getOnDemandAllocationStrategy()) == false) return false; if (other.getOnDemandBaseCapacity() == null ^ this.getOnDemandBaseCapacity() == null) return false; if (other.getOnDemandBaseCapacity() != null && other.getOnDemandBaseCapacity().equals(this.getOnDemandBaseCapacity()) == false) return false; if (other.getOnDemandPercentageAboveBaseCapacity() == null ^ this.getOnDemandPercentageAboveBaseCapacity() == null) return false; if (other.getOnDemandPercentageAboveBaseCapacity() != null && other.getOnDemandPercentageAboveBaseCapacity().equals(this.getOnDemandPercentageAboveBaseCapacity()) == false) return false; if (other.getSpotAllocationStrategy() == null ^ this.getSpotAllocationStrategy() == null) return false; if (other.getSpotAllocationStrategy() != null && other.getSpotAllocationStrategy().equals(this.getSpotAllocationStrategy()) == false) return false; if (other.getSpotInstancePools() == null ^ this.getSpotInstancePools() == null) return false; if (other.getSpotInstancePools() != null && other.getSpotInstancePools().equals(this.getSpotInstancePools()) == false) return false; if (other.getSpotMaxPrice() == null ^ this.getSpotMaxPrice() == null) return false; if (other.getSpotMaxPrice() != null && other.getSpotMaxPrice().equals(this.getSpotMaxPrice()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getOnDemandAllocationStrategy() == null) ? 0 : getOnDemandAllocationStrategy().hashCode()); hashCode = prime * hashCode + ((getOnDemandBaseCapacity() == null) ? 0 : getOnDemandBaseCapacity().hashCode()); hashCode = prime * hashCode + ((getOnDemandPercentageAboveBaseCapacity() == null) ? 0 : getOnDemandPercentageAboveBaseCapacity().hashCode()); hashCode = prime * hashCode + ((getSpotAllocationStrategy() == null) ? 0 : getSpotAllocationStrategy().hashCode()); hashCode = prime * hashCode + ((getSpotInstancePools() == null) ? 0 : getSpotInstancePools().hashCode()); hashCode = prime * hashCode + ((getSpotMaxPrice() == null) ? 0 : getSpotMaxPrice().hashCode()); return hashCode; } @Override public AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails clone() { try { return (AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetails) 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.AwsAutoScalingAutoScalingGroupMixedInstancesPolicyInstancesDistributionDetailsMarshaller .getInstance().marshall(this, protocolMarshaller); } }