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

commonMain.aws.sdk.kotlin.services.iotsitewise.model.BatchGetAssetPropertyAggregatesErrorEntry.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 for an asset property aggregate entry that is associated with the [BatchGetAssetPropertyAggregates](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyAggregates.html) API.
 */
public class BatchGetAssetPropertyAggregatesErrorEntry private constructor(builder: Builder) {
    /**
     * The ID of the entry.
     */
    public val entryId: kotlin.String = requireNotNull(builder.entryId) { "A non-null value must be provided for entryId" }
    /**
     * The error code.
     */
    public val errorCode: aws.sdk.kotlin.services.iotsitewise.model.BatchGetAssetPropertyAggregatesErrorCode = 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" }

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

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

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

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

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The ID of the entry.
         */
        public var entryId: kotlin.String? = null
        /**
         * The error code.
         */
        public var errorCode: aws.sdk.kotlin.services.iotsitewise.model.BatchGetAssetPropertyAggregatesErrorCode? = null
        /**
         * The associated error message.
         */
        public var errorMessage: kotlin.String? = null

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy