commonMain.aws.sdk.kotlin.services.deadline.model.ResponseBudgetAction.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deadline-jvm Show documentation
Show all versions of deadline-jvm Show documentation
The AWS SDK for Kotlin client for deadline
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.deadline.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* The details of a budget action.
*/
public class ResponseBudgetAction private constructor(builder: Builder) {
/**
* The budget action description.
*
* This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.
*/
public val description: kotlin.String? = builder.description
/**
* The percentage threshold for the budget.
*/
public val thresholdPercentage: kotlin.Float = requireNotNull(builder.thresholdPercentage) { "A non-null value must be provided for thresholdPercentage" }
/**
* The action taken on the budget once scheduling stops.
*/
public val type: aws.sdk.kotlin.services.deadline.model.BudgetActionType = requireNotNull(builder.type) { "A non-null value must be provided for type" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.deadline.model.ResponseBudgetAction = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ResponseBudgetAction(")
append("description=*** Sensitive Data Redacted ***,")
append("thresholdPercentage=$thresholdPercentage,")
append("type=$type")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = description?.hashCode() ?: 0
result = 31 * result + (thresholdPercentage.hashCode())
result = 31 * result + (type.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 ResponseBudgetAction
if (description != other.description) return false
if (!(thresholdPercentage?.equals(other.thresholdPercentage) ?: (other.thresholdPercentage == null))) return false
if (type != other.type) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.deadline.model.ResponseBudgetAction = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The budget action description.
*
* This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.
*/
public var description: kotlin.String? = null
/**
* The percentage threshold for the budget.
*/
public var thresholdPercentage: kotlin.Float? = null
/**
* The action taken on the budget once scheduling stops.
*/
public var type: aws.sdk.kotlin.services.deadline.model.BudgetActionType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.deadline.model.ResponseBudgetAction) : this() {
this.description = x.description
this.thresholdPercentage = x.thresholdPercentage
this.type = x.type
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.deadline.model.ResponseBudgetAction = ResponseBudgetAction(this)
internal fun correctErrors(): Builder {
if (thresholdPercentage == null) thresholdPercentage = 0f
if (type == null) type = BudgetActionType.SdkUnknown("no value provided")
return this
}
}
}