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

commonMain.aws.sdk.kotlin.services.swf.model.WorkflowExecutionCancelRequestedEventAttributes.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 `WorkflowExecutionCancelRequested` event.
 */
public class WorkflowExecutionCancelRequestedEventAttributes private constructor(builder: Builder) {
    /**
     * If set, indicates that the request to cancel the workflow execution was automatically generated, and specifies the cause. This happens if the parent workflow execution times out or is terminated, and the child policy is set to cancel child executions.
     */
    public val cause: aws.sdk.kotlin.services.swf.model.WorkflowExecutionCancelRequestedCause? = builder.cause
    /**
     * The ID of the `RequestCancelExternalWorkflowExecutionInitiated` event corresponding to the `RequestCancelExternalWorkflowExecution` decision to cancel this workflow execution.The source event with this ID can be found in the history of the source workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
     */
    public val externalInitiatedEventId: kotlin.Long = builder.externalInitiatedEventId
    /**
     * The external workflow execution for which the cancellation was requested.
     */
    public val externalWorkflowExecution: aws.sdk.kotlin.services.swf.model.WorkflowExecution? = builder.externalWorkflowExecution

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

    override fun toString(): kotlin.String = buildString {
        append("WorkflowExecutionCancelRequestedEventAttributes(")
        append("cause=$cause,")
        append("externalInitiatedEventId=$externalInitiatedEventId,")
        append("externalWorkflowExecution=$externalWorkflowExecution")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = cause?.hashCode() ?: 0
        result = 31 * result + (externalInitiatedEventId.hashCode())
        result = 31 * result + (externalWorkflowExecution?.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 WorkflowExecutionCancelRequestedEventAttributes

        if (cause != other.cause) return false
        if (externalInitiatedEventId != other.externalInitiatedEventId) return false
        if (externalWorkflowExecution != other.externalWorkflowExecution) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * If set, indicates that the request to cancel the workflow execution was automatically generated, and specifies the cause. This happens if the parent workflow execution times out or is terminated, and the child policy is set to cancel child executions.
         */
        public var cause: aws.sdk.kotlin.services.swf.model.WorkflowExecutionCancelRequestedCause? = null
        /**
         * The ID of the `RequestCancelExternalWorkflowExecutionInitiated` event corresponding to the `RequestCancelExternalWorkflowExecution` decision to cancel this workflow execution.The source event with this ID can be found in the history of the source workflow execution. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.
         */
        public var externalInitiatedEventId: kotlin.Long = 0L
        /**
         * The external workflow execution for which the cancellation was requested.
         */
        public var externalWorkflowExecution: aws.sdk.kotlin.services.swf.model.WorkflowExecution? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.swf.model.WorkflowExecutionCancelRequestedEventAttributes) : this() {
            this.cause = x.cause
            this.externalInitiatedEventId = x.externalInitiatedEventId
            this.externalWorkflowExecution = x.externalWorkflowExecution
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy