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

commonMain.aws.sdk.kotlin.services.budgets.model.BudgetedAndActualAmounts.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.budgets.model



/**
 * The amount of cost or usage that you created the budget for, compared to your actual costs or usage.
 */
public class BudgetedAndActualAmounts private constructor(builder: Builder) {
    /**
     * Your actual costs or usage for a budget period.
     */
    public val actualAmount: aws.sdk.kotlin.services.budgets.model.Spend? = builder.actualAmount
    /**
     * The amount of cost or usage that you created the budget for.
     */
    public val budgetedAmount: aws.sdk.kotlin.services.budgets.model.Spend? = builder.budgetedAmount
    /**
     * The time period that's covered by this budget comparison.
     */
    public val timePeriod: aws.sdk.kotlin.services.budgets.model.TimePeriod? = builder.timePeriod

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

    override fun toString(): kotlin.String = buildString {
        append("BudgetedAndActualAmounts(")
        append("actualAmount=$actualAmount,")
        append("budgetedAmount=$budgetedAmount,")
        append("timePeriod=$timePeriod)")
    }

    override fun hashCode(): kotlin.Int {
        var result = actualAmount?.hashCode() ?: 0
        result = 31 * result + (budgetedAmount?.hashCode() ?: 0)
        result = 31 * result + (timePeriod?.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 BudgetedAndActualAmounts

        if (actualAmount != other.actualAmount) return false
        if (budgetedAmount != other.budgetedAmount) return false
        if (timePeriod != other.timePeriod) return false

        return true
    }

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

    public class Builder {
        /**
         * Your actual costs or usage for a budget period.
         */
        public var actualAmount: aws.sdk.kotlin.services.budgets.model.Spend? = null
        /**
         * The amount of cost or usage that you created the budget for.
         */
        public var budgetedAmount: aws.sdk.kotlin.services.budgets.model.Spend? = null
        /**
         * The time period that's covered by this budget comparison.
         */
        public var timePeriod: aws.sdk.kotlin.services.budgets.model.TimePeriod? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.budgets.model.BudgetedAndActualAmounts) : this() {
            this.actualAmount = x.actualAmount
            this.budgetedAmount = x.budgetedAmount
            this.timePeriod = x.timePeriod
        }

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy