commonMain.aws.sdk.kotlin.services.qldb.model.GetDigestResponse.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of qldb-jvm Show documentation
Show all versions of qldb-jvm Show documentation
The AWS SDK for Kotlin client for QLDB
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.qldb.model
import aws.smithy.kotlin.runtime.SdkDsl
public class GetDigestResponse private constructor(builder: Builder) {
/**
* The 256-bit hash value representing the digest returned by a `GetDigest` request.
*/
public val digest: kotlin.ByteArray = requireNotNull(builder.digest) { "A non-null value must be provided for digest" }
/**
* The latest block location covered by the digest that you requested. An address is an Amazon Ion structure that has two fields: `strandId` and `sequenceNo`.
*/
public val digestTipAddress: aws.sdk.kotlin.services.qldb.model.ValueHolder? = builder.digestTipAddress
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.qldb.model.GetDigestResponse = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("GetDigestResponse(")
append("digest=$digest,")
append("digestTipAddress=*** Sensitive Data Redacted ***")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = digest.contentHashCode()
result = 31 * result + (digestTipAddress?.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 GetDigestResponse
if (digest != null) {
if (other.digest == null) return false
if (!digest.contentEquals(other.digest)) return false
} else if (other.digest != null) return false
if (digestTipAddress != other.digestTipAddress) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.qldb.model.GetDigestResponse = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The 256-bit hash value representing the digest returned by a `GetDigest` request.
*/
public var digest: kotlin.ByteArray? = null
/**
* The latest block location covered by the digest that you requested. An address is an Amazon Ion structure that has two fields: `strandId` and `sequenceNo`.
*/
public var digestTipAddress: aws.sdk.kotlin.services.qldb.model.ValueHolder? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.qldb.model.GetDigestResponse) : this() {
this.digest = x.digest
this.digestTipAddress = x.digestTipAddress
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.qldb.model.GetDigestResponse = GetDigestResponse(this)
/**
* construct an [aws.sdk.kotlin.services.qldb.model.ValueHolder] inside the given [block]
*/
public fun digestTipAddress(block: aws.sdk.kotlin.services.qldb.model.ValueHolder.Builder.() -> kotlin.Unit) {
this.digestTipAddress = aws.sdk.kotlin.services.qldb.model.ValueHolder.invoke(block)
}
internal fun correctErrors(): Builder {
if (digest == null) digest = ByteArray(0)
return this
}
}
}