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

commonMain.aws.sdk.kotlin.services.wisdom.model.Document.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.wisdom.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The document.
 */
public class Document private constructor(builder: Builder) {
    /**
     * A reference to the content resource.
     */
    public val contentReference: aws.sdk.kotlin.services.wisdom.model.ContentReference? = builder.contentReference
    /**
     * The excerpt from the document.
     */
    public val excerpt: aws.sdk.kotlin.services.wisdom.model.DocumentText? = builder.excerpt
    /**
     * The title of the document.
     */
    public val title: aws.sdk.kotlin.services.wisdom.model.DocumentText? = builder.title

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

    override fun toString(): kotlin.String = buildString {
        append("Document(")
        append("contentReference=$contentReference,")
        append("excerpt=$excerpt,")
        append("title=$title")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = contentReference?.hashCode() ?: 0
        result = 31 * result + (excerpt?.hashCode() ?: 0)
        result = 31 * result + (title?.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 Document

        if (contentReference != other.contentReference) return false
        if (excerpt != other.excerpt) return false
        if (title != other.title) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A reference to the content resource.
         */
        public var contentReference: aws.sdk.kotlin.services.wisdom.model.ContentReference? = null
        /**
         * The excerpt from the document.
         */
        public var excerpt: aws.sdk.kotlin.services.wisdom.model.DocumentText? = null
        /**
         * The title of the document.
         */
        public var title: aws.sdk.kotlin.services.wisdom.model.DocumentText? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.wisdom.model.Document) : this() {
            this.contentReference = x.contentReference
            this.excerpt = x.excerpt
            this.title = x.title
        }

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

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

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

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy