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

commonMain.aws.sdk.kotlin.services.iotsitewise.model.BatchPutAssetPropertyError.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iotsitewise.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains error information from updating a batch of asset property values.
 */
public class BatchPutAssetPropertyError private constructor(builder: Builder) {
    /**
     * The error code.
     */
    public val errorCode: aws.sdk.kotlin.services.iotsitewise.model.BatchPutAssetPropertyValueErrorCode = requireNotNull(builder.errorCode) { "A non-null value must be provided for errorCode" }
    /**
     * The associated error message.
     */
    public val errorMessage: kotlin.String = requireNotNull(builder.errorMessage) { "A non-null value must be provided for errorMessage" }
    /**
     * A list of timestamps for each error, if any.
     */
    public val timestamps: List = requireNotNull(builder.timestamps) { "A non-null value must be provided for timestamps" }

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

    override fun toString(): kotlin.String = buildString {
        append("BatchPutAssetPropertyError(")
        append("errorCode=$errorCode,")
        append("errorMessage=$errorMessage,")
        append("timestamps=$timestamps")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = errorCode.hashCode()
        result = 31 * result + (errorMessage.hashCode())
        result = 31 * result + (timestamps.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 BatchPutAssetPropertyError

        if (errorCode != other.errorCode) return false
        if (errorMessage != other.errorMessage) return false
        if (timestamps != other.timestamps) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The error code.
         */
        public var errorCode: aws.sdk.kotlin.services.iotsitewise.model.BatchPutAssetPropertyValueErrorCode? = null
        /**
         * The associated error message.
         */
        public var errorMessage: kotlin.String? = null
        /**
         * A list of timestamps for each error, if any.
         */
        public var timestamps: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iotsitewise.model.BatchPutAssetPropertyError) : this() {
            this.errorCode = x.errorCode
            this.errorMessage = x.errorMessage
            this.timestamps = x.timestamps
        }

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

        internal fun correctErrors(): Builder {
            if (errorCode == null) errorCode = BatchPutAssetPropertyValueErrorCode.SdkUnknown("no value provided")
            if (errorMessage == null) errorMessage = ""
            if (timestamps == null) timestamps = emptyList()
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy