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

commonMain.aws.sdk.kotlin.services.iotsitewise.model.ExecuteActionRequest.kt Maven / Gradle / Ivy

There is a newer version: 1.3.99
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.iotsitewise.model

import aws.smithy.kotlin.runtime.SdkDsl

public class ExecuteActionRequest private constructor(builder: Builder) {
    /**
     * The ID of the action definition.
     */
    public val actionDefinitionId: kotlin.String? = builder.actionDefinitionId
    /**
     * The JSON payload of the action.
     */
    public val actionPayload: aws.sdk.kotlin.services.iotsitewise.model.ActionPayload? = builder.actionPayload
    /**
     * A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.
     */
    public val clientToken: kotlin.String? = builder.clientToken
    /**
     * The resource the action will be taken on.
     */
    public val targetResource: aws.sdk.kotlin.services.iotsitewise.model.TargetResource? = builder.targetResource

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

    override fun toString(): kotlin.String = buildString {
        append("ExecuteActionRequest(")
        append("actionDefinitionId=$actionDefinitionId,")
        append("actionPayload=$actionPayload,")
        append("clientToken=$clientToken,")
        append("targetResource=$targetResource")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = actionDefinitionId?.hashCode() ?: 0
        result = 31 * result + (actionPayload?.hashCode() ?: 0)
        result = 31 * result + (clientToken?.hashCode() ?: 0)
        result = 31 * result + (targetResource?.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 ExecuteActionRequest

        if (actionDefinitionId != other.actionDefinitionId) return false
        if (actionPayload != other.actionPayload) return false
        if (clientToken != other.clientToken) return false
        if (targetResource != other.targetResource) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The ID of the action definition.
         */
        public var actionDefinitionId: kotlin.String? = null
        /**
         * The JSON payload of the action.
         */
        public var actionPayload: aws.sdk.kotlin.services.iotsitewise.model.ActionPayload? = null
        /**
         * A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.
         */
        public var clientToken: kotlin.String? = null
        /**
         * The resource the action will be taken on.
         */
        public var targetResource: aws.sdk.kotlin.services.iotsitewise.model.TargetResource? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iotsitewise.model.ExecuteActionRequest) : this() {
            this.actionDefinitionId = x.actionDefinitionId
            this.actionPayload = x.actionPayload
            this.clientToken = x.clientToken
            this.targetResource = x.targetResource
        }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy