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

commonMain.aws.sdk.kotlin.services.ssmcontacts.model.ContactTargetInfo.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

/**
 * The contact that Incident Manager is engaging during an incident.
 */
public class ContactTargetInfo private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the contact.
     */
    public val contactId: kotlin.String? = builder.contactId
    /**
     * A Boolean value determining if the contact's acknowledgement stops the progress of stages in the plan.
     */
    public val isEssential: kotlin.Boolean = requireNotNull(builder.isEssential) { "A non-null value must be provided for isEssential" }

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

    override fun toString(): kotlin.String = buildString {
        append("ContactTargetInfo(")
        append("contactId=$contactId,")
        append("isEssential=$isEssential")
        append(")")
    }

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

        if (contactId != other.contactId) return false
        if (isEssential != other.isEssential) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the contact.
         */
        public var contactId: kotlin.String? = null
        /**
         * A Boolean value determining if the contact's acknowledgement stops the progress of stages in the plan.
         */
        public var isEssential: kotlin.Boolean? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssmcontacts.model.ContactTargetInfo) : this() {
            this.contactId = x.contactId
            this.isEssential = x.isEssential
        }

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

        internal fun correctErrors(): Builder {
            if (isEssential == null) isEssential = false
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy