commonMain.aws.sdk.kotlin.services.personalizeruntime.model.PredictedAction.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of personalizeruntime-jvm Show documentation
Show all versions of personalizeruntime-jvm Show documentation
The AWS SDK for Kotlin client for Personalize Runtime
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.personalizeruntime.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* An object that identifies an action.
*
* The API returns a list of `PredictedAction`s.
*/
public class PredictedAction private constructor(builder: Builder) {
/**
* The ID of the recommended action.
*/
public val actionId: kotlin.String? = builder.actionId
/**
* The score of the recommended action. For information about action scores, see [How action recommendation scoring works](https://docs.aws.amazon.com/personalize/latest/dg/how-action-recommendation-scoring-works.html).
*/
public val score: kotlin.Double? = builder.score
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.personalizeruntime.model.PredictedAction = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PredictedAction(")
append("actionId=$actionId,")
append("score=$score")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = actionId?.hashCode() ?: 0
result = 31 * result + (score?.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 PredictedAction
if (actionId != other.actionId) return false
if (!(score?.equals(other.score) ?: (other.score == null))) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.personalizeruntime.model.PredictedAction = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The ID of the recommended action.
*/
public var actionId: kotlin.String? = null
/**
* The score of the recommended action. For information about action scores, see [How action recommendation scoring works](https://docs.aws.amazon.com/personalize/latest/dg/how-action-recommendation-scoring-works.html).
*/
public var score: kotlin.Double? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.personalizeruntime.model.PredictedAction) : this() {
this.actionId = x.actionId
this.score = x.score
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.personalizeruntime.model.PredictedAction = PredictedAction(this)
internal fun correctErrors(): Builder {
return this
}
}
}