
commonMain.aws.sdk.kotlin.services.managedblockchainquery.model.BatchGetTokenBalanceErrorItem.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.managedblockchainquery.model
/**
* Error generated from a failed `BatchGetTokenBalance` request.
*/
public class BatchGetTokenBalanceErrorItem private constructor(builder: Builder) {
/**
* The container for time.
*/
public val atBlockchainInstant: aws.sdk.kotlin.services.managedblockchainquery.model.BlockchainInstant? = builder.atBlockchainInstant
/**
* The error code associated with the error.
*/
public val errorCode: kotlin.String = requireNotNull(builder.errorCode) { "A non-null value must be provided for errorCode" }
/**
* The message associated with the error.
*/
public val errorMessage: kotlin.String = requireNotNull(builder.errorMessage) { "A non-null value must be provided for errorMessage" }
/**
* The type of error.
*/
public val errorType: aws.sdk.kotlin.services.managedblockchainquery.model.ErrorType = requireNotNull(builder.errorType) { "A non-null value must be provided for errorType" }
/**
* The container for the identifier of the owner.
*/
public val ownerIdentifier: aws.sdk.kotlin.services.managedblockchainquery.model.OwnerIdentifier? = builder.ownerIdentifier
/**
* The container for the identifier for the token including the unique token ID and its blockchain network.
*
* Only the native tokens BTC and ETH, and the ERC-20, ERC-721, and ERC 1155 token standards are supported.
*/
public val tokenIdentifier: aws.sdk.kotlin.services.managedblockchainquery.model.TokenIdentifier? = builder.tokenIdentifier
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.managedblockchainquery.model.BatchGetTokenBalanceErrorItem = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("BatchGetTokenBalanceErrorItem(")
append("atBlockchainInstant=$atBlockchainInstant,")
append("errorCode=$errorCode,")
append("errorMessage=$errorMessage,")
append("errorType=$errorType,")
append("ownerIdentifier=$ownerIdentifier,")
append("tokenIdentifier=$tokenIdentifier")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = atBlockchainInstant?.hashCode() ?: 0
result = 31 * result + (errorCode.hashCode())
result = 31 * result + (errorMessage.hashCode())
result = 31 * result + (errorType.hashCode())
result = 31 * result + (ownerIdentifier?.hashCode() ?: 0)
result = 31 * result + (tokenIdentifier?.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 BatchGetTokenBalanceErrorItem
if (atBlockchainInstant != other.atBlockchainInstant) return false
if (errorCode != other.errorCode) return false
if (errorMessage != other.errorMessage) return false
if (errorType != other.errorType) return false
if (ownerIdentifier != other.ownerIdentifier) return false
if (tokenIdentifier != other.tokenIdentifier) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.managedblockchainquery.model.BatchGetTokenBalanceErrorItem = Builder(this).apply(block).build()
public class Builder {
/**
* The container for time.
*/
public var atBlockchainInstant: aws.sdk.kotlin.services.managedblockchainquery.model.BlockchainInstant? = null
/**
* The error code associated with the error.
*/
public var errorCode: kotlin.String? = null
/**
* The message associated with the error.
*/
public var errorMessage: kotlin.String? = null
/**
* The type of error.
*/
public var errorType: aws.sdk.kotlin.services.managedblockchainquery.model.ErrorType? = null
/**
* The container for the identifier of the owner.
*/
public var ownerIdentifier: aws.sdk.kotlin.services.managedblockchainquery.model.OwnerIdentifier? = null
/**
* The container for the identifier for the token including the unique token ID and its blockchain network.
*
* Only the native tokens BTC and ETH, and the ERC-20, ERC-721, and ERC 1155 token standards are supported.
*/
public var tokenIdentifier: aws.sdk.kotlin.services.managedblockchainquery.model.TokenIdentifier? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.managedblockchainquery.model.BatchGetTokenBalanceErrorItem) : this() {
this.atBlockchainInstant = x.atBlockchainInstant
this.errorCode = x.errorCode
this.errorMessage = x.errorMessage
this.errorType = x.errorType
this.ownerIdentifier = x.ownerIdentifier
this.tokenIdentifier = x.tokenIdentifier
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.managedblockchainquery.model.BatchGetTokenBalanceErrorItem = BatchGetTokenBalanceErrorItem(this)
/**
* construct an [aws.sdk.kotlin.services.managedblockchainquery.model.BlockchainInstant] inside the given [block]
*/
public fun atBlockchainInstant(block: aws.sdk.kotlin.services.managedblockchainquery.model.BlockchainInstant.Builder.() -> kotlin.Unit) {
this.atBlockchainInstant = aws.sdk.kotlin.services.managedblockchainquery.model.BlockchainInstant.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.managedblockchainquery.model.OwnerIdentifier] inside the given [block]
*/
public fun ownerIdentifier(block: aws.sdk.kotlin.services.managedblockchainquery.model.OwnerIdentifier.Builder.() -> kotlin.Unit) {
this.ownerIdentifier = aws.sdk.kotlin.services.managedblockchainquery.model.OwnerIdentifier.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.managedblockchainquery.model.TokenIdentifier] inside the given [block]
*/
public fun tokenIdentifier(block: aws.sdk.kotlin.services.managedblockchainquery.model.TokenIdentifier.Builder.() -> kotlin.Unit) {
this.tokenIdentifier = aws.sdk.kotlin.services.managedblockchainquery.model.TokenIdentifier.invoke(block)
}
internal fun correctErrors(): Builder {
if (errorCode == null) errorCode = ""
if (errorMessage == null) errorMessage = ""
if (errorType == null) errorType = ErrorType.SdkUnknown("no value provided")
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy