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

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

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

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



/**
 * Represents the output of a `PutItem` operation.
 */
public class PutItemResponse private constructor(builder: Builder) {
    /**
     * The attribute values as they appeared before the `PutItem` operation, but only if `ReturnValues` is specified as `ALL_OLD` in the request. Each element consists of an attribute name and an attribute value.
     */
    public val attributes: Map? = builder.attributes
    /**
     * The capacity units consumed by the `PutItem` operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` parameter was specified. For more information, see [Provisioned Throughput](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) in the *Amazon DynamoDB Developer Guide*.
     */
    public val consumedCapacity: aws.sdk.kotlin.services.dynamodb.model.ConsumedCapacity? = builder.consumedCapacity
    /**
     * Information about item collections, if any, that were affected by the `PutItem` operation. `ItemCollectionMetrics` is only returned if the `ReturnItemCollectionMetrics` parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.
     *
     * Each `ItemCollectionMetrics` element consists of:
     * + `ItemCollectionKey` - The partition key value of the item collection. This is the same as the partition key value of the item itself.
     * + `SizeEstimateRangeGB` - An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.
     */
    public val itemCollectionMetrics: aws.sdk.kotlin.services.dynamodb.model.ItemCollectionMetrics? = builder.itemCollectionMetrics

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

    override fun toString(): kotlin.String = buildString {
        append("PutItemResponse(")
        append("attributes=$attributes,")
        append("consumedCapacity=$consumedCapacity,")
        append("itemCollectionMetrics=$itemCollectionMetrics")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = attributes?.hashCode() ?: 0
        result = 31 * result + (consumedCapacity?.hashCode() ?: 0)
        result = 31 * result + (itemCollectionMetrics?.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 PutItemResponse

        if (attributes != other.attributes) return false
        if (consumedCapacity != other.consumedCapacity) return false
        if (itemCollectionMetrics != other.itemCollectionMetrics) return false

        return true
    }

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

    public class Builder {
        /**
         * The attribute values as they appeared before the `PutItem` operation, but only if `ReturnValues` is specified as `ALL_OLD` in the request. Each element consists of an attribute name and an attribute value.
         */
        public var attributes: Map? = null
        /**
         * The capacity units consumed by the `PutItem` operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` parameter was specified. For more information, see [Provisioned Throughput](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) in the *Amazon DynamoDB Developer Guide*.
         */
        public var consumedCapacity: aws.sdk.kotlin.services.dynamodb.model.ConsumedCapacity? = null
        /**
         * Information about item collections, if any, that were affected by the `PutItem` operation. `ItemCollectionMetrics` is only returned if the `ReturnItemCollectionMetrics` parameter was specified. If the table does not have any local secondary indexes, this information is not returned in the response.
         *
         * Each `ItemCollectionMetrics` element consists of:
         * + `ItemCollectionKey` - The partition key value of the item collection. This is the same as the partition key value of the item itself.
         * + `SizeEstimateRangeGB` - An estimate of item collection size, in gigabytes. This value is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on that table. Use this estimate to measure whether a local secondary index is approaching its size limit.The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.
         */
        public var itemCollectionMetrics: aws.sdk.kotlin.services.dynamodb.model.ItemCollectionMetrics? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.dynamodb.model.PutItemResponse) : this() {
            this.attributes = x.attributes
            this.consumedCapacity = x.consumedCapacity
            this.itemCollectionMetrics = x.itemCollectionMetrics
        }

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy