commonMain.aws.sdk.kotlin.services.devicefarm.model.MonetaryAmount.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of devicefarm-jvm Show documentation
Show all versions of devicefarm-jvm Show documentation
The AWS SDK for Kotlin client for Device Farm
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.devicefarm.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* A number that represents the monetary amount for an offering or transaction.
*/
public class MonetaryAmount private constructor(builder: Builder) {
/**
* The numerical amount of an offering or transaction.
*/
public val amount: kotlin.Double? = builder.amount
/**
* The currency code of a monetary amount. For example, `USD` means U.S. dollars.
*/
public val currencyCode: aws.sdk.kotlin.services.devicefarm.model.CurrencyCode? = builder.currencyCode
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.devicefarm.model.MonetaryAmount = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("MonetaryAmount(")
append("amount=$amount,")
append("currencyCode=$currencyCode")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = amount?.hashCode() ?: 0
result = 31 * result + (currencyCode?.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 MonetaryAmount
if (!(amount?.equals(other.amount) ?: (other.amount == null))) return false
if (currencyCode != other.currencyCode) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.devicefarm.model.MonetaryAmount = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The numerical amount of an offering or transaction.
*/
public var amount: kotlin.Double? = null
/**
* The currency code of a monetary amount. For example, `USD` means U.S. dollars.
*/
public var currencyCode: aws.sdk.kotlin.services.devicefarm.model.CurrencyCode? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.devicefarm.model.MonetaryAmount) : this() {
this.amount = x.amount
this.currencyCode = x.currencyCode
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.devicefarm.model.MonetaryAmount = MonetaryAmount(this)
internal fun correctErrors(): Builder {
return this
}
}
}