
commonMain.aws.sdk.kotlin.services.migrationhub.model.Task.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.migrationhub.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Task object encapsulating task information.
*/
public class Task private constructor(builder: Builder) {
/**
* Indication of the percentage completion of the task.
*/
public val progressPercent: kotlin.Int? = builder.progressPercent
/**
* Status of the task - Not Started, In-Progress, Complete.
*/
public val status: aws.sdk.kotlin.services.migrationhub.model.Status = requireNotNull(builder.status) { "A non-null value must be provided for status" }
/**
* Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.
*/
public val statusDetail: kotlin.String? = builder.statusDetail
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.migrationhub.model.Task = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Task(")
append("progressPercent=$progressPercent,")
append("status=$status,")
append("statusDetail=$statusDetail")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = progressPercent ?: 0
result = 31 * result + (status.hashCode())
result = 31 * result + (statusDetail?.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 Task
if (progressPercent != other.progressPercent) return false
if (status != other.status) return false
if (statusDetail != other.statusDetail) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.migrationhub.model.Task = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Indication of the percentage completion of the task.
*/
public var progressPercent: kotlin.Int? = null
/**
* Status of the task - Not Started, In-Progress, Complete.
*/
public var status: aws.sdk.kotlin.services.migrationhub.model.Status? = null
/**
* Details of task status as notified by a migration tool. A tool might use this field to provide clarifying information about the status that is unique to that tool or that explains an error state.
*/
public var statusDetail: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.migrationhub.model.Task) : this() {
this.progressPercent = x.progressPercent
this.status = x.status
this.statusDetail = x.statusDetail
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.migrationhub.model.Task = Task(this)
internal fun correctErrors(): Builder {
if (status == null) status = Status.SdkUnknown("no value provided")
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy