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

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

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

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



/**
 * The input for the CreateThing operation.
 */
public class CreateThingRequest private constructor(builder: Builder) {
    /**
     * The attribute payload, which consists of up to three name/value pairs in a JSON document. For example:
     *
     * `{\"attributes\":{\"string1\":\"string2\"}}`
     */
    public val attributePayload: aws.sdk.kotlin.services.iot.model.AttributePayload? = builder.attributePayload
    /**
     * The name of the billing group the thing will be added to.
     */
    public val billingGroupName: kotlin.String? = builder.billingGroupName
    /**
     * The name of the thing to create.
     *
     * You can't change a thing's name after you create it. To change a thing's name, you must create a new thing, give it the new name, and then delete the old thing.
     */
    public val thingName: kotlin.String? = builder.thingName
    /**
     * The name of the thing type associated with the new thing.
     */
    public val thingTypeName: kotlin.String? = builder.thingTypeName

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

    override fun toString(): kotlin.String = buildString {
        append("CreateThingRequest(")
        append("attributePayload=$attributePayload,")
        append("billingGroupName=$billingGroupName,")
        append("thingName=$thingName,")
        append("thingTypeName=$thingTypeName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = attributePayload?.hashCode() ?: 0
        result = 31 * result + (billingGroupName?.hashCode() ?: 0)
        result = 31 * result + (thingName?.hashCode() ?: 0)
        result = 31 * result + (thingTypeName?.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 CreateThingRequest

        if (attributePayload != other.attributePayload) return false
        if (billingGroupName != other.billingGroupName) return false
        if (thingName != other.thingName) return false
        if (thingTypeName != other.thingTypeName) return false

        return true
    }

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

    public class Builder {
        /**
         * The attribute payload, which consists of up to three name/value pairs in a JSON document. For example:
         *
         * `{\"attributes\":{\"string1\":\"string2\"}}`
         */
        public var attributePayload: aws.sdk.kotlin.services.iot.model.AttributePayload? = null
        /**
         * The name of the billing group the thing will be added to.
         */
        public var billingGroupName: kotlin.String? = null
        /**
         * The name of the thing to create.
         *
         * You can't change a thing's name after you create it. To change a thing's name, you must create a new thing, give it the new name, and then delete the old thing.
         */
        public var thingName: kotlin.String? = null
        /**
         * The name of the thing type associated with the new thing.
         */
        public var thingTypeName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.CreateThingRequest) : this() {
            this.attributePayload = x.attributePayload
            this.billingGroupName = x.billingGroupName
            this.thingName = x.thingName
            this.thingTypeName = x.thingTypeName
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy