
commonMain.aws.sdk.kotlin.services.personalizeruntime.model.PredictedItem.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.personalizeruntime.model
/**
* An object that identifies an item.
*
* The and APIs return a list of `PredictedItem`s.
*/
public class PredictedItem private constructor(builder: Builder) {
/**
* The recommended item ID.
*/
public val itemId: kotlin.String? = builder.itemId
/**
* The name of the promotion that included the predicted item.
*/
public val promotionName: kotlin.String? = builder.promotionName
/**
* A numeric representation of the model's certainty that the item will be the next user selection. For more information on scoring logic, see how-scores-work.
*/
public val score: kotlin.Double? = builder.score
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.personalizeruntime.model.PredictedItem = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PredictedItem(")
append("itemId=$itemId,")
append("promotionName=$promotionName,")
append("score=$score")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = itemId?.hashCode() ?: 0
result = 31 * result + (promotionName?.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 PredictedItem
if (itemId != other.itemId) return false
if (promotionName != other.promotionName) return false
if (score != other.score) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.personalizeruntime.model.PredictedItem = Builder(this).apply(block).build()
public class Builder {
/**
* The recommended item ID.
*/
public var itemId: kotlin.String? = null
/**
* The name of the promotion that included the predicted item.
*/
public var promotionName: kotlin.String? = null
/**
* A numeric representation of the model's certainty that the item will be the next user selection. For more information on scoring logic, see how-scores-work.
*/
public var score: kotlin.Double? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.personalizeruntime.model.PredictedItem) : this() {
this.itemId = x.itemId
this.promotionName = x.promotionName
this.score = x.score
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.personalizeruntime.model.PredictedItem = PredictedItem(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy