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

commonMain.aws.sdk.kotlin.services.pinpointsmsvoicev2.model.OriginationIdentityMetadata.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.pinpointsmsvoicev2.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The metadata for an origination identity associated with a pool.
 */
public class OriginationIdentityMetadata private constructor(builder: Builder) {
    /**
     * The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.
     */
    public val isoCountryCode: kotlin.String = requireNotNull(builder.isoCountryCode) { "A non-null value must be provided for isoCountryCode" }
    /**
     * Describes if the origination identity can be used for text messages, voice calls or both.
     */
    public val numberCapabilities: List = requireNotNull(builder.numberCapabilities) { "A non-null value must be provided for numberCapabilities" }
    /**
     * The unique identifier of the origination identity.
     */
    public val originationIdentity: kotlin.String = requireNotNull(builder.originationIdentity) { "A non-null value must be provided for originationIdentity" }
    /**
     * The Amazon Resource Name (ARN) associated with the origination identity.
     */
    public val originationIdentityArn: kotlin.String = requireNotNull(builder.originationIdentityArn) { "A non-null value must be provided for originationIdentityArn" }
    /**
     * The phone number in E.164 format.
     */
    public val phoneNumber: kotlin.String? = builder.phoneNumber

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

    override fun toString(): kotlin.String = buildString {
        append("OriginationIdentityMetadata(")
        append("isoCountryCode=$isoCountryCode,")
        append("numberCapabilities=$numberCapabilities,")
        append("originationIdentity=$originationIdentity,")
        append("originationIdentityArn=$originationIdentityArn,")
        append("phoneNumber=$phoneNumber")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = isoCountryCode.hashCode()
        result = 31 * result + (numberCapabilities.hashCode())
        result = 31 * result + (originationIdentity.hashCode())
        result = 31 * result + (originationIdentityArn.hashCode())
        result = 31 * result + (phoneNumber?.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 OriginationIdentityMetadata

        if (isoCountryCode != other.isoCountryCode) return false
        if (numberCapabilities != other.numberCapabilities) return false
        if (originationIdentity != other.originationIdentity) return false
        if (originationIdentityArn != other.originationIdentityArn) return false
        if (phoneNumber != other.phoneNumber) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.
         */
        public var isoCountryCode: kotlin.String? = null
        /**
         * Describes if the origination identity can be used for text messages, voice calls or both.
         */
        public var numberCapabilities: List? = null
        /**
         * The unique identifier of the origination identity.
         */
        public var originationIdentity: kotlin.String? = null
        /**
         * The Amazon Resource Name (ARN) associated with the origination identity.
         */
        public var originationIdentityArn: kotlin.String? = null
        /**
         * The phone number in E.164 format.
         */
        public var phoneNumber: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.OriginationIdentityMetadata) : this() {
            this.isoCountryCode = x.isoCountryCode
            this.numberCapabilities = x.numberCapabilities
            this.originationIdentity = x.originationIdentity
            this.originationIdentityArn = x.originationIdentityArn
            this.phoneNumber = x.phoneNumber
        }

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

        internal fun correctErrors(): Builder {
            if (isoCountryCode == null) isoCountryCode = ""
            if (numberCapabilities == null) numberCapabilities = emptyList()
            if (originationIdentity == null) originationIdentity = ""
            if (originationIdentityArn == null) originationIdentityArn = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy