commonMain.aws.sdk.kotlin.services.autoscalingplans.model.Datapoint.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autoscalingplans-jvm Show documentation
Show all versions of autoscalingplans-jvm Show documentation
The AWS SDK for Kotlin client for Auto Scaling Plans
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.autoscalingplans.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant
/**
* Represents a single value in the forecast data used for predictive scaling.
*/
public class Datapoint private constructor(builder: Builder) {
/**
* The time stamp for the data point in UTC format.
*/
public val timestamp: aws.smithy.kotlin.runtime.time.Instant? = builder.timestamp
/**
* The value of the data point.
*/
public val value: kotlin.Double? = builder.value
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.autoscalingplans.model.Datapoint = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Datapoint(")
append("timestamp=$timestamp,")
append("value=$value")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = timestamp?.hashCode() ?: 0
result = 31 * result + (value?.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 Datapoint
if (timestamp != other.timestamp) return false
if (!(value?.equals(other.value) ?: (other.value == null))) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.autoscalingplans.model.Datapoint = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The time stamp for the data point in UTC format.
*/
public var timestamp: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The value of the data point.
*/
public var value: kotlin.Double? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.autoscalingplans.model.Datapoint) : this() {
this.timestamp = x.timestamp
this.value = x.value
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.autoscalingplans.model.Datapoint = Datapoint(this)
internal fun correctErrors(): Builder {
return this
}
}
}