commonMain.aws.sdk.kotlin.services.evidently.model.MetricGoal.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of evidently-jvm Show documentation
Show all versions of evidently-jvm Show documentation
The AWS SDK for Kotlin client for Evidently
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.evidently.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* A structure that tells Evidently whether higher or lower values are desired for a metric that is used in an experiment.
*/
public class MetricGoal private constructor(builder: Builder) {
/**
* `INCREASE` means that a variation with a higher number for this metric is performing better.
*
* `DECREASE` means that a variation with a lower number for this metric is performing better.
*/
public val desiredChange: aws.sdk.kotlin.services.evidently.model.ChangeDirectionEnum? = builder.desiredChange
/**
* A structure that contains details about the metric.
*/
public val metricDefinition: aws.sdk.kotlin.services.evidently.model.MetricDefinition? = builder.metricDefinition
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.evidently.model.MetricGoal = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("MetricGoal(")
append("desiredChange=$desiredChange,")
append("metricDefinition=$metricDefinition")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = desiredChange?.hashCode() ?: 0
result = 31 * result + (metricDefinition?.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 MetricGoal
if (desiredChange != other.desiredChange) return false
if (metricDefinition != other.metricDefinition) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.evidently.model.MetricGoal = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* `INCREASE` means that a variation with a higher number for this metric is performing better.
*
* `DECREASE` means that a variation with a lower number for this metric is performing better.
*/
public var desiredChange: aws.sdk.kotlin.services.evidently.model.ChangeDirectionEnum? = null
/**
* A structure that contains details about the metric.
*/
public var metricDefinition: aws.sdk.kotlin.services.evidently.model.MetricDefinition? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.evidently.model.MetricGoal) : this() {
this.desiredChange = x.desiredChange
this.metricDefinition = x.metricDefinition
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.evidently.model.MetricGoal = MetricGoal(this)
/**
* construct an [aws.sdk.kotlin.services.evidently.model.MetricDefinition] inside the given [block]
*/
public fun metricDefinition(block: aws.sdk.kotlin.services.evidently.model.MetricDefinition.Builder.() -> kotlin.Unit) {
this.metricDefinition = aws.sdk.kotlin.services.evidently.model.MetricDefinition.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}