commonMain.aws.sdk.kotlin.services.sagemakermetrics.model.RawMetricData.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sagemakermetrics-jvm Show documentation
Show all versions of sagemakermetrics-jvm Show documentation
The AWS Kotlin client for SageMaker Metrics
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.sagemakermetrics.model
import aws.smithy.kotlin.runtime.time.Instant
/**
* The raw metric data to associate with the resource.
*/
public class RawMetricData private constructor(builder: Builder) {
/**
* The name of the metric.
*/
public val metricName: kotlin.String? = builder.metricName
/**
* The metric step (epoch).
*/
public val step: kotlin.Int? = builder.step
/**
* The time that the metric was recorded.
*/
public val timestamp: aws.smithy.kotlin.runtime.time.Instant? = builder.timestamp
/**
* The metric value.
*/
public val value: kotlin.Double = builder.value
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.sagemakermetrics.model.RawMetricData = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("RawMetricData(")
append("metricName=$metricName,")
append("step=$step,")
append("timestamp=$timestamp,")
append("value=$value")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = metricName?.hashCode() ?: 0
result = 31 * result + (step ?: 0)
result = 31 * result + (timestamp?.hashCode() ?: 0)
result = 31 * result + (value.hashCode())
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 RawMetricData
if (metricName != other.metricName) return false
if (step != other.step) return false
if (timestamp != other.timestamp) return false
if (value != other.value) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.sagemakermetrics.model.RawMetricData = Builder(this).apply(block).build()
public class Builder {
/**
* The name of the metric.
*/
public var metricName: kotlin.String? = null
/**
* The metric step (epoch).
*/
public var step: kotlin.Int? = null
/**
* The time that the metric was recorded.
*/
public var timestamp: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The metric value.
*/
public var value: kotlin.Double = 0.0
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.sagemakermetrics.model.RawMetricData) : this() {
this.metricName = x.metricName
this.step = x.step
this.timestamp = x.timestamp
this.value = x.value
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.sagemakermetrics.model.RawMetricData = RawMetricData(this)
internal fun correctErrors(): Builder {
if (metricName == null) metricName = ""
if (timestamp == null) timestamp = Instant.fromEpochSeconds(0)
if (value == null) value = 0.0
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy