commonMain.aws.sdk.kotlin.services.pinpointsmsvoicev2.model.OptedOutNumberInformation.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pinpointsmsvoicev2-jvm Show documentation
Show all versions of pinpointsmsvoicev2-jvm Show documentation
The AWS SDK for Kotlin client for Pinpoint SMS Voice V2
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.pinpointsmsvoicev2.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant
/**
* The information for an opted out number in an Amazon Web Services account.
*/
public class OptedOutNumberInformation private constructor(builder: Builder) {
/**
* This is set to true if it was the end recipient that opted out.
*/
public val endUserOptedOut: kotlin.Boolean = builder.endUserOptedOut
/**
* The phone number that is opted out.
*/
public val optedOutNumber: kotlin.String = requireNotNull(builder.optedOutNumber) { "A non-null value must be provided for optedOutNumber" }
/**
* The time that the op tout occurred, in [UNIX epoch time](https://www.epochconverter.com/) format.
*/
public val optedOutTimestamp: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.optedOutTimestamp) { "A non-null value must be provided for optedOutTimestamp" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.pinpointsmsvoicev2.model.OptedOutNumberInformation = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("OptedOutNumberInformation(")
append("endUserOptedOut=$endUserOptedOut,")
append("optedOutNumber=$optedOutNumber,")
append("optedOutTimestamp=$optedOutTimestamp")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = endUserOptedOut.hashCode()
result = 31 * result + (optedOutNumber.hashCode())
result = 31 * result + (optedOutTimestamp.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 OptedOutNumberInformation
if (endUserOptedOut != other.endUserOptedOut) return false
if (optedOutNumber != other.optedOutNumber) return false
if (optedOutTimestamp != other.optedOutTimestamp) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.pinpointsmsvoicev2.model.OptedOutNumberInformation = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* This is set to true if it was the end recipient that opted out.
*/
public var endUserOptedOut: kotlin.Boolean = false
/**
* The phone number that is opted out.
*/
public var optedOutNumber: kotlin.String? = null
/**
* The time that the op tout occurred, in [UNIX epoch time](https://www.epochconverter.com/) format.
*/
public var optedOutTimestamp: aws.smithy.kotlin.runtime.time.Instant? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.OptedOutNumberInformation) : this() {
this.endUserOptedOut = x.endUserOptedOut
this.optedOutNumber = x.optedOutNumber
this.optedOutTimestamp = x.optedOutTimestamp
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.pinpointsmsvoicev2.model.OptedOutNumberInformation = OptedOutNumberInformation(this)
internal fun correctErrors(): Builder {
if (optedOutNumber == null) optedOutNumber = ""
if (optedOutTimestamp == null) optedOutTimestamp = Instant.fromEpochSeconds(0)
return this
}
}
}