/* * 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; /** *
* Provides details about an auto scaling group. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AwsAutoScalingAutoScalingGroupDetails implements Serializable, Cloneable, StructuredPojo { /** ** The name of the launch configuration. *
*/ private String launchConfigurationName; /** ** The list of load balancers associated with the group. *
*/ private java.util.List
* The service to use for the health checks. Valid values are EC2
or ELB
.
*
* The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before it checks the health status of an EC2 * instance that has come into service. *
*/ private Integer healthCheckGracePeriod; /** ** Indicates when the auto scaling group was created. *
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces, and date and time should be
* separated by T
. For example, 2020-03-22T13:22:13.933Z
.
*
* The mixed instances policy for the automatic scaling group. *
*/ private AwsAutoScalingAutoScalingGroupMixedInstancesPolicyDetails mixedInstancesPolicy; /** ** The list of Availability Zones for the automatic scaling group. *
*/ private java.util.List* The launch template to use. *
*/ private AwsAutoScalingAutoScalingGroupLaunchTemplateLaunchTemplateSpecification launchTemplate; /** ** Indicates whether capacity rebalancing is enabled. *
*/ private Boolean capacityRebalance; /** ** The name of the launch configuration. *
* * @param launchConfigurationName * The name of the launch configuration. */ public void setLaunchConfigurationName(String launchConfigurationName) { this.launchConfigurationName = launchConfigurationName; } /** ** The name of the launch configuration. *
* * @return The name of the launch configuration. */ public String getLaunchConfigurationName() { return this.launchConfigurationName; } /** ** The name of the launch configuration. *
* * @param launchConfigurationName * The name of the launch configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsAutoScalingAutoScalingGroupDetails withLaunchConfigurationName(String launchConfigurationName) { setLaunchConfigurationName(launchConfigurationName); return this; } /** ** The list of load balancers associated with the group. *
* * @return The list of load balancers associated with the group. */ public java.util.List* The list of load balancers associated with the group. *
* * @param loadBalancerNames * The list of load balancers associated with the group. */ public void setLoadBalancerNames(java.util.Collection* The list of load balancers associated with the group. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setLoadBalancerNames(java.util.Collection)} or {@link #withLoadBalancerNames(java.util.Collection)} if * you want to override the existing values. *
* * @param loadBalancerNames * The list of load balancers associated with the group. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsAutoScalingAutoScalingGroupDetails withLoadBalancerNames(String... loadBalancerNames) { if (this.loadBalancerNames == null) { setLoadBalancerNames(new java.util.ArrayList* The list of load balancers associated with the group. *
* * @param loadBalancerNames * The list of load balancers associated with the group. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsAutoScalingAutoScalingGroupDetails withLoadBalancerNames(java.util.Collection
* The service to use for the health checks. Valid values are EC2
or ELB
.
*
EC2
or ELB
.
*/
public void setHealthCheckType(String healthCheckType) {
this.healthCheckType = healthCheckType;
}
/**
*
* The service to use for the health checks. Valid values are EC2
or ELB
.
*
EC2
or ELB
.
*/
public String getHealthCheckType() {
return this.healthCheckType;
}
/**
*
* The service to use for the health checks. Valid values are EC2
or ELB
.
*
EC2
or ELB
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsAutoScalingAutoScalingGroupDetails withHealthCheckType(String healthCheckType) {
setHealthCheckType(healthCheckType);
return this;
}
/**
* * The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before it checks the health status of an EC2 * instance that has come into service. *
* * @param healthCheckGracePeriod * The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before it checks the health status of * an EC2 instance that has come into service. */ public void setHealthCheckGracePeriod(Integer healthCheckGracePeriod) { this.healthCheckGracePeriod = healthCheckGracePeriod; } /** ** The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before it checks the health status of an EC2 * instance that has come into service. *
* * @return The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before it checks the health status of * an EC2 instance that has come into service. */ public Integer getHealthCheckGracePeriod() { return this.healthCheckGracePeriod; } /** ** The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before it checks the health status of an EC2 * instance that has come into service. *
* * @param healthCheckGracePeriod * The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before it checks the health status of * an EC2 instance that has come into service. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsAutoScalingAutoScalingGroupDetails withHealthCheckGracePeriod(Integer healthCheckGracePeriod) { setHealthCheckGracePeriod(healthCheckGracePeriod); return this; } /** ** Indicates when the auto scaling group was created. *
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces, and date and time should be
* separated by T
. For example, 2020-03-22T13:22:13.933Z
.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces, and date and time should be separated by T
. For
* example, 2020-03-22T13:22:13.933Z
.
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
*
* Indicates when the auto scaling group was created. *
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces, and date and time should be
* separated by T
. For example, 2020-03-22T13:22:13.933Z
.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces, and date and time should be separated by T
. For
* example, 2020-03-22T13:22:13.933Z
.
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
*
* Indicates when the auto scaling group was created. *
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces, and date and time should be
* separated by T
. For example, 2020-03-22T13:22:13.933Z
.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces, and date and time should be separated by T
. For
* example, 2020-03-22T13:22:13.933Z
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsAutoScalingAutoScalingGroupDetails withCreatedTime(String createdTime) {
setCreatedTime(createdTime);
return this;
}
/**
*
* The mixed instances policy for the automatic scaling group. *
* * @param mixedInstancesPolicy * The mixed instances policy for the automatic scaling group. */ public void setMixedInstancesPolicy(AwsAutoScalingAutoScalingGroupMixedInstancesPolicyDetails mixedInstancesPolicy) { this.mixedInstancesPolicy = mixedInstancesPolicy; } /** ** The mixed instances policy for the automatic scaling group. *
* * @return The mixed instances policy for the automatic scaling group. */ public AwsAutoScalingAutoScalingGroupMixedInstancesPolicyDetails getMixedInstancesPolicy() { return this.mixedInstancesPolicy; } /** ** The mixed instances policy for the automatic scaling group. *
* * @param mixedInstancesPolicy * The mixed instances policy for the automatic scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsAutoScalingAutoScalingGroupDetails withMixedInstancesPolicy(AwsAutoScalingAutoScalingGroupMixedInstancesPolicyDetails mixedInstancesPolicy) { setMixedInstancesPolicy(mixedInstancesPolicy); return this; } /** ** The list of Availability Zones for the automatic scaling group. *
* * @return The list of Availability Zones for the automatic scaling group. */ public java.util.List* The list of Availability Zones for the automatic scaling group. *
* * @param availabilityZones * The list of Availability Zones for the automatic scaling group. */ public void setAvailabilityZones(java.util.Collection* The list of Availability Zones for the automatic scaling group. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setAvailabilityZones(java.util.Collection)} or {@link #withAvailabilityZones(java.util.Collection)} if * you want to override the existing values. *
* * @param availabilityZones * The list of Availability Zones for the automatic scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsAutoScalingAutoScalingGroupDetails withAvailabilityZones(AwsAutoScalingAutoScalingGroupAvailabilityZonesListDetails... availabilityZones) { if (this.availabilityZones == null) { setAvailabilityZones(new java.util.ArrayList* The list of Availability Zones for the automatic scaling group. *
* * @param availabilityZones * The list of Availability Zones for the automatic scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsAutoScalingAutoScalingGroupDetails withAvailabilityZones( java.util.Collection* The launch template to use. *
* * @param launchTemplate * The launch template to use. */ public void setLaunchTemplate(AwsAutoScalingAutoScalingGroupLaunchTemplateLaunchTemplateSpecification launchTemplate) { this.launchTemplate = launchTemplate; } /** ** The launch template to use. *
* * @return The launch template to use. */ public AwsAutoScalingAutoScalingGroupLaunchTemplateLaunchTemplateSpecification getLaunchTemplate() { return this.launchTemplate; } /** ** The launch template to use. *
* * @param launchTemplate * The launch template to use. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsAutoScalingAutoScalingGroupDetails withLaunchTemplate(AwsAutoScalingAutoScalingGroupLaunchTemplateLaunchTemplateSpecification launchTemplate) { setLaunchTemplate(launchTemplate); return this; } /** ** Indicates whether capacity rebalancing is enabled. *
* * @param capacityRebalance * Indicates whether capacity rebalancing is enabled. */ public void setCapacityRebalance(Boolean capacityRebalance) { this.capacityRebalance = capacityRebalance; } /** ** Indicates whether capacity rebalancing is enabled. *
* * @return Indicates whether capacity rebalancing is enabled. */ public Boolean getCapacityRebalance() { return this.capacityRebalance; } /** ** Indicates whether capacity rebalancing is enabled. *
* * @param capacityRebalance * Indicates whether capacity rebalancing is enabled. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsAutoScalingAutoScalingGroupDetails withCapacityRebalance(Boolean capacityRebalance) { setCapacityRebalance(capacityRebalance); return this; } /** ** Indicates whether capacity rebalancing is enabled. *
* * @return Indicates whether capacity rebalancing is enabled. */ public Boolean isCapacityRebalance() { return this.capacityRebalance; } /** * 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 (getLaunchConfigurationName() != null) sb.append("LaunchConfigurationName: ").append(getLaunchConfigurationName()).append(","); if (getLoadBalancerNames() != null) sb.append("LoadBalancerNames: ").append(getLoadBalancerNames()).append(","); if (getHealthCheckType() != null) sb.append("HealthCheckType: ").append(getHealthCheckType()).append(","); if (getHealthCheckGracePeriod() != null) sb.append("HealthCheckGracePeriod: ").append(getHealthCheckGracePeriod()).append(","); if (getCreatedTime() != null) sb.append("CreatedTime: ").append(getCreatedTime()).append(","); if (getMixedInstancesPolicy() != null) sb.append("MixedInstancesPolicy: ").append(getMixedInstancesPolicy()).append(","); if (getAvailabilityZones() != null) sb.append("AvailabilityZones: ").append(getAvailabilityZones()).append(","); if (getLaunchTemplate() != null) sb.append("LaunchTemplate: ").append(getLaunchTemplate()).append(","); if (getCapacityRebalance() != null) sb.append("CapacityRebalance: ").append(getCapacityRebalance()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AwsAutoScalingAutoScalingGroupDetails == false) return false; AwsAutoScalingAutoScalingGroupDetails other = (AwsAutoScalingAutoScalingGroupDetails) obj; if (other.getLaunchConfigurationName() == null ^ this.getLaunchConfigurationName() == null) return false; if (other.getLaunchConfigurationName() != null && other.getLaunchConfigurationName().equals(this.getLaunchConfigurationName()) == false) return false; if (other.getLoadBalancerNames() == null ^ this.getLoadBalancerNames() == null) return false; if (other.getLoadBalancerNames() != null && other.getLoadBalancerNames().equals(this.getLoadBalancerNames()) == false) return false; if (other.getHealthCheckType() == null ^ this.getHealthCheckType() == null) return false; if (other.getHealthCheckType() != null && other.getHealthCheckType().equals(this.getHealthCheckType()) == false) return false; if (other.getHealthCheckGracePeriod() == null ^ this.getHealthCheckGracePeriod() == null) return false; if (other.getHealthCheckGracePeriod() != null && other.getHealthCheckGracePeriod().equals(this.getHealthCheckGracePeriod()) == false) return false; if (other.getCreatedTime() == null ^ this.getCreatedTime() == null) return false; if (other.getCreatedTime() != null && other.getCreatedTime().equals(this.getCreatedTime()) == false) return false; if (other.getMixedInstancesPolicy() == null ^ this.getMixedInstancesPolicy() == null) return false; if (other.getMixedInstancesPolicy() != null && other.getMixedInstancesPolicy().equals(this.getMixedInstancesPolicy()) == false) return false; if (other.getAvailabilityZones() == null ^ this.getAvailabilityZones() == null) return false; if (other.getAvailabilityZones() != null && other.getAvailabilityZones().equals(this.getAvailabilityZones()) == false) return false; if (other.getLaunchTemplate() == null ^ this.getLaunchTemplate() == null) return false; if (other.getLaunchTemplate() != null && other.getLaunchTemplate().equals(this.getLaunchTemplate()) == false) return false; if (other.getCapacityRebalance() == null ^ this.getCapacityRebalance() == null) return false; if (other.getCapacityRebalance() != null && other.getCapacityRebalance().equals(this.getCapacityRebalance()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLaunchConfigurationName() == null) ? 0 : getLaunchConfigurationName().hashCode()); hashCode = prime * hashCode + ((getLoadBalancerNames() == null) ? 0 : getLoadBalancerNames().hashCode()); hashCode = prime * hashCode + ((getHealthCheckType() == null) ? 0 : getHealthCheckType().hashCode()); hashCode = prime * hashCode + ((getHealthCheckGracePeriod() == null) ? 0 : getHealthCheckGracePeriod().hashCode()); hashCode = prime * hashCode + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode()); hashCode = prime * hashCode + ((getMixedInstancesPolicy() == null) ? 0 : getMixedInstancesPolicy().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZones() == null) ? 0 : getAvailabilityZones().hashCode()); hashCode = prime * hashCode + ((getLaunchTemplate() == null) ? 0 : getLaunchTemplate().hashCode()); hashCode = prime * hashCode + ((getCapacityRebalance() == null) ? 0 : getCapacityRebalance().hashCode()); return hashCode; } @Override public AwsAutoScalingAutoScalingGroupDetails clone() { try { return (AwsAutoScalingAutoScalingGroupDetails) 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.AwsAutoScalingAutoScalingGroupDetailsMarshaller.getInstance().marshall(this, protocolMarshaller); } }