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

commonMain.aws.sdk.kotlin.services.iot.model.RetryCriteria.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iot.model



/**
 * The criteria that determines how many retries are allowed for each failure type for a job.
 */
public class RetryCriteria private constructor(builder: Builder) {
    /**
     * The type of job execution failures that can initiate a job retry.
     */
    public val failureType: aws.sdk.kotlin.services.iot.model.RetryableFailureType = requireNotNull(builder.failureType) { "A non-null value must be provided for failureType" }
    /**
     * The number of retries allowed for a failure type for the job.
     */
    public val numberOfRetries: kotlin.Int = requireNotNull(builder.numberOfRetries) { "A non-null value must be provided for numberOfRetries" }

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

    override fun toString(): kotlin.String = buildString {
        append("RetryCriteria(")
        append("failureType=$failureType,")
        append("numberOfRetries=$numberOfRetries")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = failureType.hashCode()
        result = 31 * result + (numberOfRetries)
        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 RetryCriteria

        if (failureType != other.failureType) return false
        if (numberOfRetries != other.numberOfRetries) return false

        return true
    }

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

    public class Builder {
        /**
         * The type of job execution failures that can initiate a job retry.
         */
        public var failureType: aws.sdk.kotlin.services.iot.model.RetryableFailureType? = null
        /**
         * The number of retries allowed for a failure type for the job.
         */
        public var numberOfRetries: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.RetryCriteria) : this() {
            this.failureType = x.failureType
            this.numberOfRetries = x.numberOfRetries
        }

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

        internal fun correctErrors(): Builder {
            if (failureType == null) failureType = RetryableFailureType.SdkUnknown("no value provided")
            if (numberOfRetries == null) numberOfRetries = 0
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy