commonMain.aws.sdk.kotlin.services.computeoptimizer.model.UtilizationPreference.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of computeoptimizer-jvm Show documentation
Show all versions of computeoptimizer-jvm Show documentation
The AWS SDK for Kotlin client for Compute Optimizer
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.computeoptimizer.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* The preference to control the resource’s CPU utilization threshold, CPU utilization headroom, and memory utilization headroom.
*
* This preference is only available for the Amazon EC2 instance resource type.
*/
public class UtilizationPreference private constructor(builder: Builder) {
/**
* The name of the resource utilization metric name to customize.
*/
public val metricName: aws.sdk.kotlin.services.computeoptimizer.model.CustomizableMetricName? = builder.metricName
/**
* The parameters to set when customizing the resource utilization thresholds.
*/
public val metricParameters: aws.sdk.kotlin.services.computeoptimizer.model.CustomizableMetricParameters? = builder.metricParameters
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.computeoptimizer.model.UtilizationPreference = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("UtilizationPreference(")
append("metricName=$metricName,")
append("metricParameters=$metricParameters")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = metricName?.hashCode() ?: 0
result = 31 * result + (metricParameters?.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 UtilizationPreference
if (metricName != other.metricName) return false
if (metricParameters != other.metricParameters) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.computeoptimizer.model.UtilizationPreference = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The name of the resource utilization metric name to customize.
*/
public var metricName: aws.sdk.kotlin.services.computeoptimizer.model.CustomizableMetricName? = null
/**
* The parameters to set when customizing the resource utilization thresholds.
*/
public var metricParameters: aws.sdk.kotlin.services.computeoptimizer.model.CustomizableMetricParameters? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.computeoptimizer.model.UtilizationPreference) : this() {
this.metricName = x.metricName
this.metricParameters = x.metricParameters
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.computeoptimizer.model.UtilizationPreference = UtilizationPreference(this)
/**
* construct an [aws.sdk.kotlin.services.computeoptimizer.model.CustomizableMetricParameters] inside the given [block]
*/
public fun metricParameters(block: aws.sdk.kotlin.services.computeoptimizer.model.CustomizableMetricParameters.Builder.() -> kotlin.Unit) {
this.metricParameters = aws.sdk.kotlin.services.computeoptimizer.model.CustomizableMetricParameters.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}