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

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

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

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



/**
 * Describes an action to send data from an MQTT message that triggered the rule to IoT SiteWise asset properties.
 */
public class IotSiteWiseAction private constructor(builder: Builder) {
    /**
     * A list of asset property value entries.
     */
    public val putAssetPropertyValueEntries: List = requireNotNull(builder.putAssetPropertyValueEntries) { "A non-null value must be provided for putAssetPropertyValueEntries" }
    /**
     * The ARN of the role that grants IoT permission to send an asset property value to IoT SiteWise. (`"Action": "iotsitewise:BatchPutAssetPropertyValue"`). The trust policy can restrict access to specific asset hierarchy paths.
     */
    public val roleArn: kotlin.String = requireNotNull(builder.roleArn) { "A non-null value must be provided for roleArn" }

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

    override fun toString(): kotlin.String = buildString {
        append("IotSiteWiseAction(")
        append("putAssetPropertyValueEntries=$putAssetPropertyValueEntries,")
        append("roleArn=$roleArn")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = putAssetPropertyValueEntries.hashCode()
        result = 31 * result + (roleArn.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 IotSiteWiseAction

        if (putAssetPropertyValueEntries != other.putAssetPropertyValueEntries) return false
        if (roleArn != other.roleArn) return false

        return true
    }

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

    public class Builder {
        /**
         * A list of asset property value entries.
         */
        public var putAssetPropertyValueEntries: List? = null
        /**
         * The ARN of the role that grants IoT permission to send an asset property value to IoT SiteWise. (`"Action": "iotsitewise:BatchPutAssetPropertyValue"`). The trust policy can restrict access to specific asset hierarchy paths.
         */
        public var roleArn: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.IotSiteWiseAction) : this() {
            this.putAssetPropertyValueEntries = x.putAssetPropertyValueEntries
            this.roleArn = x.roleArn
        }

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

        internal fun correctErrors(): Builder {
            if (putAssetPropertyValueEntries == null) putAssetPropertyValueEntries = emptyList()
            if (roleArn == null) roleArn = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy