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

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

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

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



/**
 * Describes an action that writes data to an Amazon OpenSearch Service domain.
 *
 * The `Elasticsearch` action can only be used by existing rule actions. To create a new rule action or to update an existing rule action, use the `OpenSearch` rule action instead. For more information, see [OpenSearchAction](https://docs.aws.amazon.com/iot/latest/apireference/API_OpenSearchAction.html).
 */
public class ElasticsearchAction private constructor(builder: Builder) {
    /**
     * The endpoint of your OpenSearch domain.
     */
    public val endpoint: kotlin.String = requireNotNull(builder.endpoint) { "A non-null value must be provided for endpoint" }
    /**
     * The unique identifier for the document you are storing.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
    /**
     * The index where you want to store your data.
     */
    public val index: kotlin.String = requireNotNull(builder.index) { "A non-null value must be provided for index" }
    /**
     * The IAM role ARN that has access to OpenSearch.
     */
    public val roleArn: kotlin.String = requireNotNull(builder.roleArn) { "A non-null value must be provided for roleArn" }
    /**
     * The type of document you are storing.
     */
    public val type: kotlin.String = requireNotNull(builder.type) { "A non-null value must be provided for type" }

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

    override fun toString(): kotlin.String = buildString {
        append("ElasticsearchAction(")
        append("endpoint=$endpoint,")
        append("id=$id,")
        append("index=$index,")
        append("roleArn=$roleArn,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = endpoint.hashCode()
        result = 31 * result + (id.hashCode())
        result = 31 * result + (index.hashCode())
        result = 31 * result + (roleArn.hashCode())
        result = 31 * result + (type.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 ElasticsearchAction

        if (endpoint != other.endpoint) return false
        if (id != other.id) return false
        if (index != other.index) return false
        if (roleArn != other.roleArn) return false
        if (type != other.type) return false

        return true
    }

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

    public class Builder {
        /**
         * The endpoint of your OpenSearch domain.
         */
        public var endpoint: kotlin.String? = null
        /**
         * The unique identifier for the document you are storing.
         */
        public var id: kotlin.String? = null
        /**
         * The index where you want to store your data.
         */
        public var index: kotlin.String? = null
        /**
         * The IAM role ARN that has access to OpenSearch.
         */
        public var roleArn: kotlin.String? = null
        /**
         * The type of document you are storing.
         */
        public var type: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.ElasticsearchAction) : this() {
            this.endpoint = x.endpoint
            this.id = x.id
            this.index = x.index
            this.roleArn = x.roleArn
            this.type = x.type
        }

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

        internal fun correctErrors(): Builder {
            if (endpoint == null) endpoint = ""
            if (id == null) id = ""
            if (index == null) index = ""
            if (roleArn == null) roleArn = ""
            if (type == null) type = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy