commonMain.aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SpendLimit.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pinpointsmsvoicev2-jvm Show documentation
Show all versions of pinpointsmsvoicev2-jvm Show documentation
The AWS SDK for Kotlin client for Pinpoint SMS Voice V2
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.pinpointsmsvoicev2.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Describes the current monthly spend limits for sending voice and text messages. For more information on increasing your monthly spend limit, see [ Requesting a spending quota increase ](https://docs.aws.amazon.com/sms-voice/latest/userguide/awssupport-spend-threshold.html) in the *AWS End User Messaging SMS User Guide*.
*/
public class SpendLimit private constructor(builder: Builder) {
/**
* The maximum amount of money, in US dollars, that you want to be able to spend sending messages each month. This value has to be less than or equal to the amount in `MaxLimit`. To use this custom limit, `Overridden` must be set to true.
*/
public val enforcedLimit: kotlin.Long = builder.enforcedLimit
/**
* The maximum amount of money that you are able to spend to send messages each month, in US dollars.
*/
public val maxLimit: kotlin.Long = builder.maxLimit
/**
* The name for the SpendLimit.
*/
public val name: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SpendLimitName = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* When set to `True`, the value that has been specified in the `EnforcedLimit` is used to determine the maximum amount in US dollars that can be spent to send messages each month, in US dollars.
*/
public val overridden: kotlin.Boolean = builder.overridden
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SpendLimit = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("SpendLimit(")
append("enforcedLimit=$enforcedLimit,")
append("maxLimit=$maxLimit,")
append("name=$name,")
append("overridden=$overridden")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = enforcedLimit.hashCode()
result = 31 * result + (maxLimit.hashCode())
result = 31 * result + (name.hashCode())
result = 31 * result + (overridden.hashCode())
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 SpendLimit
if (enforcedLimit != other.enforcedLimit) return false
if (maxLimit != other.maxLimit) return false
if (name != other.name) return false
if (overridden != other.overridden) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SpendLimit = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The maximum amount of money, in US dollars, that you want to be able to spend sending messages each month. This value has to be less than or equal to the amount in `MaxLimit`. To use this custom limit, `Overridden` must be set to true.
*/
public var enforcedLimit: kotlin.Long = 0L
/**
* The maximum amount of money that you are able to spend to send messages each month, in US dollars.
*/
public var maxLimit: kotlin.Long = 0L
/**
* The name for the SpendLimit.
*/
public var name: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SpendLimitName? = null
/**
* When set to `True`, the value that has been specified in the `EnforcedLimit` is used to determine the maximum amount in US dollars that can be spent to send messages each month, in US dollars.
*/
public var overridden: kotlin.Boolean = false
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SpendLimit) : this() {
this.enforcedLimit = x.enforcedLimit
this.maxLimit = x.maxLimit
this.name = x.name
this.overridden = x.overridden
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.pinpointsmsvoicev2.model.SpendLimit = SpendLimit(this)
internal fun correctErrors(): Builder {
if (name == null) name = SpendLimitName.SdkUnknown("no value provided")
return this
}
}
}