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

commonMain.aws.sdk.kotlin.services.pipes.model.EcsContainerOverride.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.pipes.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The overrides that are sent to a container. An empty container override can be passed in. An example of an empty container override is `{"containerOverrides": [ ] }`. If a non-empty container override is specified, the `name` parameter must be included.
 */
public class EcsContainerOverride private constructor(builder: Builder) {
    /**
     * The command to send to the container that overrides the default command from the Docker image or the task definition. You must also specify a container name.
     */
    public val command: List? = builder.command
    /**
     * The number of `cpu` units reserved for the container, instead of the default value from the task definition. You must also specify a container name.
     */
    public val cpu: kotlin.Int? = builder.cpu
    /**
     * The environment variables to send to the container. You can add new environment variables, which are added to the container at launch, or you can override the existing environment variables from the Docker image or the task definition. You must also specify a container name.
     */
    public val environment: List? = builder.environment
    /**
     * A list of files containing the environment variables to pass to a container, instead of the value from the container definition.
     */
    public val environmentFiles: List? = builder.environmentFiles
    /**
     * The hard limit (in MiB) of memory to present to the container, instead of the default value from the task definition. If your container attempts to exceed the memory specified here, the container is killed. You must also specify a container name.
     */
    public val memory: kotlin.Int? = builder.memory
    /**
     * The soft limit (in MiB) of memory to reserve for the container, instead of the default value from the task definition. You must also specify a container name.
     */
    public val memoryReservation: kotlin.Int? = builder.memoryReservation
    /**
     * The name of the container that receives the override. This parameter is required if any override is specified.
     */
    public val name: kotlin.String? = builder.name
    /**
     * The type and amount of a resource to assign to a container, instead of the default value from the task definition. The only supported resource is a GPU.
     */
    public val resourceRequirements: List? = builder.resourceRequirements

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

    override fun toString(): kotlin.String = buildString {
        append("EcsContainerOverride(")
        append("command=$command,")
        append("cpu=$cpu,")
        append("environment=$environment,")
        append("environmentFiles=$environmentFiles,")
        append("memory=$memory,")
        append("memoryReservation=$memoryReservation,")
        append("name=$name,")
        append("resourceRequirements=$resourceRequirements")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = command?.hashCode() ?: 0
        result = 31 * result + (cpu ?: 0)
        result = 31 * result + (environment?.hashCode() ?: 0)
        result = 31 * result + (environmentFiles?.hashCode() ?: 0)
        result = 31 * result + (memory ?: 0)
        result = 31 * result + (memoryReservation ?: 0)
        result = 31 * result + (name?.hashCode() ?: 0)
        result = 31 * result + (resourceRequirements?.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 EcsContainerOverride

        if (command != other.command) return false
        if (cpu != other.cpu) return false
        if (environment != other.environment) return false
        if (environmentFiles != other.environmentFiles) return false
        if (memory != other.memory) return false
        if (memoryReservation != other.memoryReservation) return false
        if (name != other.name) return false
        if (resourceRequirements != other.resourceRequirements) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The command to send to the container that overrides the default command from the Docker image or the task definition. You must also specify a container name.
         */
        public var command: List? = null
        /**
         * The number of `cpu` units reserved for the container, instead of the default value from the task definition. You must also specify a container name.
         */
        public var cpu: kotlin.Int? = null
        /**
         * The environment variables to send to the container. You can add new environment variables, which are added to the container at launch, or you can override the existing environment variables from the Docker image or the task definition. You must also specify a container name.
         */
        public var environment: List? = null
        /**
         * A list of files containing the environment variables to pass to a container, instead of the value from the container definition.
         */
        public var environmentFiles: List? = null
        /**
         * The hard limit (in MiB) of memory to present to the container, instead of the default value from the task definition. If your container attempts to exceed the memory specified here, the container is killed. You must also specify a container name.
         */
        public var memory: kotlin.Int? = null
        /**
         * The soft limit (in MiB) of memory to reserve for the container, instead of the default value from the task definition. You must also specify a container name.
         */
        public var memoryReservation: kotlin.Int? = null
        /**
         * The name of the container that receives the override. This parameter is required if any override is specified.
         */
        public var name: kotlin.String? = null
        /**
         * The type and amount of a resource to assign to a container, instead of the default value from the task definition. The only supported resource is a GPU.
         */
        public var resourceRequirements: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.pipes.model.EcsContainerOverride) : this() {
            this.command = x.command
            this.cpu = x.cpu
            this.environment = x.environment
            this.environmentFiles = x.environmentFiles
            this.memory = x.memory
            this.memoryReservation = x.memoryReservation
            this.name = x.name
            this.resourceRequirements = x.resourceRequirements
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy