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

commonMain.aws.sdk.kotlin.services.swf.model.WorkflowExecutionTerminatedEventAttributes.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.swf.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Provides the details of the `WorkflowExecutionTerminated` event.
 */
public class WorkflowExecutionTerminatedEventAttributes private constructor(builder: Builder) {
    /**
     * If set, indicates that the workflow execution was automatically terminated, and specifies the cause. This happens if the parent workflow execution times out or is terminated and the child policy is set to terminate child executions.
     */
    public val cause: aws.sdk.kotlin.services.swf.model.WorkflowExecutionTerminatedCause? = builder.cause
    /**
     * The policy used for the child workflow executions of this workflow execution.
     *
     * The supported child policies are:
     * + `TERMINATE` – The child executions are terminated.
     * + `REQUEST_CANCEL` – A request to cancel is attempted for each child execution by recording a `WorkflowExecutionCancelRequested` event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.
     * + `ABANDON` – No action is taken. The child executions continue to run.
     */
    public val childPolicy: aws.sdk.kotlin.services.swf.model.ChildPolicy = requireNotNull(builder.childPolicy) { "A non-null value must be provided for childPolicy" }
    /**
     * The details provided for the termination.
     */
    public val details: kotlin.String? = builder.details
    /**
     * The reason provided for the termination.
     */
    public val reason: kotlin.String? = builder.reason

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

    override fun toString(): kotlin.String = buildString {
        append("WorkflowExecutionTerminatedEventAttributes(")
        append("cause=$cause,")
        append("childPolicy=$childPolicy,")
        append("details=$details,")
        append("reason=$reason")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = cause?.hashCode() ?: 0
        result = 31 * result + (childPolicy.hashCode())
        result = 31 * result + (details?.hashCode() ?: 0)
        result = 31 * result + (reason?.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 WorkflowExecutionTerminatedEventAttributes

        if (cause != other.cause) return false
        if (childPolicy != other.childPolicy) return false
        if (details != other.details) return false
        if (reason != other.reason) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * If set, indicates that the workflow execution was automatically terminated, and specifies the cause. This happens if the parent workflow execution times out or is terminated and the child policy is set to terminate child executions.
         */
        public var cause: aws.sdk.kotlin.services.swf.model.WorkflowExecutionTerminatedCause? = null
        /**
         * The policy used for the child workflow executions of this workflow execution.
         *
         * The supported child policies are:
         * + `TERMINATE` – The child executions are terminated.
         * + `REQUEST_CANCEL` – A request to cancel is attempted for each child execution by recording a `WorkflowExecutionCancelRequested` event in its history. It is up to the decider to take appropriate actions when it receives an execution history with this event.
         * + `ABANDON` – No action is taken. The child executions continue to run.
         */
        public var childPolicy: aws.sdk.kotlin.services.swf.model.ChildPolicy? = null
        /**
         * The details provided for the termination.
         */
        public var details: kotlin.String? = null
        /**
         * The reason provided for the termination.
         */
        public var reason: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.swf.model.WorkflowExecutionTerminatedEventAttributes) : this() {
            this.cause = x.cause
            this.childPolicy = x.childPolicy
            this.details = x.details
            this.reason = x.reason
        }

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

        internal fun correctErrors(): Builder {
            if (childPolicy == null) childPolicy = ChildPolicy.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy