commonMain.aws.sdk.kotlin.services.autoscaling.model.AutoScalingInstanceDetails.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autoscaling-jvm Show documentation
Show all versions of autoscaling-jvm Show documentation
The AWS SDK for Kotlin client for Auto Scaling
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.autoscaling.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Describes an EC2 instance associated with an Auto Scaling group.
*/
public class AutoScalingInstanceDetails private constructor(builder: Builder) {
/**
* The name of the Auto Scaling group for the instance.
*/
public val autoScalingGroupName: kotlin.String? = builder.autoScalingGroupName
/**
* The Availability Zone for the instance.
*/
public val availabilityZone: kotlin.String? = builder.availabilityZone
/**
* The last reported health status of this instance. `Healthy` means that the instance is healthy and should remain in service. `Unhealthy` means that the instance is unhealthy and Amazon EC2 Auto Scaling should terminate and replace it.
*/
public val healthStatus: kotlin.String? = builder.healthStatus
/**
* The ID of the instance.
*/
public val instanceId: kotlin.String? = builder.instanceId
/**
* The instance type of the EC2 instance.
*/
public val instanceType: kotlin.String? = builder.instanceType
/**
* The launch configuration used to launch the instance. This value is not available if you attached the instance to the Auto Scaling group.
*/
public val launchConfigurationName: kotlin.String? = builder.launchConfigurationName
/**
* The launch template for the instance.
*/
public val launchTemplate: aws.sdk.kotlin.services.autoscaling.model.LaunchTemplateSpecification? = builder.launchTemplate
/**
* The lifecycle state for the instance. The `Quarantined` state is not used. For more information, see [Amazon EC2 Auto Scaling instance lifecycle](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-lifecycle.html) in the *Amazon EC2 Auto Scaling User Guide*.
*
* Valid values: `Pending` | `Pending:Wait` | `Pending:Proceed` | `Quarantined` | `InService` | `Terminating` | `Terminating:Wait` | `Terminating:Proceed` | `Terminated` | `Detaching` | `Detached` | `EnteringStandby` | `Standby` | `Warmed:Pending` | `Warmed:Pending:Wait` | `Warmed:Pending:Proceed` | `Warmed:Terminating` | `Warmed:Terminating:Wait` | `Warmed:Terminating:Proceed` | `Warmed:Terminated` | `Warmed:Stopped` | `Warmed:Running`
*/
public val lifecycleState: kotlin.String? = builder.lifecycleState
/**
* Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in.
*/
public val protectedFromScaleIn: kotlin.Boolean? = builder.protectedFromScaleIn
/**
* The number of capacity units contributed by the instance based on its instance type.
*
* Valid Range: Minimum value of 1. Maximum value of 999.
*/
public val weightedCapacity: kotlin.String? = builder.weightedCapacity
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.autoscaling.model.AutoScalingInstanceDetails = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("AutoScalingInstanceDetails(")
append("autoScalingGroupName=$autoScalingGroupName,")
append("availabilityZone=$availabilityZone,")
append("healthStatus=$healthStatus,")
append("instanceId=$instanceId,")
append("instanceType=$instanceType,")
append("launchConfigurationName=$launchConfigurationName,")
append("launchTemplate=$launchTemplate,")
append("lifecycleState=$lifecycleState,")
append("protectedFromScaleIn=$protectedFromScaleIn,")
append("weightedCapacity=$weightedCapacity")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = autoScalingGroupName?.hashCode() ?: 0
result = 31 * result + (availabilityZone?.hashCode() ?: 0)
result = 31 * result + (healthStatus?.hashCode() ?: 0)
result = 31 * result + (instanceId?.hashCode() ?: 0)
result = 31 * result + (instanceType?.hashCode() ?: 0)
result = 31 * result + (launchConfigurationName?.hashCode() ?: 0)
result = 31 * result + (launchTemplate?.hashCode() ?: 0)
result = 31 * result + (lifecycleState?.hashCode() ?: 0)
result = 31 * result + (protectedFromScaleIn?.hashCode() ?: 0)
result = 31 * result + (weightedCapacity?.hashCode() ?: 0)
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as AutoScalingInstanceDetails
if (autoScalingGroupName != other.autoScalingGroupName) return false
if (availabilityZone != other.availabilityZone) return false
if (healthStatus != other.healthStatus) return false
if (instanceId != other.instanceId) return false
if (instanceType != other.instanceType) return false
if (launchConfigurationName != other.launchConfigurationName) return false
if (launchTemplate != other.launchTemplate) return false
if (lifecycleState != other.lifecycleState) return false
if (protectedFromScaleIn != other.protectedFromScaleIn) return false
if (weightedCapacity != other.weightedCapacity) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.autoscaling.model.AutoScalingInstanceDetails = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The name of the Auto Scaling group for the instance.
*/
public var autoScalingGroupName: kotlin.String? = null
/**
* The Availability Zone for the instance.
*/
public var availabilityZone: kotlin.String? = null
/**
* The last reported health status of this instance. `Healthy` means that the instance is healthy and should remain in service. `Unhealthy` means that the instance is unhealthy and Amazon EC2 Auto Scaling should terminate and replace it.
*/
public var healthStatus: kotlin.String? = null
/**
* The ID of the instance.
*/
public var instanceId: kotlin.String? = null
/**
* The instance type of the EC2 instance.
*/
public var instanceType: kotlin.String? = null
/**
* The launch configuration used to launch the instance. This value is not available if you attached the instance to the Auto Scaling group.
*/
public var launchConfigurationName: kotlin.String? = null
/**
* The launch template for the instance.
*/
public var launchTemplate: aws.sdk.kotlin.services.autoscaling.model.LaunchTemplateSpecification? = null
/**
* The lifecycle state for the instance. The `Quarantined` state is not used. For more information, see [Amazon EC2 Auto Scaling instance lifecycle](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-lifecycle.html) in the *Amazon EC2 Auto Scaling User Guide*.
*
* Valid values: `Pending` | `Pending:Wait` | `Pending:Proceed` | `Quarantined` | `InService` | `Terminating` | `Terminating:Wait` | `Terminating:Proceed` | `Terminated` | `Detaching` | `Detached` | `EnteringStandby` | `Standby` | `Warmed:Pending` | `Warmed:Pending:Wait` | `Warmed:Pending:Proceed` | `Warmed:Terminating` | `Warmed:Terminating:Wait` | `Warmed:Terminating:Proceed` | `Warmed:Terminated` | `Warmed:Stopped` | `Warmed:Running`
*/
public var lifecycleState: kotlin.String? = null
/**
* Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in.
*/
public var protectedFromScaleIn: kotlin.Boolean? = null
/**
* The number of capacity units contributed by the instance based on its instance type.
*
* Valid Range: Minimum value of 1. Maximum value of 999.
*/
public var weightedCapacity: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.autoscaling.model.AutoScalingInstanceDetails) : this() {
this.autoScalingGroupName = x.autoScalingGroupName
this.availabilityZone = x.availabilityZone
this.healthStatus = x.healthStatus
this.instanceId = x.instanceId
this.instanceType = x.instanceType
this.launchConfigurationName = x.launchConfigurationName
this.launchTemplate = x.launchTemplate
this.lifecycleState = x.lifecycleState
this.protectedFromScaleIn = x.protectedFromScaleIn
this.weightedCapacity = x.weightedCapacity
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.autoscaling.model.AutoScalingInstanceDetails = AutoScalingInstanceDetails(this)
/**
* construct an [aws.sdk.kotlin.services.autoscaling.model.LaunchTemplateSpecification] inside the given [block]
*/
public fun launchTemplate(block: aws.sdk.kotlin.services.autoscaling.model.LaunchTemplateSpecification.Builder.() -> kotlin.Unit) {
this.launchTemplate = aws.sdk.kotlin.services.autoscaling.model.LaunchTemplateSpecification.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}