commonMain.aws.sdk.kotlin.services.autoscaling.model.LaunchTemplateSpecification.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 the launch template and the version of the launch template that Amazon EC2 Auto Scaling uses to launch Amazon EC2 instances. For more information about launch templates, see [Launch templates](https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-templates.html) in the *Amazon EC2 Auto Scaling User Guide*.
*/
public class LaunchTemplateSpecification private constructor(builder: Builder) {
/**
* The ID of the launch template. To get the template ID, use the Amazon EC2 [DescribeLaunchTemplates](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLaunchTemplates.html) API operation. New launch templates can be created using the Amazon EC2 [CreateLaunchTemplate](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html) API.
*
* Conditional: You must specify either a `LaunchTemplateId` or a `LaunchTemplateName`.
*/
public val launchTemplateId: kotlin.String? = builder.launchTemplateId
/**
* The name of the launch template. To get the template name, use the Amazon EC2 [DescribeLaunchTemplates](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLaunchTemplates.html) API operation. New launch templates can be created using the Amazon EC2 [CreateLaunchTemplate](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html) API.
*
* Conditional: You must specify either a `LaunchTemplateId` or a `LaunchTemplateName`.
*/
public val launchTemplateName: kotlin.String? = builder.launchTemplateName
/**
* The version number, `$Latest`, or `$Default`. To get the version number, use the Amazon EC2 [DescribeLaunchTemplateVersions](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLaunchTemplateVersions.html) API operation. New launch template versions can be created using the Amazon EC2 [CreateLaunchTemplateVersion](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplateVersion.html) API. If the value is `$Latest`, Amazon EC2 Auto Scaling selects the latest version of the launch template when launching instances. If the value is `$Default`, Amazon EC2 Auto Scaling selects the default version of the launch template when launching instances. The default value is `$Default`.
*/
public val version: kotlin.String? = builder.version
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.autoscaling.model.LaunchTemplateSpecification = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("LaunchTemplateSpecification(")
append("launchTemplateId=$launchTemplateId,")
append("launchTemplateName=$launchTemplateName,")
append("version=$version")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = launchTemplateId?.hashCode() ?: 0
result = 31 * result + (launchTemplateName?.hashCode() ?: 0)
result = 31 * result + (version?.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 LaunchTemplateSpecification
if (launchTemplateId != other.launchTemplateId) return false
if (launchTemplateName != other.launchTemplateName) return false
if (version != other.version) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.autoscaling.model.LaunchTemplateSpecification = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The ID of the launch template. To get the template ID, use the Amazon EC2 [DescribeLaunchTemplates](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLaunchTemplates.html) API operation. New launch templates can be created using the Amazon EC2 [CreateLaunchTemplate](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html) API.
*
* Conditional: You must specify either a `LaunchTemplateId` or a `LaunchTemplateName`.
*/
public var launchTemplateId: kotlin.String? = null
/**
* The name of the launch template. To get the template name, use the Amazon EC2 [DescribeLaunchTemplates](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLaunchTemplates.html) API operation. New launch templates can be created using the Amazon EC2 [CreateLaunchTemplate](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html) API.
*
* Conditional: You must specify either a `LaunchTemplateId` or a `LaunchTemplateName`.
*/
public var launchTemplateName: kotlin.String? = null
/**
* The version number, `$Latest`, or `$Default`. To get the version number, use the Amazon EC2 [DescribeLaunchTemplateVersions](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeLaunchTemplateVersions.html) API operation. New launch template versions can be created using the Amazon EC2 [CreateLaunchTemplateVersion](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplateVersion.html) API. If the value is `$Latest`, Amazon EC2 Auto Scaling selects the latest version of the launch template when launching instances. If the value is `$Default`, Amazon EC2 Auto Scaling selects the default version of the launch template when launching instances. The default value is `$Default`.
*/
public var version: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.autoscaling.model.LaunchTemplateSpecification) : this() {
this.launchTemplateId = x.launchTemplateId
this.launchTemplateName = x.launchTemplateName
this.version = x.version
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.autoscaling.model.LaunchTemplateSpecification = LaunchTemplateSpecification(this)
internal fun correctErrors(): Builder {
return this
}
}
}