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

commonMain.aws.sdk.kotlin.services.ssmincidents.model.ItemIdentifier.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.ssmincidents.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Details and type of a related item.
 */
public class ItemIdentifier private constructor(builder: Builder) {
    /**
     * The type of related item.
     */
    public val type: aws.sdk.kotlin.services.ssmincidents.model.ItemType = requireNotNull(builder.type) { "A non-null value must be provided for type" }
    /**
     * Details about the related item.
     */
    public val value: aws.sdk.kotlin.services.ssmincidents.model.ItemValue? = builder.value

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

    override fun toString(): kotlin.String = buildString {
        append("ItemIdentifier(")
        append("type=$type,")
        append("value=$value")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = type.hashCode()
        result = 31 * result + (value?.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 ItemIdentifier

        if (type != other.type) return false
        if (value != other.value) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The type of related item.
         */
        public var type: aws.sdk.kotlin.services.ssmincidents.model.ItemType? = null
        /**
         * Details about the related item.
         */
        public var value: aws.sdk.kotlin.services.ssmincidents.model.ItemValue? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssmincidents.model.ItemIdentifier) : this() {
            this.type = x.type
            this.value = x.value
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy