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

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

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

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



/**
 * Set configurations for metrics export.
 */
public class MetricsExportConfig private constructor(builder: Builder) {
    /**
     * The MQTT topic that Device Defender Detect should publish messages to for metrics export.
     */
    public val mqttTopic: kotlin.String = requireNotNull(builder.mqttTopic) { "A non-null value must be provided for mqttTopic" }
    /**
     * This role ARN has permission to publish MQTT messages, after which Device Defender Detect can assume the role and publish messages on your behalf.
     */
    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.MetricsExportConfig = Builder().apply(block).build()
    }

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

    override fun hashCode(): kotlin.Int {
        var result = mqttTopic.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 MetricsExportConfig

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

        return true
    }

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

    public class Builder {
        /**
         * The MQTT topic that Device Defender Detect should publish messages to for metrics export.
         */
        public var mqttTopic: kotlin.String? = null
        /**
         * This role ARN has permission to publish MQTT messages, after which Device Defender Detect can assume the role and publish messages on your behalf.
         */
        public var roleArn: kotlin.String? = null

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy