
commonMain.aws.sdk.kotlin.services.lightsail.model.EstimateByTime.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.lightsail.model
/**
* An estimate that's associated with a time period.
*/
public class EstimateByTime private constructor(builder: Builder) {
/**
* The currency of the estimate in USD.
*/
public val currency: aws.sdk.kotlin.services.lightsail.model.Currency? = builder.currency
/**
* The unit of measurement that's used for the cost estimate.
*/
public val pricingUnit: aws.sdk.kotlin.services.lightsail.model.PricingUnit? = builder.pricingUnit
/**
* The period of time, in days, that an estimate covers. The period has a start date and an end date. The start date must come before the end date.
*/
public val timePeriod: aws.sdk.kotlin.services.lightsail.model.TimePeriod? = builder.timePeriod
/**
* The number of pricing units used to calculate the total number of hours. For example, 1 unit equals 1 hour.
*/
public val unit: kotlin.Double? = builder.unit
/**
* The amount of cost or usage that's measured for the cost estimate.
*/
public val usageCost: kotlin.Double? = builder.usageCost
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.lightsail.model.EstimateByTime = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("EstimateByTime(")
append("currency=$currency,")
append("pricingUnit=$pricingUnit,")
append("timePeriod=$timePeriod,")
append("unit=$unit,")
append("usageCost=$usageCost")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = currency?.hashCode() ?: 0
result = 31 * result + (pricingUnit?.hashCode() ?: 0)
result = 31 * result + (timePeriod?.hashCode() ?: 0)
result = 31 * result + (unit?.hashCode() ?: 0)
result = 31 * result + (usageCost?.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 EstimateByTime
if (currency != other.currency) return false
if (pricingUnit != other.pricingUnit) return false
if (timePeriod != other.timePeriod) return false
if (unit != other.unit) return false
if (usageCost != other.usageCost) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.lightsail.model.EstimateByTime = Builder(this).apply(block).build()
public class Builder {
/**
* The currency of the estimate in USD.
*/
public var currency: aws.sdk.kotlin.services.lightsail.model.Currency? = null
/**
* The unit of measurement that's used for the cost estimate.
*/
public var pricingUnit: aws.sdk.kotlin.services.lightsail.model.PricingUnit? = null
/**
* The period of time, in days, that an estimate covers. The period has a start date and an end date. The start date must come before the end date.
*/
public var timePeriod: aws.sdk.kotlin.services.lightsail.model.TimePeriod? = null
/**
* The number of pricing units used to calculate the total number of hours. For example, 1 unit equals 1 hour.
*/
public var unit: kotlin.Double? = null
/**
* The amount of cost or usage that's measured for the cost estimate.
*/
public var usageCost: kotlin.Double? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.lightsail.model.EstimateByTime) : this() {
this.currency = x.currency
this.pricingUnit = x.pricingUnit
this.timePeriod = x.timePeriod
this.unit = x.unit
this.usageCost = x.usageCost
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.lightsail.model.EstimateByTime = EstimateByTime(this)
/**
* construct an [aws.sdk.kotlin.services.lightsail.model.TimePeriod] inside the given [block]
*/
public fun timePeriod(block: aws.sdk.kotlin.services.lightsail.model.TimePeriod.Builder.() -> kotlin.Unit) {
this.timePeriod = aws.sdk.kotlin.services.lightsail.model.TimePeriod.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy