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

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

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

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



/**
 * Represents the amount of provisioned throughput capacity consumed on a table or an index.
 */
public class Capacity private constructor(builder: Builder) {
    /**
     * The total number of capacity units consumed on a table or an index.
     */
    public val capacityUnits: kotlin.Double? = builder.capacityUnits
    /**
     * The total number of read capacity units consumed on a table or an index.
     */
    public val readCapacityUnits: kotlin.Double? = builder.readCapacityUnits
    /**
     * The total number of write capacity units consumed on a table or an index.
     */
    public val writeCapacityUnits: kotlin.Double? = builder.writeCapacityUnits

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

    override fun toString(): kotlin.String = buildString {
        append("Capacity(")
        append("capacityUnits=$capacityUnits,")
        append("readCapacityUnits=$readCapacityUnits,")
        append("writeCapacityUnits=$writeCapacityUnits")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = capacityUnits?.hashCode() ?: 0
        result = 31 * result + (readCapacityUnits?.hashCode() ?: 0)
        result = 31 * result + (writeCapacityUnits?.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 Capacity

        if (capacityUnits != other.capacityUnits) return false
        if (readCapacityUnits != other.readCapacityUnits) return false
        if (writeCapacityUnits != other.writeCapacityUnits) return false

        return true
    }

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

    public class Builder {
        /**
         * The total number of capacity units consumed on a table or an index.
         */
        public var capacityUnits: kotlin.Double? = null
        /**
         * The total number of read capacity units consumed on a table or an index.
         */
        public var readCapacityUnits: kotlin.Double? = null
        /**
         * The total number of write capacity units consumed on a table or an index.
         */
        public var writeCapacityUnits: kotlin.Double? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.dynamodb.model.Capacity) : this() {
            this.capacityUnits = x.capacityUnits
            this.readCapacityUnits = x.readCapacityUnits
            this.writeCapacityUnits = x.writeCapacityUnits
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy