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

commonMain.aws.sdk.kotlin.services.dynamodbstreams.model.Shard.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.dynamodbstreams.model



/**
 * A uniquely identified group of stream records within a stream.
 */
public class Shard private constructor(builder: Builder) {
    /**
     * The shard ID of the current shard's parent.
     */
    public val parentShardId: kotlin.String? = builder.parentShardId
    /**
     * The range of possible sequence numbers for the shard.
     */
    public val sequenceNumberRange: aws.sdk.kotlin.services.dynamodbstreams.model.SequenceNumberRange? = builder.sequenceNumberRange
    /**
     * The system-generated identifier for this shard.
     */
    public val shardId: kotlin.String? = builder.shardId

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

    override fun toString(): kotlin.String = buildString {
        append("Shard(")
        append("parentShardId=$parentShardId,")
        append("sequenceNumberRange=$sequenceNumberRange,")
        append("shardId=$shardId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = parentShardId?.hashCode() ?: 0
        result = 31 * result + (sequenceNumberRange?.hashCode() ?: 0)
        result = 31 * result + (shardId?.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 Shard

        if (parentShardId != other.parentShardId) return false
        if (sequenceNumberRange != other.sequenceNumberRange) return false
        if (shardId != other.shardId) return false

        return true
    }

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

    public class Builder {
        /**
         * The shard ID of the current shard's parent.
         */
        public var parentShardId: kotlin.String? = null
        /**
         * The range of possible sequence numbers for the shard.
         */
        public var sequenceNumberRange: aws.sdk.kotlin.services.dynamodbstreams.model.SequenceNumberRange? = null
        /**
         * The system-generated identifier for this shard.
         */
        public var shardId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.dynamodbstreams.model.Shard) : this() {
            this.parentShardId = x.parentShardId
            this.sequenceNumberRange = x.sequenceNumberRange
            this.shardId = x.shardId
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy