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

commonMain.aws.sdk.kotlin.services.emrserverless.model.RetryPolicy.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.emrserverless.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The retry policy to use for a job run.
 */
public class RetryPolicy private constructor(builder: Builder) {
    /**
     * Maximum number of attempts for the job run. This parameter is only applicable for `BATCH` mode.
     */
    public val maxAttempts: kotlin.Int? = builder.maxAttempts
    /**
     * Maximum number of failed attempts per hour. This [arameter is only applicable for `STREAMING` mode.
     */
    public val maxFailedAttemptsPerHour: kotlin.Int? = builder.maxFailedAttemptsPerHour

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

    override fun toString(): kotlin.String = buildString {
        append("RetryPolicy(")
        append("maxAttempts=$maxAttempts,")
        append("maxFailedAttemptsPerHour=$maxFailedAttemptsPerHour")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = maxAttempts ?: 0
        result = 31 * result + (maxFailedAttemptsPerHour ?: 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 RetryPolicy

        if (maxAttempts != other.maxAttempts) return false
        if (maxFailedAttemptsPerHour != other.maxFailedAttemptsPerHour) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Maximum number of attempts for the job run. This parameter is only applicable for `BATCH` mode.
         */
        public var maxAttempts: kotlin.Int? = null
        /**
         * Maximum number of failed attempts per hour. This [arameter is only applicable for `STREAMING` mode.
         */
        public var maxFailedAttemptsPerHour: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.emrserverless.model.RetryPolicy) : this() {
            this.maxAttempts = x.maxAttempts
            this.maxFailedAttemptsPerHour = x.maxFailedAttemptsPerHour
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy