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

commonMain.aws.sdk.kotlin.services.iottwinmaker.model.BatchPutPropertyError.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iottwinmaker.model



/**
 * An error returned by the `BatchPutProperty` action.
 */
public class BatchPutPropertyError private constructor(builder: Builder) {
    /**
     * An object that contains information about errors returned by the `BatchPutProperty` action.
     */
    public val entry: aws.sdk.kotlin.services.iottwinmaker.model.PropertyValueEntry? = builder.entry
    /**
     * The error code.
     */
    public val errorCode: kotlin.String = requireNotNull(builder.errorCode) { "A non-null value must be provided for errorCode" }
    /**
     * The 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.iottwinmaker.model.BatchPutPropertyError = Builder().apply(block).build()
    }

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

    override fun hashCode(): kotlin.Int {
        var result = entry?.hashCode() ?: 0
        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 BatchPutPropertyError

        if (entry != other.entry) 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.iottwinmaker.model.BatchPutPropertyError = Builder(this).apply(block).build()

    public class Builder {
        /**
         * An object that contains information about errors returned by the `BatchPutProperty` action.
         */
        public var entry: aws.sdk.kotlin.services.iottwinmaker.model.PropertyValueEntry? = null
        /**
         * The error code.
         */
        public var errorCode: kotlin.String? = null
        /**
         * The error message.
         */
        public var errorMessage: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iottwinmaker.model.BatchPutPropertyError) : this() {
            this.entry = x.entry
            this.errorCode = x.errorCode
            this.errorMessage = x.errorMessage
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.iottwinmaker.model.PropertyValueEntry] inside the given [block]
         */
        public fun entry(block: aws.sdk.kotlin.services.iottwinmaker.model.PropertyValueEntry.Builder.() -> kotlin.Unit) {
            this.entry = aws.sdk.kotlin.services.iottwinmaker.model.PropertyValueEntry.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (errorCode == null) errorCode = ""
            if (errorMessage == null) errorMessage = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy