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

commonMain.aws.sdk.kotlin.services.ssmcontacts.model.GetContactResponse.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.ssmcontacts.model

import aws.smithy.kotlin.runtime.SdkDsl

public class GetContactResponse private constructor(builder: Builder) {
    /**
     * The alias of the contact or escalation plan. The alias is unique and identifiable.
     */
    public val alias: kotlin.String = requireNotNull(builder.alias) { "A non-null value must be provided for alias" }
    /**
     * The ARN of the contact or escalation plan.
     */
    public val contactArn: kotlin.String = requireNotNull(builder.contactArn) { "A non-null value must be provided for contactArn" }
    /**
     * The full name of the contact or escalation plan.
     */
    public val displayName: kotlin.String? = builder.displayName
    /**
     * Details about the specific timing or stages and targets of the escalation plan or engagement plan.
     */
    public val plan: aws.sdk.kotlin.services.ssmcontacts.model.Plan? = builder.plan
    /**
     * The type of contact, either `PERSONAL` or `ESCALATION`.
     */
    public val type: aws.sdk.kotlin.services.ssmcontacts.model.ContactType = requireNotNull(builder.type) { "A non-null value must be provided for type" }

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

    override fun toString(): kotlin.String = buildString {
        append("GetContactResponse(")
        append("alias=$alias,")
        append("contactArn=$contactArn,")
        append("displayName=$displayName,")
        append("plan=$plan,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = alias.hashCode()
        result = 31 * result + (contactArn.hashCode())
        result = 31 * result + (displayName?.hashCode() ?: 0)
        result = 31 * result + (plan?.hashCode() ?: 0)
        result = 31 * result + (type.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 GetContactResponse

        if (alias != other.alias) return false
        if (contactArn != other.contactArn) return false
        if (displayName != other.displayName) return false
        if (plan != other.plan) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The alias of the contact or escalation plan. The alias is unique and identifiable.
         */
        public var alias: kotlin.String? = null
        /**
         * The ARN of the contact or escalation plan.
         */
        public var contactArn: kotlin.String? = null
        /**
         * The full name of the contact or escalation plan.
         */
        public var displayName: kotlin.String? = null
        /**
         * Details about the specific timing or stages and targets of the escalation plan or engagement plan.
         */
        public var plan: aws.sdk.kotlin.services.ssmcontacts.model.Plan? = null
        /**
         * The type of contact, either `PERSONAL` or `ESCALATION`.
         */
        public var type: aws.sdk.kotlin.services.ssmcontacts.model.ContactType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssmcontacts.model.GetContactResponse) : this() {
            this.alias = x.alias
            this.contactArn = x.contactArn
            this.displayName = x.displayName
            this.plan = x.plan
            this.type = x.type
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.ssmcontacts.model.Plan] inside the given [block]
         */
        public fun plan(block: aws.sdk.kotlin.services.ssmcontacts.model.Plan.Builder.() -> kotlin.Unit) {
            this.plan = aws.sdk.kotlin.services.ssmcontacts.model.Plan.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (alias == null) alias = ""
            if (contactArn == null) contactArn = ""
            if (type == null) type = ContactType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy