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

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

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

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



/**
 * Parameters used when defining a mitigation action that move a set of things to a thing group.
 */
public class AddThingsToThingGroupParams private constructor(builder: Builder) {
    /**
     * Specifies if this mitigation action can move the things that triggered the mitigation action even if they are part of one or more dynamic thing groups.
     */
    public val overrideDynamicGroups: kotlin.Boolean? = builder.overrideDynamicGroups
    /**
     * The list of groups to which you want to add the things that triggered the mitigation action. You can add a thing to a maximum of 10 groups, but you can't add a thing to more than one group in the same hierarchy.
     */
    public val thingGroupNames: List = requireNotNull(builder.thingGroupNames) { "A non-null value must be provided for thingGroupNames" }

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

    override fun toString(): kotlin.String = buildString {
        append("AddThingsToThingGroupParams(")
        append("overrideDynamicGroups=$overrideDynamicGroups,")
        append("thingGroupNames=$thingGroupNames")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = overrideDynamicGroups?.hashCode() ?: 0
        result = 31 * result + (thingGroupNames.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 AddThingsToThingGroupParams

        if (overrideDynamicGroups != other.overrideDynamicGroups) return false
        if (thingGroupNames != other.thingGroupNames) return false

        return true
    }

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

    public class Builder {
        /**
         * Specifies if this mitigation action can move the things that triggered the mitigation action even if they are part of one or more dynamic thing groups.
         */
        public var overrideDynamicGroups: kotlin.Boolean? = null
        /**
         * The list of groups to which you want to add the things that triggered the mitigation action. You can add a thing to a maximum of 10 groups, but you can't add a thing to more than one group in the same hierarchy.
         */
        public var thingGroupNames: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.AddThingsToThingGroupParams) : this() {
            this.overrideDynamicGroups = x.overrideDynamicGroups
            this.thingGroupNames = x.thingGroupNames
        }

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

        internal fun correctErrors(): Builder {
            if (thingGroupNames == null) thingGroupNames = emptyList()
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy