commonMain.aws.sdk.kotlin.services.iotsitewise.model.AssetStatus.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iotsitewise-jvm Show documentation
Show all versions of iotsitewise-jvm Show documentation
The AWS SDK for Kotlin client for IoTSiteWise
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.iotsitewise.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Contains information about the current status of an asset. For more information, see [Asset and model states](https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-and-model-states.html) in the *IoT SiteWise User Guide*.
*/
public class AssetStatus private constructor(builder: Builder) {
/**
* Contains associated error information, if any.
*/
public val error: aws.sdk.kotlin.services.iotsitewise.model.ErrorDetails? = builder.error
/**
* The current status of the asset.
*/
public val state: aws.sdk.kotlin.services.iotsitewise.model.AssetState = requireNotNull(builder.state) { "A non-null value must be provided for state" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.iotsitewise.model.AssetStatus = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("AssetStatus(")
append("error=$error,")
append("state=$state")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = error?.hashCode() ?: 0
result = 31 * result + (state.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 AssetStatus
if (error != other.error) return false
if (state != other.state) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.iotsitewise.model.AssetStatus = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Contains associated error information, if any.
*/
public var error: aws.sdk.kotlin.services.iotsitewise.model.ErrorDetails? = null
/**
* The current status of the asset.
*/
public var state: aws.sdk.kotlin.services.iotsitewise.model.AssetState? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.iotsitewise.model.AssetStatus) : this() {
this.error = x.error
this.state = x.state
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.iotsitewise.model.AssetStatus = AssetStatus(this)
/**
* construct an [aws.sdk.kotlin.services.iotsitewise.model.ErrorDetails] inside the given [block]
*/
public fun error(block: aws.sdk.kotlin.services.iotsitewise.model.ErrorDetails.Builder.() -> kotlin.Unit) {
this.error = aws.sdk.kotlin.services.iotsitewise.model.ErrorDetails.invoke(block)
}
internal fun correctErrors(): Builder {
if (state == null) state = AssetState.SdkUnknown("no value provided")
return this
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy