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

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

There is a newer version: 1.4.42
Show 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 cumulative configuration requirements for every worker instance of the worker type.
 */
public class WorkerResourceConfig private constructor(builder: Builder) {
    /**
     * The CPU requirements for every worker instance of the worker type.
     */
    public val cpu: kotlin.String = requireNotNull(builder.cpu) { "A non-null value must be provided for cpu" }
    /**
     * The disk requirements for every worker instance of the worker type.
     */
    public val disk: kotlin.String? = builder.disk
    /**
     * The disk type for every worker instance of the work type. Shuffle optimized disks have higher performance characteristics and are better for shuffle heavy workloads. Default is `STANDARD`.
     */
    public val diskType: kotlin.String? = builder.diskType
    /**
     * The memory requirements for every worker instance of the worker type.
     */
    public val memory: kotlin.String = requireNotNull(builder.memory) { "A non-null value must be provided for memory" }

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

    override fun toString(): kotlin.String = buildString {
        append("WorkerResourceConfig(")
        append("cpu=$cpu,")
        append("disk=$disk,")
        append("diskType=$diskType,")
        append("memory=$memory")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = cpu.hashCode()
        result = 31 * result + (disk?.hashCode() ?: 0)
        result = 31 * result + (diskType?.hashCode() ?: 0)
        result = 31 * result + (memory.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 WorkerResourceConfig

        if (cpu != other.cpu) return false
        if (disk != other.disk) return false
        if (diskType != other.diskType) return false
        if (memory != other.memory) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The CPU requirements for every worker instance of the worker type.
         */
        public var cpu: kotlin.String? = null
        /**
         * The disk requirements for every worker instance of the worker type.
         */
        public var disk: kotlin.String? = null
        /**
         * The disk type for every worker instance of the work type. Shuffle optimized disks have higher performance characteristics and are better for shuffle heavy workloads. Default is `STANDARD`.
         */
        public var diskType: kotlin.String? = null
        /**
         * The memory requirements for every worker instance of the worker type.
         */
        public var memory: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.emrserverless.model.WorkerResourceConfig) : this() {
            this.cpu = x.cpu
            this.disk = x.disk
            this.diskType = x.diskType
            this.memory = x.memory
        }

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

        internal fun correctErrors(): Builder {
            if (cpu == null) cpu = ""
            if (memory == null) memory = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy