
commonMain.aws.sdk.kotlin.services.pipes.model.EcsResourceRequirement.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.pipes.model
/**
* The type and amount of a resource to assign to a container. The supported resource types are GPUs and Elastic Inference accelerators. For more information, see [Working with GPUs on Amazon ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-gpu.html) or [Working with Amazon Elastic Inference on Amazon ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-inference.html) in the *Amazon Elastic Container Service Developer Guide*
*/
public class EcsResourceRequirement private constructor(builder: Builder) {
/**
* The type of resource to assign to a container. The supported values are `GPU` or `InferenceAccelerator`.
*/
public val type: aws.sdk.kotlin.services.pipes.model.EcsResourceRequirementType = requireNotNull(builder.type) { "A non-null value must be provided for type" }
/**
* The value for the specified resource type.
*
* If the `GPU` type is used, the value is the number of physical `GPUs` the Amazon ECS container agent reserves for the container. The number of GPUs that's reserved for all containers in a task can't exceed the number of available GPUs on the container instance that the task is launched on.
*
* If the `InferenceAccelerator` type is used, the `value` matches the `deviceName` for an InferenceAccelerator specified in a task definition.
*/
public val value: kotlin.String = requireNotNull(builder.value) { "A non-null value must be provided for value" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.pipes.model.EcsResourceRequirement = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("EcsResourceRequirement(")
append("type=$type,")
append("value=$value")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = type.hashCode()
result = 31 * result + (value.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 EcsResourceRequirement
if (type != other.type) return false
if (value != other.value) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.pipes.model.EcsResourceRequirement = Builder(this).apply(block).build()
public class Builder {
/**
* The type of resource to assign to a container. The supported values are `GPU` or `InferenceAccelerator`.
*/
public var type: aws.sdk.kotlin.services.pipes.model.EcsResourceRequirementType? = null
/**
* The value for the specified resource type.
*
* If the `GPU` type is used, the value is the number of physical `GPUs` the Amazon ECS container agent reserves for the container. The number of GPUs that's reserved for all containers in a task can't exceed the number of available GPUs on the container instance that the task is launched on.
*
* If the `InferenceAccelerator` type is used, the `value` matches the `deviceName` for an InferenceAccelerator specified in a task definition.
*/
public var value: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.pipes.model.EcsResourceRequirement) : this() {
this.type = x.type
this.value = x.value
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.pipes.model.EcsResourceRequirement = EcsResourceRequirement(this)
internal fun correctErrors(): Builder {
if (type == null) type = EcsResourceRequirementType.SdkUnknown("no value provided")
if (value == null) value = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy