commonMain.aws.sdk.kotlin.services.iotsitewise.model.PortalStatus.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 a portal.
*/
public class PortalStatus private constructor(builder: Builder) {
/**
* Contains associated error information, if any.
*/
public val error: aws.sdk.kotlin.services.iotsitewise.model.MonitorErrorDetails? = builder.error
/**
* The current state of the portal.
*/
public val state: aws.sdk.kotlin.services.iotsitewise.model.PortalState = 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.PortalStatus = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PortalStatus(")
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 PortalStatus
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.PortalStatus = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Contains associated error information, if any.
*/
public var error: aws.sdk.kotlin.services.iotsitewise.model.MonitorErrorDetails? = null
/**
* The current state of the portal.
*/
public var state: aws.sdk.kotlin.services.iotsitewise.model.PortalState? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.iotsitewise.model.PortalStatus) : this() {
this.error = x.error
this.state = x.state
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.iotsitewise.model.PortalStatus = PortalStatus(this)
/**
* construct an [aws.sdk.kotlin.services.iotsitewise.model.MonitorErrorDetails] inside the given [block]
*/
public fun error(block: aws.sdk.kotlin.services.iotsitewise.model.MonitorErrorDetails.Builder.() -> kotlin.Unit) {
this.error = aws.sdk.kotlin.services.iotsitewise.model.MonitorErrorDetails.invoke(block)
}
internal fun correctErrors(): Builder {
if (state == null) state = PortalState.SdkUnknown("no value provided")
return this
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy