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

commonMain.aws.sdk.kotlin.services.shield.model.EmergencyContact.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.shield.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contact information that the SRT can use to contact you if you have proactive engagement enabled, for escalations to the SRT and to initiate proactive customer support.
 */
public class EmergencyContact private constructor(builder: Builder) {
    /**
     * Additional notes regarding the contact.
     */
    public val contactNotes: kotlin.String? = builder.contactNotes
    /**
     * The email address for the contact.
     */
    public val emailAddress: kotlin.String = requireNotNull(builder.emailAddress) { "A non-null value must be provided for emailAddress" }
    /**
     * The phone number for the contact.
     */
    public val phoneNumber: kotlin.String? = builder.phoneNumber

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

    override fun toString(): kotlin.String = buildString {
        append("EmergencyContact(")
        append("contactNotes=$contactNotes,")
        append("emailAddress=$emailAddress,")
        append("phoneNumber=$phoneNumber")
        append(")")
    }

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

        if (contactNotes != other.contactNotes) return false
        if (emailAddress != other.emailAddress) return false
        if (phoneNumber != other.phoneNumber) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Additional notes regarding the contact.
         */
        public var contactNotes: kotlin.String? = null
        /**
         * The email address for the contact.
         */
        public var emailAddress: kotlin.String? = null
        /**
         * The phone number for the contact.
         */
        public var phoneNumber: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.shield.model.EmergencyContact) : this() {
            this.contactNotes = x.contactNotes
            this.emailAddress = x.emailAddress
            this.phoneNumber = x.phoneNumber
        }

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

        internal fun correctErrors(): Builder {
            if (emailAddress == null) emailAddress = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy