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

commonMain.aws.sdk.kotlin.services.transfer.model.ExecutionError.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.transfer.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Specifies the error message and type, for an error that occurs during the execution of the workflow.
 */
public class ExecutionError private constructor(builder: Builder) {
    /**
     * Specifies the descriptive message that corresponds to the `ErrorType`.
     */
    public val message: kotlin.String = requireNotNull(builder.message) { "A non-null value must be provided for message" }
    /**
     * Specifies the error type.
     * + `ALREADY_EXISTS`: occurs for a copy step, if the overwrite option is not selected and a file with the same name already exists in the target location.
     * + `BAD_REQUEST`: a general bad request: for example, a step that attempts to tag an EFS file returns `BAD_REQUEST`, as only S3 files can be tagged.
     * + `CUSTOM_STEP_FAILED`: occurs when the custom step provided a callback that indicates failure.
     * + `INTERNAL_SERVER_ERROR`: a catch-all error that can occur for a variety of reasons.
     * + `NOT_FOUND`: occurs when a requested entity, for example a source file for a copy step, does not exist.
     * + `PERMISSION_DENIED`: occurs if your policy does not contain the correct permissions to complete one or more of the steps in the workflow.
     * + `TIMEOUT`: occurs when the execution times out. You can set the `TimeoutSeconds` for a custom step, anywhere from 1 second to 1800 seconds (30 minutes).
     * + `THROTTLED`: occurs if you exceed the new execution refill rate of one workflow per second.
     */
    public val type: aws.sdk.kotlin.services.transfer.model.ExecutionErrorType = 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.transfer.model.ExecutionError = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("ExecutionError(")
        append("message=$message,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = message.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 ExecutionError

        if (message != other.message) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Specifies the descriptive message that corresponds to the `ErrorType`.
         */
        public var message: kotlin.String? = null
        /**
         * Specifies the error type.
         * + `ALREADY_EXISTS`: occurs for a copy step, if the overwrite option is not selected and a file with the same name already exists in the target location.
         * + `BAD_REQUEST`: a general bad request: for example, a step that attempts to tag an EFS file returns `BAD_REQUEST`, as only S3 files can be tagged.
         * + `CUSTOM_STEP_FAILED`: occurs when the custom step provided a callback that indicates failure.
         * + `INTERNAL_SERVER_ERROR`: a catch-all error that can occur for a variety of reasons.
         * + `NOT_FOUND`: occurs when a requested entity, for example a source file for a copy step, does not exist.
         * + `PERMISSION_DENIED`: occurs if your policy does not contain the correct permissions to complete one or more of the steps in the workflow.
         * + `TIMEOUT`: occurs when the execution times out. You can set the `TimeoutSeconds` for a custom step, anywhere from 1 second to 1800 seconds (30 minutes).
         * + `THROTTLED`: occurs if you exceed the new execution refill rate of one workflow per second.
         */
        public var type: aws.sdk.kotlin.services.transfer.model.ExecutionErrorType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.transfer.model.ExecutionError) : this() {
            this.message = x.message
            this.type = x.type
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy