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

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

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

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



/**
 * Represents a request to perform a `PutItem` operation on an item.
 */
public class PutRequest private constructor(builder: Builder) {
    /**
     * A map of attribute name to attribute values, representing the primary key of an item to be processed by `PutItem`. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema. If any attributes are present in the item that are part of an index key schema for the table, their types must match the index key schema.
     */
    public val item: Map = requireNotNull(builder.item) { "A non-null value must be provided for item" }

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

    override fun toString(): kotlin.String = buildString {
        append("PutRequest(")
        append("item=$item")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = item.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 PutRequest

        if (item != other.item) return false

        return true
    }

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

    public class Builder {
        /**
         * A map of attribute name to attribute values, representing the primary key of an item to be processed by `PutItem`. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema. If any attributes are present in the item that are part of an index key schema for the table, their types must match the index key schema.
         */
        public var item: Map? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.dynamodb.model.PutRequest) : this() {
            this.item = x.item
        }

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

        internal fun correctErrors(): Builder {
            if (item == null) item = emptyMap()
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy