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

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

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

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



/**
 * 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 class TokenIdentifier private constructor(builder: Builder) {
    /**
     * This is the token's contract address.
     */
    public val contractAddress: kotlin.String? = builder.contractAddress
    /**
     * The blockchain network of the token.
     */
    public val network: aws.sdk.kotlin.services.managedblockchainquery.model.QueryNetwork = requireNotNull(builder.network) { "A non-null value must be provided for network" }
    /**
     * The unique identifier of the token.
     *
     * For native tokens, use the 3 character abbreviation that best matches your token. For example, btc for Bitcoin, eth for Ether, etc. For all other token types you must specify the `tokenId` in the 64 character hexadecimal `tokenid` format.
     */
    public val tokenId: kotlin.String? = builder.tokenId

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

    override fun toString(): kotlin.String = buildString {
        append("TokenIdentifier(")
        append("contractAddress=$contractAddress,")
        append("network=$network,")
        append("tokenId=$tokenId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = contractAddress?.hashCode() ?: 0
        result = 31 * result + (network.hashCode())
        result = 31 * result + (tokenId?.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 TokenIdentifier

        if (contractAddress != other.contractAddress) return false
        if (network != other.network) return false
        if (tokenId != other.tokenId) return false

        return true
    }

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

    public class Builder {
        /**
         * This is the token's contract address.
         */
        public var contractAddress: kotlin.String? = null
        /**
         * The blockchain network of the token.
         */
        public var network: aws.sdk.kotlin.services.managedblockchainquery.model.QueryNetwork? = null
        /**
         * The unique identifier of the token.
         *
         * For native tokens, use the 3 character abbreviation that best matches your token. For example, btc for Bitcoin, eth for Ether, etc. For all other token types you must specify the `tokenId` in the 64 character hexadecimal `tokenid` format.
         */
        public var tokenId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.managedblockchainquery.model.TokenIdentifier) : this() {
            this.contractAddress = x.contractAddress
            this.network = x.network
            this.tokenId = x.tokenId
        }

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

        internal fun correctErrors(): Builder {
            if (network == null) network = QueryNetwork.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy