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

commonMain.aws.sdk.kotlin.services.devicefarm.model.OfferingTransaction.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.devicefarm.model

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant

/**
 * Represents the metadata of an offering transaction.
 */
public class OfferingTransaction private constructor(builder: Builder) {
    /**
     * The cost of an offering transaction.
     */
    public val cost: aws.sdk.kotlin.services.devicefarm.model.MonetaryAmount? = builder.cost
    /**
     * The date on which an offering transaction was created.
     */
    public val createdOn: aws.smithy.kotlin.runtime.time.Instant? = builder.createdOn
    /**
     * The ID that corresponds to a device offering promotion.
     */
    public val offeringPromotionId: kotlin.String? = builder.offeringPromotionId
    /**
     * The status of an offering transaction.
     */
    public val offeringStatus: aws.sdk.kotlin.services.devicefarm.model.OfferingStatus? = builder.offeringStatus
    /**
     * The transaction ID of the offering transaction.
     */
    public val transactionId: kotlin.String? = builder.transactionId

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

    override fun toString(): kotlin.String = buildString {
        append("OfferingTransaction(")
        append("cost=$cost,")
        append("createdOn=$createdOn,")
        append("offeringPromotionId=$offeringPromotionId,")
        append("offeringStatus=$offeringStatus,")
        append("transactionId=$transactionId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = cost?.hashCode() ?: 0
        result = 31 * result + (createdOn?.hashCode() ?: 0)
        result = 31 * result + (offeringPromotionId?.hashCode() ?: 0)
        result = 31 * result + (offeringStatus?.hashCode() ?: 0)
        result = 31 * result + (transactionId?.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 OfferingTransaction

        if (cost != other.cost) return false
        if (createdOn != other.createdOn) return false
        if (offeringPromotionId != other.offeringPromotionId) return false
        if (offeringStatus != other.offeringStatus) return false
        if (transactionId != other.transactionId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The cost of an offering transaction.
         */
        public var cost: aws.sdk.kotlin.services.devicefarm.model.MonetaryAmount? = null
        /**
         * The date on which an offering transaction was created.
         */
        public var createdOn: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The ID that corresponds to a device offering promotion.
         */
        public var offeringPromotionId: kotlin.String? = null
        /**
         * The status of an offering transaction.
         */
        public var offeringStatus: aws.sdk.kotlin.services.devicefarm.model.OfferingStatus? = null
        /**
         * The transaction ID of the offering transaction.
         */
        public var transactionId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.devicefarm.model.OfferingTransaction) : this() {
            this.cost = x.cost
            this.createdOn = x.createdOn
            this.offeringPromotionId = x.offeringPromotionId
            this.offeringStatus = x.offeringStatus
            this.transactionId = x.transactionId
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.devicefarm.model.MonetaryAmount] inside the given [block]
         */
        public fun cost(block: aws.sdk.kotlin.services.devicefarm.model.MonetaryAmount.Builder.() -> kotlin.Unit) {
            this.cost = aws.sdk.kotlin.services.devicefarm.model.MonetaryAmount.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.devicefarm.model.OfferingStatus] inside the given [block]
         */
        public fun offeringStatus(block: aws.sdk.kotlin.services.devicefarm.model.OfferingStatus.Builder.() -> kotlin.Unit) {
            this.offeringStatus = aws.sdk.kotlin.services.devicefarm.model.OfferingStatus.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy