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

commonMain.aws.sdk.kotlin.services.devicefarm.model.RecurringCharge.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

/**
 * Specifies whether charges for devices are recurring.
 */
public class RecurringCharge private constructor(builder: Builder) {
    /**
     * The cost of the recurring charge.
     */
    public val cost: aws.sdk.kotlin.services.devicefarm.model.MonetaryAmount? = builder.cost
    /**
     * The frequency in which charges recur.
     */
    public val frequency: aws.sdk.kotlin.services.devicefarm.model.RecurringChargeFrequency? = builder.frequency

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

    override fun toString(): kotlin.String = buildString {
        append("RecurringCharge(")
        append("cost=$cost,")
        append("frequency=$frequency")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = cost?.hashCode() ?: 0
        result = 31 * result + (frequency?.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 RecurringCharge

        if (cost != other.cost) return false
        if (frequency != other.frequency) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The cost of the recurring charge.
         */
        public var cost: aws.sdk.kotlin.services.devicefarm.model.MonetaryAmount? = null
        /**
         * The frequency in which charges recur.
         */
        public var frequency: aws.sdk.kotlin.services.devicefarm.model.RecurringChargeFrequency? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.devicefarm.model.RecurringCharge) : this() {
            this.cost = x.cost
            this.frequency = x.frequency
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.devicefarm.model.RecurringCharge = RecurringCharge(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)
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy