All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.qconnect.model.RecommendationData.kt Maven / Gradle / Ivy

There is a newer version: 1.3.34
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.qconnect.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Information about the recommendation.
 */
public class RecommendationData private constructor(builder: Builder) {
    /**
     * Summary of the recommended content.
     */
    public val data: aws.sdk.kotlin.services.qconnect.model.DataSummary? = builder.data
    /**
     * The recommended document.
     */
    public val document: aws.sdk.kotlin.services.qconnect.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.qconnect.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.qconnect.model.RecommendationType? = builder.type

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.qconnect.model.RecommendationData = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("RecommendationData(")
        append("data=$data,")
        append("document=$document,")
        append("recommendationId=$recommendationId,")
        append("relevanceLevel=$relevanceLevel,")
        append("relevanceScore=$relevanceScore,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = data?.hashCode() ?: 0
        result = 31 * 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 (data != other.data) return false
        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.qconnect.model.RecommendationData = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * Summary of the recommended content.
         */
        public var data: aws.sdk.kotlin.services.qconnect.model.DataSummary? = null
        /**
         * The recommended document.
         */
        public var document: aws.sdk.kotlin.services.qconnect.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.qconnect.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.qconnect.model.RecommendationType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.qconnect.model.RecommendationData) : this() {
            this.data = x.data
            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.qconnect.model.RecommendationData = RecommendationData(this)

        /**
         * construct an [aws.sdk.kotlin.services.qconnect.model.DataSummary] inside the given [block]
         */
        public fun data(block: aws.sdk.kotlin.services.qconnect.model.DataSummary.Builder.() -> kotlin.Unit) {
            this.data = aws.sdk.kotlin.services.qconnect.model.DataSummary.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.qconnect.model.Document] inside the given [block]
         */
        public fun document(block: aws.sdk.kotlin.services.qconnect.model.Document.Builder.() -> kotlin.Unit) {
            this.document = aws.sdk.kotlin.services.qconnect.model.Document.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (recommendationId == null) recommendationId = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy