All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.iot.model.ThingConnectivity.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.iot.model



/**
 * The connectivity status of the thing.
 */
public class ThingConnectivity private constructor(builder: Builder) {
    /**
     * True if the thing is connected to the Amazon Web Services IoT Core service; false if it is not connected.
     */
    public val connected: kotlin.Boolean? = builder.connected
    /**
     * The reason why the client is disconnected. If the thing has been disconnected for approximately an hour, the `disconnectReason` value might be missing.
     */
    public val disconnectReason: kotlin.String? = builder.disconnectReason
    /**
     * The epoch time (in milliseconds) when the thing last connected or disconnected. If the thing has been disconnected for approximately an hour, the time value might be missing.
     */
    public val timestamp: kotlin.Long? = builder.timestamp

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.iot.model.ThingConnectivity = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("ThingConnectivity(")
        append("connected=$connected,")
        append("disconnectReason=$disconnectReason,")
        append("timestamp=$timestamp")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = connected?.hashCode() ?: 0
        result = 31 * result + (disconnectReason?.hashCode() ?: 0)
        result = 31 * result + (timestamp?.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 ThingConnectivity

        if (connected != other.connected) return false
        if (disconnectReason != other.disconnectReason) return false
        if (timestamp != other.timestamp) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.iot.model.ThingConnectivity = Builder(this).apply(block).build()

    public class Builder {
        /**
         * True if the thing is connected to the Amazon Web Services IoT Core service; false if it is not connected.
         */
        public var connected: kotlin.Boolean? = null
        /**
         * The reason why the client is disconnected. If the thing has been disconnected for approximately an hour, the `disconnectReason` value might be missing.
         */
        public var disconnectReason: kotlin.String? = null
        /**
         * The epoch time (in milliseconds) when the thing last connected or disconnected. If the thing has been disconnected for approximately an hour, the time value might be missing.
         */
        public var timestamp: kotlin.Long? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.ThingConnectivity) : this() {
            this.connected = x.connected
            this.disconnectReason = x.disconnectReason
            this.timestamp = x.timestamp
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.iot.model.ThingConnectivity = ThingConnectivity(this)

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy