commonMain.aws.sdk.kotlin.services.personalizeruntime.model.PredictedItem.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 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
/**
* Metadata about the item from your Items dataset.
*/
public val metadata: Map? = builder.metadata
/**
* The name of the promotion that included the predicted item.
*/
public val promotionName: kotlin.String? = builder.promotionName
/**
* If you use User-Personalization-v2, a list of reasons for why the item was included in recommendations. Possible reasons include the following:
* + Promoted item - Indicates the item was included as part of a promotion that you applied in your recommendation request.
* + Exploration - Indicates the item was included with exploration. With exploration, recommendations include items with less interactions data or relevance for the user. For more information about exploration, see [Exploration](https://docs.aws.amazon.com/personalize/latest/dg/use-case-recipe-features.html#about-exploration).
* + Popular item - Indicates the item was included as a placeholder popular item. If you use a filter, depending on how many recommendations the filter removes, Amazon Personalize might add placeholder items to meet the `numResults` for your recommendation request. These items are popular items, based on interactions data, that satisfy your filter criteria. They don't have a relevance score for the user.
*/
public val reason: List? = builder.reason
/**
* 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("metadata=*** Sensitive Data Redacted ***,")
append("promotionName=$promotionName,")
append("reason=$reason,")
append("score=$score")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = itemId?.hashCode() ?: 0
result = 31 * result + (metadata?.hashCode() ?: 0)
result = 31 * result + (promotionName?.hashCode() ?: 0)
result = 31 * result + (reason?.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 (metadata != other.metadata) return false
if (promotionName != other.promotionName) return false
if (reason != other.reason) 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.PredictedItem = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The recommended item ID.
*/
public var itemId: kotlin.String? = null
/**
* Metadata about the item from your Items dataset.
*/
public var metadata: Map? = null
/**
* The name of the promotion that included the predicted item.
*/
public var promotionName: kotlin.String? = null
/**
* If you use User-Personalization-v2, a list of reasons for why the item was included in recommendations. Possible reasons include the following:
* + Promoted item - Indicates the item was included as part of a promotion that you applied in your recommendation request.
* + Exploration - Indicates the item was included with exploration. With exploration, recommendations include items with less interactions data or relevance for the user. For more information about exploration, see [Exploration](https://docs.aws.amazon.com/personalize/latest/dg/use-case-recipe-features.html#about-exploration).
* + Popular item - Indicates the item was included as a placeholder popular item. If you use a filter, depending on how many recommendations the filter removes, Amazon Personalize might add placeholder items to meet the `numResults` for your recommendation request. These items are popular items, based on interactions data, that satisfy your filter criteria. They don't have a relevance score for the user.
*/
public var reason: List? = 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.metadata = x.metadata
this.promotionName = x.promotionName
this.reason = x.reason
this.score = x.score
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.personalizeruntime.model.PredictedItem = PredictedItem(this)
internal fun correctErrors(): Builder {
return this
}
}
}