aws.sdk.kotlin.services.sagemaker.model.LabelingJobStoppingConditions.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.sagemaker.model
/**
* A set of conditions for stopping a labeling job. If any of the conditions are met, the
* job is automatically stopped. You can use these conditions to control the cost of data
* labeling.
* Labeling jobs fail after 30 days with an appropriate client error message.
*/
class LabelingJobStoppingConditions private constructor(builder: BuilderImpl) {
/**
* The maximum number of objects that can be labeled by human workers.
*/
val maxHumanLabeledObjectCount: Int? = builder.maxHumanLabeledObjectCount
/**
* The maximum number of input data objects that should be labeled.
*/
val maxPercentageOfInputDatasetLabeled: Int? = builder.maxPercentageOfInputDatasetLabeled
companion object {
@JvmStatic
fun fluentBuilder(): FluentBuilder = BuilderImpl()
internal fun builder(): DslBuilder = BuilderImpl()
operator fun invoke(block: DslBuilder.() -> kotlin.Unit): LabelingJobStoppingConditions = BuilderImpl().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("LabelingJobStoppingConditions(")
append("maxHumanLabeledObjectCount=$maxHumanLabeledObjectCount,")
append("maxPercentageOfInputDatasetLabeled=$maxPercentageOfInputDatasetLabeled)")
}
override fun hashCode(): kotlin.Int {
var result = maxHumanLabeledObjectCount ?: 0
result = 31 * result + (maxPercentageOfInputDatasetLabeled ?: 0)
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as LabelingJobStoppingConditions
if (maxHumanLabeledObjectCount != other.maxHumanLabeledObjectCount) return false
if (maxPercentageOfInputDatasetLabeled != other.maxPercentageOfInputDatasetLabeled) return false
return true
}
fun copy(block: DslBuilder.() -> kotlin.Unit = {}): LabelingJobStoppingConditions = BuilderImpl(this).apply(block).build()
interface FluentBuilder {
fun build(): LabelingJobStoppingConditions
/**
* The maximum number of objects that can be labeled by human workers.
*/
fun maxHumanLabeledObjectCount(maxHumanLabeledObjectCount: Int): FluentBuilder
/**
* The maximum number of input data objects that should be labeled.
*/
fun maxPercentageOfInputDatasetLabeled(maxPercentageOfInputDatasetLabeled: Int): FluentBuilder
}
interface DslBuilder {
/**
* The maximum number of objects that can be labeled by human workers.
*/
var maxHumanLabeledObjectCount: Int?
/**
* The maximum number of input data objects that should be labeled.
*/
var maxPercentageOfInputDatasetLabeled: Int?
fun build(): LabelingJobStoppingConditions
}
private class BuilderImpl() : FluentBuilder, DslBuilder {
override var maxHumanLabeledObjectCount: Int? = null
override var maxPercentageOfInputDatasetLabeled: Int? = null
constructor(x: LabelingJobStoppingConditions) : this() {
this.maxHumanLabeledObjectCount = x.maxHumanLabeledObjectCount
this.maxPercentageOfInputDatasetLabeled = x.maxPercentageOfInputDatasetLabeled
}
override fun build(): LabelingJobStoppingConditions = LabelingJobStoppingConditions(this)
override fun maxHumanLabeledObjectCount(maxHumanLabeledObjectCount: Int): FluentBuilder = apply { this.maxHumanLabeledObjectCount = maxHumanLabeledObjectCount }
override fun maxPercentageOfInputDatasetLabeled(maxPercentageOfInputDatasetLabeled: Int): FluentBuilder = apply { this.maxPercentageOfInputDatasetLabeled = maxPercentageOfInputDatasetLabeled }
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy