commonMain.aws.sdk.kotlin.services.cleanroomsml.model.ResourceConfig.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cleanroomsml-jvm Show documentation
Show all versions of cleanroomsml-jvm Show documentation
The AWS SDK for Kotlin client for CleanRoomsML
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cleanroomsml.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Information about the EC2 resources that are used to train the model.
*/
public class ResourceConfig private constructor(builder: Builder) {
/**
* The number of resources that are used to train the model.
*/
public val instanceCount: kotlin.Int = builder.instanceCount
/**
* The instance type that is used to train the model.
*/
public val instanceType: aws.sdk.kotlin.services.cleanroomsml.model.InstanceType = requireNotNull(builder.instanceType) { "A non-null value must be provided for instanceType" }
/**
* The maximum size of the instance that is used to train the model.
*/
public val volumeSizeInGb: kotlin.Int = requireNotNull(builder.volumeSizeInGb) { "A non-null value must be provided for volumeSizeInGb" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cleanroomsml.model.ResourceConfig = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ResourceConfig(")
append("instanceCount=$instanceCount,")
append("instanceType=$instanceType,")
append("volumeSizeInGb=$volumeSizeInGb")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = instanceCount
result = 31 * result + (instanceType.hashCode())
result = 31 * result + (volumeSizeInGb)
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 ResourceConfig
if (instanceCount != other.instanceCount) return false
if (instanceType != other.instanceType) return false
if (volumeSizeInGb != other.volumeSizeInGb) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cleanroomsml.model.ResourceConfig = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The number of resources that are used to train the model.
*/
public var instanceCount: kotlin.Int = 1
/**
* The instance type that is used to train the model.
*/
public var instanceType: aws.sdk.kotlin.services.cleanroomsml.model.InstanceType? = null
/**
* The maximum size of the instance that is used to train the model.
*/
public var volumeSizeInGb: kotlin.Int? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cleanroomsml.model.ResourceConfig) : this() {
this.instanceCount = x.instanceCount
this.instanceType = x.instanceType
this.volumeSizeInGb = x.volumeSizeInGb
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cleanroomsml.model.ResourceConfig = ResourceConfig(this)
internal fun correctErrors(): Builder {
if (instanceType == null) instanceType = InstanceType.SdkUnknown("no value provided")
if (volumeSizeInGb == null) volumeSizeInGb = 0
return this
}
}
}