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

commonMain.aws.sdk.kotlin.services.dynamodb.model.TransactWriteItem.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.dynamodb.model



/**
 * A list of requests that can perform update, put, delete, or check operations on multiple items in one or more tables atomically.
 */
public class TransactWriteItem private constructor(builder: Builder) {
    /**
     * A request to perform a check item operation.
     */
    public val conditionCheck: aws.sdk.kotlin.services.dynamodb.model.ConditionCheck? = builder.conditionCheck
    /**
     * A request to perform a `DeleteItem` operation.
     */
    public val delete: aws.sdk.kotlin.services.dynamodb.model.Delete? = builder.delete
    /**
     * A request to perform a `PutItem` operation.
     */
    public val put: aws.sdk.kotlin.services.dynamodb.model.Put? = builder.put
    /**
     * A request to perform an `UpdateItem` operation.
     */
    public val update: aws.sdk.kotlin.services.dynamodb.model.Update? = builder.update

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

    override fun toString(): kotlin.String = buildString {
        append("TransactWriteItem(")
        append("conditionCheck=$conditionCheck,")
        append("delete=$delete,")
        append("put=$put,")
        append("update=$update")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = conditionCheck?.hashCode() ?: 0
        result = 31 * result + (delete?.hashCode() ?: 0)
        result = 31 * result + (put?.hashCode() ?: 0)
        result = 31 * result + (update?.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 TransactWriteItem

        if (conditionCheck != other.conditionCheck) return false
        if (delete != other.delete) return false
        if (put != other.put) return false
        if (update != other.update) return false

        return true
    }

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

    public class Builder {
        /**
         * A request to perform a check item operation.
         */
        public var conditionCheck: aws.sdk.kotlin.services.dynamodb.model.ConditionCheck? = null
        /**
         * A request to perform a `DeleteItem` operation.
         */
        public var delete: aws.sdk.kotlin.services.dynamodb.model.Delete? = null
        /**
         * A request to perform a `PutItem` operation.
         */
        public var put: aws.sdk.kotlin.services.dynamodb.model.Put? = null
        /**
         * A request to perform an `UpdateItem` operation.
         */
        public var update: aws.sdk.kotlin.services.dynamodb.model.Update? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.dynamodb.model.TransactWriteItem) : this() {
            this.conditionCheck = x.conditionCheck
            this.delete = x.delete
            this.put = x.put
            this.update = x.update
        }

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

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

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

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

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy