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

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

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

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



/**
 * The container for the properties of a transaction event.
 */
public class TransactionEvent private constructor(builder: Builder) {
    /**
     * The blockchain address. for the contract
     */
    public val contractAddress: kotlin.String? = builder.contractAddress
    /**
     * The type of transaction event.
     */
    public val eventType: aws.sdk.kotlin.services.managedblockchainquery.model.QueryTransactionEventType = requireNotNull(builder.eventType) { "A non-null value must be provided for eventType" }
    /**
     * The wallet address initiating the transaction. It can either be a public key or a contract.
     */
    public val from: kotlin.String? = builder.from
    /**
     * The blockchain network where the transaction occurred.
     */
    public val network: aws.sdk.kotlin.services.managedblockchainquery.model.QueryNetwork = requireNotNull(builder.network) { "A non-null value must be provided for network" }
    /**
     * The wallet address receiving the transaction. It can either be a public key or a contract.
     */
    public val to: kotlin.String? = builder.to
    /**
     * The unique identifier for the token involved in the transaction.
     */
    public val tokenId: kotlin.String? = builder.tokenId
    /**
     * The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain.
     */
    public val transactionHash: kotlin.String = requireNotNull(builder.transactionHash) { "A non-null value must be provided for transactionHash" }
    /**
     * The unique identifier of the transaction. It is generated whenever a transaction is verified and added to the blockchain.
     */
    public val transactionId: kotlin.String? = builder.transactionId
    /**
     * The value that was transacted.
     */
    public val value: kotlin.String? = builder.value
    /**
     * The position of the vout in the transaction output list.
     */
    public val voutIndex: kotlin.Int? = builder.voutIndex

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

    override fun toString(): kotlin.String = buildString {
        append("TransactionEvent(")
        append("contractAddress=$contractAddress,")
        append("eventType=$eventType,")
        append("from=$from,")
        append("network=$network,")
        append("to=$to,")
        append("tokenId=$tokenId,")
        append("transactionHash=$transactionHash,")
        append("transactionId=$transactionId,")
        append("value=$value,")
        append("voutIndex=$voutIndex")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = contractAddress?.hashCode() ?: 0
        result = 31 * result + (eventType.hashCode())
        result = 31 * result + (from?.hashCode() ?: 0)
        result = 31 * result + (network.hashCode())
        result = 31 * result + (to?.hashCode() ?: 0)
        result = 31 * result + (tokenId?.hashCode() ?: 0)
        result = 31 * result + (transactionHash.hashCode())
        result = 31 * result + (transactionId?.hashCode() ?: 0)
        result = 31 * result + (value?.hashCode() ?: 0)
        result = 31 * result + (voutIndex ?: 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 TransactionEvent

        if (contractAddress != other.contractAddress) return false
        if (eventType != other.eventType) return false
        if (from != other.from) return false
        if (network != other.network) return false
        if (to != other.to) return false
        if (tokenId != other.tokenId) return false
        if (transactionHash != other.transactionHash) return false
        if (transactionId != other.transactionId) return false
        if (value != other.value) return false
        if (voutIndex != other.voutIndex) return false

        return true
    }

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

    public class Builder {
        /**
         * The blockchain address. for the contract
         */
        public var contractAddress: kotlin.String? = null
        /**
         * The type of transaction event.
         */
        public var eventType: aws.sdk.kotlin.services.managedblockchainquery.model.QueryTransactionEventType? = null
        /**
         * The wallet address initiating the transaction. It can either be a public key or a contract.
         */
        public var from: kotlin.String? = null
        /**
         * The blockchain network where the transaction occurred.
         */
        public var network: aws.sdk.kotlin.services.managedblockchainquery.model.QueryNetwork? = null
        /**
         * The wallet address receiving the transaction. It can either be a public key or a contract.
         */
        public var to: kotlin.String? = null
        /**
         * The unique identifier for the token involved in the transaction.
         */
        public var tokenId: kotlin.String? = null
        /**
         * The hash of the transaction. It is generated whenever a transaction is verified and added to the blockchain.
         */
        public var transactionHash: kotlin.String? = null
        /**
         * The unique identifier of the transaction. It is generated whenever a transaction is verified and added to the blockchain.
         */
        public var transactionId: kotlin.String? = null
        /**
         * The value that was transacted.
         */
        public var value: kotlin.String? = null
        /**
         * The position of the vout in the transaction output list.
         */
        public var voutIndex: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.managedblockchainquery.model.TransactionEvent) : this() {
            this.contractAddress = x.contractAddress
            this.eventType = x.eventType
            this.from = x.from
            this.network = x.network
            this.to = x.to
            this.tokenId = x.tokenId
            this.transactionHash = x.transactionHash
            this.transactionId = x.transactionId
            this.value = x.value
            this.voutIndex = x.voutIndex
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy