commonMain.aws.sdk.kotlin.services.personalizeruntime.model.GetRecommendationsRequest.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
public class GetRecommendationsRequest private constructor(builder: Builder) {
/**
* The Amazon Resource Name (ARN) of the campaign to use for getting recommendations.
*/
public val campaignArn: kotlin.String? = builder.campaignArn
/**
* The contextual metadata to use when getting recommendations. Contextual metadata includes any interaction information that might be relevant when getting a user's recommendations, such as the user's current location or device type.
*/
public val context: Map? = builder.context
/**
* The ARN of the filter to apply to the returned recommendations. For more information, see [Filtering Recommendations](https://docs.aws.amazon.com/personalize/latest/dg/filter.html).
*
* When using this parameter, be sure the filter resource is `ACTIVE`.
*/
public val filterArn: kotlin.String? = builder.filterArn
/**
* The values to use when filtering recommendations. For each placeholder parameter in your filter expression, provide the parameter name (in matching case) as a key and the filter value(s) as the corresponding value. Separate multiple values for one parameter with a comma.
*
* For filter expressions that use an `INCLUDE` element to include items, you must provide values for all parameters that are defined in the expression. For filters with expressions that use an `EXCLUDE` element to exclude items, you can omit the `filter-values`.In this case, Amazon Personalize doesn't use that portion of the expression to filter recommendations.
*
* For more information, see [Filtering recommendations and user segments](https://docs.aws.amazon.com/personalize/latest/dg/filter.html).
*/
public val filterValues: Map? = builder.filterValues
/**
* The item ID to provide recommendations for.
*
* Required for `RELATED_ITEMS` recipe type.
*/
public val itemId: kotlin.String? = builder.itemId
/**
* If you enabled metadata in recommendations when you created or updated the campaign or recommender, specify the metadata columns from your Items dataset to include in item recommendations. The map key is `ITEMS` and the value is a list of column names from your Items dataset. The maximum number of columns you can provide is 10.
*
* For information about enabling metadata for a campaign, see [Enabling metadata in recommendations for a campaign](https://docs.aws.amazon.com/personalize/latest/dg/campaigns.html#create-campaign-return-metadata). For information about enabling metadata for a recommender, see [Enabling metadata in recommendations for a recommender](https://docs.aws.amazon.com/personalize/latest/dg/creating-recommenders.html#create-recommender-return-metadata).
*/
public val metadataColumns: Map>? = builder.metadataColumns
/**
* The number of results to return. The default is 25. If you are including metadata in recommendations, the maximum is 50. Otherwise, the maximum is 500.
*/
public val numResults: kotlin.Int? = builder.numResults
/**
* The promotions to apply to the recommendation request. A promotion defines additional business rules that apply to a configurable subset of recommended items.
*/
public val promotions: List? = builder.promotions
/**
* The Amazon Resource Name (ARN) of the recommender to use to get recommendations. Provide a recommender ARN if you created a Domain dataset group with a recommender for a domain use case.
*/
public val recommenderArn: kotlin.String? = builder.recommenderArn
/**
* The user ID to provide recommendations for.
*
* Required for `USER_PERSONALIZATION` recipe type.
*/
public val userId: kotlin.String? = builder.userId
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.personalizeruntime.model.GetRecommendationsRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("GetRecommendationsRequest(")
append("campaignArn=$campaignArn,")
append("context=*** Sensitive Data Redacted ***,")
append("filterArn=$filterArn,")
append("filterValues=*** Sensitive Data Redacted ***,")
append("itemId=$itemId,")
append("metadataColumns=$metadataColumns,")
append("numResults=$numResults,")
append("promotions=$promotions,")
append("recommenderArn=$recommenderArn,")
append("userId=$userId")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = campaignArn?.hashCode() ?: 0
result = 31 * result + (context?.hashCode() ?: 0)
result = 31 * result + (filterArn?.hashCode() ?: 0)
result = 31 * result + (filterValues?.hashCode() ?: 0)
result = 31 * result + (itemId?.hashCode() ?: 0)
result = 31 * result + (metadataColumns?.hashCode() ?: 0)
result = 31 * result + (numResults ?: 0)
result = 31 * result + (promotions?.hashCode() ?: 0)
result = 31 * result + (recommenderArn?.hashCode() ?: 0)
result = 31 * result + (userId?.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 GetRecommendationsRequest
if (campaignArn != other.campaignArn) return false
if (context != other.context) return false
if (filterArn != other.filterArn) return false
if (filterValues != other.filterValues) return false
if (itemId != other.itemId) return false
if (metadataColumns != other.metadataColumns) return false
if (numResults != other.numResults) return false
if (promotions != other.promotions) return false
if (recommenderArn != other.recommenderArn) return false
if (userId != other.userId) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.personalizeruntime.model.GetRecommendationsRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The Amazon Resource Name (ARN) of the campaign to use for getting recommendations.
*/
public var campaignArn: kotlin.String? = null
/**
* The contextual metadata to use when getting recommendations. Contextual metadata includes any interaction information that might be relevant when getting a user's recommendations, such as the user's current location or device type.
*/
public var context: Map? = null
/**
* The ARN of the filter to apply to the returned recommendations. For more information, see [Filtering Recommendations](https://docs.aws.amazon.com/personalize/latest/dg/filter.html).
*
* When using this parameter, be sure the filter resource is `ACTIVE`.
*/
public var filterArn: kotlin.String? = null
/**
* The values to use when filtering recommendations. For each placeholder parameter in your filter expression, provide the parameter name (in matching case) as a key and the filter value(s) as the corresponding value. Separate multiple values for one parameter with a comma.
*
* For filter expressions that use an `INCLUDE` element to include items, you must provide values for all parameters that are defined in the expression. For filters with expressions that use an `EXCLUDE` element to exclude items, you can omit the `filter-values`.In this case, Amazon Personalize doesn't use that portion of the expression to filter recommendations.
*
* For more information, see [Filtering recommendations and user segments](https://docs.aws.amazon.com/personalize/latest/dg/filter.html).
*/
public var filterValues: Map? = null
/**
* The item ID to provide recommendations for.
*
* Required for `RELATED_ITEMS` recipe type.
*/
public var itemId: kotlin.String? = null
/**
* If you enabled metadata in recommendations when you created or updated the campaign or recommender, specify the metadata columns from your Items dataset to include in item recommendations. The map key is `ITEMS` and the value is a list of column names from your Items dataset. The maximum number of columns you can provide is 10.
*
* For information about enabling metadata for a campaign, see [Enabling metadata in recommendations for a campaign](https://docs.aws.amazon.com/personalize/latest/dg/campaigns.html#create-campaign-return-metadata). For information about enabling metadata for a recommender, see [Enabling metadata in recommendations for a recommender](https://docs.aws.amazon.com/personalize/latest/dg/creating-recommenders.html#create-recommender-return-metadata).
*/
public var metadataColumns: Map>? = null
/**
* The number of results to return. The default is 25. If you are including metadata in recommendations, the maximum is 50. Otherwise, the maximum is 500.
*/
public var numResults: kotlin.Int? = null
/**
* The promotions to apply to the recommendation request. A promotion defines additional business rules that apply to a configurable subset of recommended items.
*/
public var promotions: List? = null
/**
* The Amazon Resource Name (ARN) of the recommender to use to get recommendations. Provide a recommender ARN if you created a Domain dataset group with a recommender for a domain use case.
*/
public var recommenderArn: kotlin.String? = null
/**
* The user ID to provide recommendations for.
*
* Required for `USER_PERSONALIZATION` recipe type.
*/
public var userId: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.personalizeruntime.model.GetRecommendationsRequest) : this() {
this.campaignArn = x.campaignArn
this.context = x.context
this.filterArn = x.filterArn
this.filterValues = x.filterValues
this.itemId = x.itemId
this.metadataColumns = x.metadataColumns
this.numResults = x.numResults
this.promotions = x.promotions
this.recommenderArn = x.recommenderArn
this.userId = x.userId
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.personalizeruntime.model.GetRecommendationsRequest = GetRecommendationsRequest(this)
internal fun correctErrors(): Builder {
return this
}
}
}