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

commonMain.aws.sdk.kotlin.services.opensearch.model.OptionStatus.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.opensearch.model

import aws.smithy.kotlin.runtime.time.Instant

/**
 * Provides the current status of an entity.
 */
public class OptionStatus private constructor(builder: Builder) {
    /**
     * The timestamp when the entity was created.
     */
    public val creationDate: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.creationDate) { "A non-null value must be provided for creationDate" }
    /**
     * Indicates whether the entity is being deleted.
     */
    public val pendingDeletion: kotlin.Boolean? = builder.pendingDeletion
    /**
     * The state of the entity.
     */
    public val state: aws.sdk.kotlin.services.opensearch.model.OptionState = requireNotNull(builder.state) { "A non-null value must be provided for state" }
    /**
     * The timestamp of the last time the entity was updated.
     */
    public val updateDate: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.updateDate) { "A non-null value must be provided for updateDate" }
    /**
     * The latest version of the entity.
     */
    public val updateVersion: kotlin.Int = builder.updateVersion

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

    override fun toString(): kotlin.String = buildString {
        append("OptionStatus(")
        append("creationDate=$creationDate,")
        append("pendingDeletion=$pendingDeletion,")
        append("state=$state,")
        append("updateDate=$updateDate,")
        append("updateVersion=$updateVersion")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = creationDate.hashCode()
        result = 31 * result + (pendingDeletion?.hashCode() ?: 0)
        result = 31 * result + (state.hashCode())
        result = 31 * result + (updateDate.hashCode())
        result = 31 * result + (updateVersion)
        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 OptionStatus

        if (creationDate != other.creationDate) return false
        if (pendingDeletion != other.pendingDeletion) return false
        if (state != other.state) return false
        if (updateDate != other.updateDate) return false
        if (updateVersion != other.updateVersion) return false

        return true
    }

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

    public class Builder {
        /**
         * The timestamp when the entity was created.
         */
        public var creationDate: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Indicates whether the entity is being deleted.
         */
        public var pendingDeletion: kotlin.Boolean? = null
        /**
         * The state of the entity.
         */
        public var state: aws.sdk.kotlin.services.opensearch.model.OptionState? = null
        /**
         * The timestamp of the last time the entity was updated.
         */
        public var updateDate: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The latest version of the entity.
         */
        public var updateVersion: kotlin.Int = 0

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.opensearch.model.OptionStatus) : this() {
            this.creationDate = x.creationDate
            this.pendingDeletion = x.pendingDeletion
            this.state = x.state
            this.updateDate = x.updateDate
            this.updateVersion = x.updateVersion
        }

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

        internal fun correctErrors(): Builder {
            if (creationDate == null) creationDate = Instant.fromEpochSeconds(0)
            if (state == null) state = OptionState.SdkUnknown("no value provided")
            if (updateDate == null) updateDate = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy