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

commonMain.aws.sdk.kotlin.services.ssmcontacts.model.CreateContactRequest.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 CreateContactRequest private constructor(builder: Builder) {
    /**
     * The short name to quickly identify a contact or escalation plan. The contact alias must be unique and identifiable.
     */
    public val alias: kotlin.String? = builder.alias
    /**
     * The full name of the contact or escalation plan.
     */
    public val displayName: kotlin.String? = builder.displayName
    /**
     * A token ensuring that the operation is called only once with the specified details.
     */
    public val idempotencyToken: kotlin.String? = builder.idempotencyToken
    /**
     * A list of stages. A contact has an engagement plan with stages that contact specified contact channels. An escalation plan uses stages that contact specified contacts.
     */
    public val plan: aws.sdk.kotlin.services.ssmcontacts.model.Plan? = builder.plan
    /**
     * Adds a tag to the target. You can only tag resources created in the first Region of your replication set.
     */
    public val tags: List? = builder.tags
    /**
     * To create an escalation plan use `ESCALATION`. To create a contact use `PERSONAL`.
     */
    public val type: aws.sdk.kotlin.services.ssmcontacts.model.ContactType? = builder.type

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

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

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

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

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The short name to quickly identify a contact or escalation plan. The contact alias must be unique and identifiable.
         */
        public var alias: kotlin.String? = null
        /**
         * The full name of the contact or escalation plan.
         */
        public var displayName: kotlin.String? = null
        /**
         * A token ensuring that the operation is called only once with the specified details.
         */
        public var idempotencyToken: kotlin.String? = null
        /**
         * A list of stages. A contact has an engagement plan with stages that contact specified contact channels. An escalation plan uses stages that contact specified contacts.
         */
        public var plan: aws.sdk.kotlin.services.ssmcontacts.model.Plan? = null
        /**
         * Adds a tag to the target. You can only tag resources created in the first Region of your replication set.
         */
        public var tags: List? = null
        /**
         * To create an escalation plan use `ESCALATION`. To create a contact use `PERSONAL`.
         */
        public var type: aws.sdk.kotlin.services.ssmcontacts.model.ContactType? = null

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

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.ssmcontacts.model.CreateContactRequest = CreateContactRequest(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 {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy