commonMain.aws.sdk.kotlin.services.wisdom.model.RecommendationData.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wisdom-jvm Show documentation
Show all versions of wisdom-jvm Show documentation
The AWS SDK for Kotlin client for Wisdom
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.wisdom.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Information about the recommendation.
*/
public class RecommendationData private constructor(builder: Builder) {
/**
* The recommended document.
*/
public val document: aws.sdk.kotlin.services.wisdom.model.Document? = builder.document
/**
* The identifier of the recommendation.
*/
public val recommendationId: kotlin.String = requireNotNull(builder.recommendationId) { "A non-null value must be provided for recommendationId" }
/**
* The relevance level of the recommendation.
*/
public val relevanceLevel: aws.sdk.kotlin.services.wisdom.model.RelevanceLevel? = builder.relevanceLevel
/**
* The relevance score of the recommendation.
*/
public val relevanceScore: kotlin.Double = builder.relevanceScore
/**
* The type of recommendation.
*/
public val type: aws.sdk.kotlin.services.wisdom.model.RecommendationType? = builder.type
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.wisdom.model.RecommendationData = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("RecommendationData(")
append("document=$document,")
append("recommendationId=$recommendationId,")
append("relevanceLevel=$relevanceLevel,")
append("relevanceScore=$relevanceScore,")
append("type=$type")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = document?.hashCode() ?: 0
result = 31 * result + (recommendationId.hashCode())
result = 31 * result + (relevanceLevel?.hashCode() ?: 0)
result = 31 * result + (relevanceScore.hashCode())
result = 31 * result + (type?.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 RecommendationData
if (document != other.document) return false
if (recommendationId != other.recommendationId) return false
if (relevanceLevel != other.relevanceLevel) return false
if (!(relevanceScore?.equals(other.relevanceScore) ?: (other.relevanceScore == null))) return false
if (type != other.type) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.wisdom.model.RecommendationData = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The recommended document.
*/
public var document: aws.sdk.kotlin.services.wisdom.model.Document? = null
/**
* The identifier of the recommendation.
*/
public var recommendationId: kotlin.String? = null
/**
* The relevance level of the recommendation.
*/
public var relevanceLevel: aws.sdk.kotlin.services.wisdom.model.RelevanceLevel? = null
/**
* The relevance score of the recommendation.
*/
public var relevanceScore: kotlin.Double = 0.0
/**
* The type of recommendation.
*/
public var type: aws.sdk.kotlin.services.wisdom.model.RecommendationType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.wisdom.model.RecommendationData) : this() {
this.document = x.document
this.recommendationId = x.recommendationId
this.relevanceLevel = x.relevanceLevel
this.relevanceScore = x.relevanceScore
this.type = x.type
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.wisdom.model.RecommendationData = RecommendationData(this)
/**
* construct an [aws.sdk.kotlin.services.wisdom.model.Document] inside the given [block]
*/
public fun document(block: aws.sdk.kotlin.services.wisdom.model.Document.Builder.() -> kotlin.Unit) {
this.document = aws.sdk.kotlin.services.wisdom.model.Document.invoke(block)
}
internal fun correctErrors(): Builder {
if (recommendationId == null) recommendationId = ""
return this
}
}
}