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

commonMain.aws.sdk.kotlin.services.computeoptimizer.model.ContainerRecommendation.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.computeoptimizer.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The CPU and memory recommendations for a container within the tasks of your Amazon ECS service.
 */
public class ContainerRecommendation private constructor(builder: Builder) {
    /**
     * The name of the container.
     */
    public val containerName: kotlin.String? = builder.containerName
    /**
     * The recommended number of CPU units reserved for the container.
     */
    public val cpu: kotlin.Int? = builder.cpu
    /**
     * The recommended memory size configurations for the container.
     */
    public val memorySizeConfiguration: aws.sdk.kotlin.services.computeoptimizer.model.MemorySizeConfiguration? = builder.memorySizeConfiguration

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

    override fun toString(): kotlin.String = buildString {
        append("ContainerRecommendation(")
        append("containerName=$containerName,")
        append("cpu=$cpu,")
        append("memorySizeConfiguration=$memorySizeConfiguration")
        append(")")
    }

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

        if (containerName != other.containerName) return false
        if (cpu != other.cpu) return false
        if (memorySizeConfiguration != other.memorySizeConfiguration) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The name of the container.
         */
        public var containerName: kotlin.String? = null
        /**
         * The recommended number of CPU units reserved for the container.
         */
        public var cpu: kotlin.Int? = null
        /**
         * The recommended memory size configurations for the container.
         */
        public var memorySizeConfiguration: aws.sdk.kotlin.services.computeoptimizer.model.MemorySizeConfiguration? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.computeoptimizer.model.ContainerRecommendation) : this() {
            this.containerName = x.containerName
            this.cpu = x.cpu
            this.memorySizeConfiguration = x.memorySizeConfiguration
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.computeoptimizer.model.MemorySizeConfiguration] inside the given [block]
         */
        public fun memorySizeConfiguration(block: aws.sdk.kotlin.services.computeoptimizer.model.MemorySizeConfiguration.Builder.() -> kotlin.Unit) {
            this.memorySizeConfiguration = aws.sdk.kotlin.services.computeoptimizer.model.MemorySizeConfiguration.invoke(block)
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy