commonMain.aws.sdk.kotlin.services.cleanroomsml.model.MetricDefinition.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 model metric that is reported for a trained model.
*/
public class MetricDefinition private constructor(builder: Builder) {
/**
* The name of the model metric.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The regular expression statement that defines how the model metric is reported.
*/
public val regex: kotlin.String = requireNotNull(builder.regex) { "A non-null value must be provided for regex" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cleanroomsml.model.MetricDefinition = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("MetricDefinition(")
append("name=$name,")
append("regex=$regex")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = name.hashCode()
result = 31 * result + (regex.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 MetricDefinition
if (name != other.name) return false
if (regex != other.regex) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cleanroomsml.model.MetricDefinition = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The name of the model metric.
*/
public var name: kotlin.String? = null
/**
* The regular expression statement that defines how the model metric is reported.
*/
public var regex: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cleanroomsml.model.MetricDefinition) : this() {
this.name = x.name
this.regex = x.regex
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cleanroomsml.model.MetricDefinition = MetricDefinition(this)
internal fun correctErrors(): Builder {
if (name == null) name = ""
if (regex == null) regex = ""
return this
}
}
}