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

commonMain.aws.sdk.kotlin.services.pinpointemail.model.Body.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.pinpointemail.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Represents the body of the email message.
 */
public class Body private constructor(builder: Builder) {
    /**
     * An object that represents the version of the message that is displayed in email clients that support HTML. HTML messages can include formatted text, hyperlinks, images, and more.
     */
    public val html: aws.sdk.kotlin.services.pinpointemail.model.Content? = builder.html
    /**
     * An object that represents the version of the message that is displayed in email clients that don't support HTML, or clients where the recipient has disabled HTML rendering.
     */
    public val text: aws.sdk.kotlin.services.pinpointemail.model.Content? = builder.text

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

    override fun toString(): kotlin.String = buildString {
        append("Body(")
        append("html=$html,")
        append("text=$text")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = html?.hashCode() ?: 0
        result = 31 * result + (text?.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 Body

        if (html != other.html) return false
        if (text != other.text) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An object that represents the version of the message that is displayed in email clients that support HTML. HTML messages can include formatted text, hyperlinks, images, and more.
         */
        public var html: aws.sdk.kotlin.services.pinpointemail.model.Content? = null
        /**
         * An object that represents the version of the message that is displayed in email clients that don't support HTML, or clients where the recipient has disabled HTML rendering.
         */
        public var text: aws.sdk.kotlin.services.pinpointemail.model.Content? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.pinpointemail.model.Body) : this() {
            this.html = x.html
            this.text = x.text
        }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy