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

commonMain.aws.sdk.kotlin.services.iotsitewise.model.DescribeActionResponse.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
import aws.smithy.kotlin.runtime.time.Instant

public class DescribeActionResponse private constructor(builder: Builder) {
    /**
     * The ID of the action definition.
     */
    public val actionDefinitionId: kotlin.String = requireNotNull(builder.actionDefinitionId) { "A non-null value must be provided for actionDefinitionId" }
    /**
     * The ID of the action.
     */
    public val actionId: kotlin.String = requireNotNull(builder.actionId) { "A non-null value must be provided for actionId" }
    /**
     * The JSON payload of the action.
     */
    public val actionPayload: aws.sdk.kotlin.services.iotsitewise.model.ActionPayload? = builder.actionPayload
    /**
     * The time the action was executed.
     */
    public val executionTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.executionTime) { "A non-null value must be provided for executionTime" }
    /**
     * 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.DescribeActionResponse = Builder().apply(block).build()
    }

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

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

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

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The ID of the action definition.
         */
        public var actionDefinitionId: kotlin.String? = null
        /**
         * The ID of the action.
         */
        public var actionId: kotlin.String? = null
        /**
         * The JSON payload of the action.
         */
        public var actionPayload: aws.sdk.kotlin.services.iotsitewise.model.ActionPayload? = null
        /**
         * The time the action was executed.
         */
        public var executionTime: aws.smithy.kotlin.runtime.time.Instant? = 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.DescribeActionResponse) : this() {
            this.actionDefinitionId = x.actionDefinitionId
            this.actionId = x.actionId
            this.actionPayload = x.actionPayload
            this.executionTime = x.executionTime
            this.targetResource = x.targetResource
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.iotsitewise.model.DescribeActionResponse = DescribeActionResponse(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 {
            if (actionDefinitionId == null) actionDefinitionId = ""
            if (actionId == null) actionId = ""
            if (executionTime == null) executionTime = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy