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

commonMain.aws.sdk.kotlin.services.emrserverless.model.MaximumAllowedResources.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 maximum allowed cumulative resources for an application. No new resources will be created once the limit is hit.
 */
public class MaximumAllowedResources private constructor(builder: Builder) {
    /**
     * The maximum allowed CPU for an application.
     */
    public val cpu: kotlin.String = requireNotNull(builder.cpu) { "A non-null value must be provided for cpu" }
    /**
     * The maximum allowed disk for an application.
     */
    public val disk: kotlin.String? = builder.disk
    /**
     * The maximum allowed resources for an application.
     */
    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.MaximumAllowedResources = Builder().apply(block).build()
    }

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

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

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

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The maximum allowed CPU for an application.
         */
        public var cpu: kotlin.String? = null
        /**
         * The maximum allowed disk for an application.
         */
        public var disk: kotlin.String? = null
        /**
         * The maximum allowed resources for an application.
         */
        public var memory: kotlin.String? = null

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy