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

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

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

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



/**
 * The input for the CreateTopicRule operation.
 */
public class CreateTopicRuleRequest private constructor(builder: Builder) {
    /**
     * The name of the rule.
     */
    public val ruleName: kotlin.String? = builder.ruleName
    /**
     * Metadata which can be used to manage the topic rule.
     *
     * For URI Request parameters use format: ...key1=value1&key2=value2...
     *
     * For the CLI command-line parameter use format: --tags "key1=value1&key2=value2..."
     *
     * For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."
     */
    public val tags: kotlin.String? = builder.tags
    /**
     * The rule payload.
     */
    public val topicRulePayload: aws.sdk.kotlin.services.iot.model.TopicRulePayload? = builder.topicRulePayload

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

    override fun toString(): kotlin.String = buildString {
        append("CreateTopicRuleRequest(")
        append("ruleName=$ruleName,")
        append("tags=$tags,")
        append("topicRulePayload=$topicRulePayload")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = ruleName?.hashCode() ?: 0
        result = 31 * result + (tags?.hashCode() ?: 0)
        result = 31 * result + (topicRulePayload?.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 CreateTopicRuleRequest

        if (ruleName != other.ruleName) return false
        if (tags != other.tags) return false
        if (topicRulePayload != other.topicRulePayload) return false

        return true
    }

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

    public class Builder {
        /**
         * The name of the rule.
         */
        public var ruleName: kotlin.String? = null
        /**
         * Metadata which can be used to manage the topic rule.
         *
         * For URI Request parameters use format: ...key1=value1&key2=value2...
         *
         * For the CLI command-line parameter use format: --tags "key1=value1&key2=value2..."
         *
         * For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."
         */
        public var tags: kotlin.String? = null
        /**
         * The rule payload.
         */
        public var topicRulePayload: aws.sdk.kotlin.services.iot.model.TopicRulePayload? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.CreateTopicRuleRequest) : this() {
            this.ruleName = x.ruleName
            this.tags = x.tags
            this.topicRulePayload = x.topicRulePayload
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy