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

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

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

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



/**
 * Details about the source content data.
 */
public class SourceContentDataDetails private constructor(builder: Builder) {
    /**
     * The identifier of the source content.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
    /**
     * Details about the source content ranking data.
     */
    public val rankingData: aws.sdk.kotlin.services.qconnect.model.RankingData? = builder.rankingData
    /**
     * Details about the source content text data.
     */
    public val textData: aws.sdk.kotlin.services.qconnect.model.TextData? = builder.textData
    /**
     * The type of the source content.
     */
    public val type: aws.sdk.kotlin.services.qconnect.model.SourceContentType = requireNotNull(builder.type) { "A non-null value must be provided for type" }

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

    override fun toString(): kotlin.String = buildString {
        append("SourceContentDataDetails(")
        append("id=$id,")
        append("rankingData=$rankingData,")
        append("textData=$textData,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = id.hashCode()
        result = 31 * result + (rankingData?.hashCode() ?: 0)
        result = 31 * result + (textData?.hashCode() ?: 0)
        result = 31 * result + (type.hashCode())
        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 SourceContentDataDetails

        if (id != other.id) return false
        if (rankingData != other.rankingData) return false
        if (textData != other.textData) return false
        if (type != other.type) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.qconnect.model.SourceContentDataDetails = Builder(this).apply(block).build()

    public class Builder {
        /**
         * The identifier of the source content.
         */
        public var id: kotlin.String? = null
        /**
         * Details about the source content ranking data.
         */
        public var rankingData: aws.sdk.kotlin.services.qconnect.model.RankingData? = null
        /**
         * Details about the source content text data.
         */
        public var textData: aws.sdk.kotlin.services.qconnect.model.TextData? = null
        /**
         * The type of the source content.
         */
        public var type: aws.sdk.kotlin.services.qconnect.model.SourceContentType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.qconnect.model.SourceContentDataDetails) : this() {
            this.id = x.id
            this.rankingData = x.rankingData
            this.textData = x.textData
            this.type = x.type
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.qconnect.model.SourceContentDataDetails = SourceContentDataDetails(this)

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

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

        internal fun correctErrors(): Builder {
            if (id == null) id = ""
            if (type == null) type = SourceContentType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy