commonMain.aws.sdk.kotlin.services.pinpointemail.model.Content.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pinpointemail-jvm Show documentation
Show all versions of pinpointemail-jvm Show documentation
The AWS SDK for Kotlin client for Pinpoint Email
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.pinpointemail.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* An object that represents the content of the email, and optionally a character set specification.
*/
public class Content private constructor(builder: Builder) {
/**
* The character set for the content. Because of the constraints of the SMTP protocol, Amazon Pinpoint uses 7-bit ASCII by default. If the text includes characters outside of the ASCII range, you have to specify a character set. For example, you could specify `UTF-8`, `ISO-8859-1`, or `Shift_JIS`.
*/
public val charset: kotlin.String? = builder.charset
/**
* The content of the message itself.
*/
public val data: kotlin.String = requireNotNull(builder.data) { "A non-null value must be provided for data" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.pinpointemail.model.Content = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Content(")
append("charset=$charset,")
append("data=$data")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = charset?.hashCode() ?: 0
result = 31 * result + (data.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 Content
if (charset != other.charset) return false
if (data != other.data) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.pinpointemail.model.Content = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The character set for the content. Because of the constraints of the SMTP protocol, Amazon Pinpoint uses 7-bit ASCII by default. If the text includes characters outside of the ASCII range, you have to specify a character set. For example, you could specify `UTF-8`, `ISO-8859-1`, or `Shift_JIS`.
*/
public var charset: kotlin.String? = null
/**
* The content of the message itself.
*/
public var data: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.pinpointemail.model.Content) : this() {
this.charset = x.charset
this.data = x.data
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.pinpointemail.model.Content = Content(this)
internal fun correctErrors(): Builder {
if (data == null) data = ""
return this
}
}
}