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

commonMain.aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SupportedAssociation.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 processing rules for when a registration can be associated with an origination identity and disassociated from an origination identity.
 */
public class SupportedAssociation private constructor(builder: Builder) {
    /**
     * The association behavior.
     * + `ASSOCIATE_BEFORE_SUBMIT` The origination identity has to be supplied when creating a registration.
     * + `ASSOCIATE_ON_APPROVAL` This applies to all short code registrations. The short code will be automatically provisioned once the registration is approved.
     * + `ASSOCIATE_AFTER_COMPLETE` This applies to phone number registrations when you must complete a registration first, then associate one or more phone numbers later. For example 10DLC campaigns and long codes.
     */
    public val associationBehavior: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.RegistrationAssociationBehavior = requireNotNull(builder.associationBehavior) { "A non-null value must be provided for associationBehavior" }
    /**
     * The disassociation behavior.
     * + `DISASSOCIATE_ALL_CLOSES_REGISTRATION` All origination identities must be disassociated from the registration before the registration can be closed.
     * + `DISASSOCIATE_ALL_ALLOWS_DELETE_REGISTRATION` All origination identities must be disassociated from the registration before the registration can be deleted.
     * + `DELETE_REGISTRATION_DISASSOCIATES` The registration can be deleted and all origination identities will be disasscoiated.
     */
    public val disassociationBehavior: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.RegistrationDisassociationBehavior = requireNotNull(builder.disassociationBehavior) { "A non-null value must be provided for disassociationBehavior" }
    /**
     * The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.
     */
    public val isoCountryCode: kotlin.String? = builder.isoCountryCode
    /**
     * Defines the behavior of when an origination identity and registration can be associated with each other.
     */
    public val resourceType: kotlin.String = requireNotNull(builder.resourceType) { "A non-null value must be provided for resourceType" }

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

    override fun toString(): kotlin.String = buildString {
        append("SupportedAssociation(")
        append("associationBehavior=$associationBehavior,")
        append("disassociationBehavior=$disassociationBehavior,")
        append("isoCountryCode=$isoCountryCode,")
        append("resourceType=$resourceType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = associationBehavior.hashCode()
        result = 31 * result + (disassociationBehavior.hashCode())
        result = 31 * result + (isoCountryCode?.hashCode() ?: 0)
        result = 31 * result + (resourceType.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 SupportedAssociation

        if (associationBehavior != other.associationBehavior) return false
        if (disassociationBehavior != other.disassociationBehavior) return false
        if (isoCountryCode != other.isoCountryCode) return false
        if (resourceType != other.resourceType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The association behavior.
         * + `ASSOCIATE_BEFORE_SUBMIT` The origination identity has to be supplied when creating a registration.
         * + `ASSOCIATE_ON_APPROVAL` This applies to all short code registrations. The short code will be automatically provisioned once the registration is approved.
         * + `ASSOCIATE_AFTER_COMPLETE` This applies to phone number registrations when you must complete a registration first, then associate one or more phone numbers later. For example 10DLC campaigns and long codes.
         */
        public var associationBehavior: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.RegistrationAssociationBehavior? = null
        /**
         * The disassociation behavior.
         * + `DISASSOCIATE_ALL_CLOSES_REGISTRATION` All origination identities must be disassociated from the registration before the registration can be closed.
         * + `DISASSOCIATE_ALL_ALLOWS_DELETE_REGISTRATION` All origination identities must be disassociated from the registration before the registration can be deleted.
         * + `DELETE_REGISTRATION_DISASSOCIATES` The registration can be deleted and all origination identities will be disasscoiated.
         */
        public var disassociationBehavior: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.RegistrationDisassociationBehavior? = null
        /**
         * The two-character code, in ISO 3166-1 alpha-2 format, for the country or region.
         */
        public var isoCountryCode: kotlin.String? = null
        /**
         * Defines the behavior of when an origination identity and registration can be associated with each other.
         */
        public var resourceType: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SupportedAssociation) : this() {
            this.associationBehavior = x.associationBehavior
            this.disassociationBehavior = x.disassociationBehavior
            this.isoCountryCode = x.isoCountryCode
            this.resourceType = x.resourceType
        }

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

        internal fun correctErrors(): Builder {
            if (associationBehavior == null) associationBehavior = RegistrationAssociationBehavior.SdkUnknown("no value provided")
            if (disassociationBehavior == null) disassociationBehavior = RegistrationDisassociationBehavior.SdkUnknown("no value provided")
            if (resourceType == null) resourceType = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy