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

commonMain.aws.sdk.kotlin.services.iot1clickdevicesservice.model.Device.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iot1clickdevicesservice.model

import aws.smithy.kotlin.runtime.SdkDsl

public class Device private constructor(builder: Builder) {
    /**
     * The user specified attributes associated with the device for an event.
     */
    public val attributes: aws.sdk.kotlin.services.iot1clickdevicesservice.model.Attributes? = builder.attributes
    /**
     * The unique identifier of the device.
     */
    public val deviceId: kotlin.String? = builder.deviceId
    /**
     * The device type, such as "button".
     */
    public val type: kotlin.String? = builder.type

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

    override fun toString(): kotlin.String = buildString {
        append("Device(")
        append("attributes=$attributes,")
        append("deviceId=$deviceId,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = attributes?.hashCode() ?: 0
        result = 31 * result + (deviceId?.hashCode() ?: 0)
        result = 31 * result + (type?.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 Device

        if (attributes != other.attributes) return false
        if (deviceId != other.deviceId) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The user specified attributes associated with the device for an event.
         */
        public var attributes: aws.sdk.kotlin.services.iot1clickdevicesservice.model.Attributes? = null
        /**
         * The unique identifier of the device.
         */
        public var deviceId: kotlin.String? = null
        /**
         * The device type, such as "button".
         */
        public var type: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot1clickdevicesservice.model.Device) : this() {
            this.attributes = x.attributes
            this.deviceId = x.deviceId
            this.type = x.type
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.iot1clickdevicesservice.model.Attributes] inside the given [block]
         */
        public fun attributes(block: aws.sdk.kotlin.services.iot1clickdevicesservice.model.Attributes.Builder.() -> kotlin.Unit) {
            this.attributes = aws.sdk.kotlin.services.iot1clickdevicesservice.model.Attributes.invoke(block)
        }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy