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

commonMain.aws.sdk.kotlin.services.managedblockchainquery.model.GetTokenBalanceResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.managedblockchainquery.model



public class GetTokenBalanceResponse private constructor(builder: Builder) {
    /**
     * The container for time.
     */
    public val atBlockchainInstant: aws.sdk.kotlin.services.managedblockchainquery.model.BlockchainInstant? = builder.atBlockchainInstant
    /**
     * The container for the token balance.
     */
    public val balance: kotlin.String = requireNotNull(builder.balance) { "A non-null value must be provided for balance" }
    /**
     * The container for time.
     */
    public val lastUpdatedTime: aws.sdk.kotlin.services.managedblockchainquery.model.BlockchainInstant? = builder.lastUpdatedTime
    /**
     * 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.GetTokenBalanceResponse = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("GetTokenBalanceResponse(")
        append("atBlockchainInstant=$atBlockchainInstant,")
        append("balance=$balance,")
        append("lastUpdatedTime=$lastUpdatedTime,")
        append("ownerIdentifier=$ownerIdentifier,")
        append("tokenIdentifier=$tokenIdentifier")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = atBlockchainInstant?.hashCode() ?: 0
        result = 31 * result + (balance.hashCode())
        result = 31 * result + (lastUpdatedTime?.hashCode() ?: 0)
        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 GetTokenBalanceResponse

        if (atBlockchainInstant != other.atBlockchainInstant) return false
        if (balance != other.balance) return false
        if (lastUpdatedTime != other.lastUpdatedTime) 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.GetTokenBalanceResponse = Builder(this).apply(block).build()

    public class Builder {
        /**
         * The container for time.
         */
        public var atBlockchainInstant: aws.sdk.kotlin.services.managedblockchainquery.model.BlockchainInstant? = null
        /**
         * The container for the token balance.
         */
        public var balance: kotlin.String? = null
        /**
         * The container for time.
         */
        public var lastUpdatedTime: aws.sdk.kotlin.services.managedblockchainquery.model.BlockchainInstant? = 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.GetTokenBalanceResponse) : this() {
            this.atBlockchainInstant = x.atBlockchainInstant
            this.balance = x.balance
            this.lastUpdatedTime = x.lastUpdatedTime
            this.ownerIdentifier = x.ownerIdentifier
            this.tokenIdentifier = x.tokenIdentifier
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.managedblockchainquery.model.GetTokenBalanceResponse = GetTokenBalanceResponse(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.BlockchainInstant] inside the given [block]
         */
        public fun lastUpdatedTime(block: aws.sdk.kotlin.services.managedblockchainquery.model.BlockchainInstant.Builder.() -> kotlin.Unit) {
            this.lastUpdatedTime = 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 (balance == null) balance = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy