zio.aws.costoptimizationhub.model.ComputeConfiguration.scala Maven / Gradle / Ivy
package zio.aws.costoptimizationhub.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.aws.costoptimizationhub.model.primitives.Integer
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class ComputeConfiguration(
vCpu: Optional[Double] = Optional.Absent,
memorySizeInMB: Optional[Integer] = Optional.Absent,
architecture: Optional[String] = Optional.Absent,
platform: Optional[String] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.costoptimizationhub.model.ComputeConfiguration = {
import ComputeConfiguration.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.costoptimizationhub.model.ComputeConfiguration
.builder()
.optionallyWith(vCpu.map(value => value: java.lang.Double))(_.vCpu)
.optionallyWith(memorySizeInMB.map(value => value: java.lang.Integer))(
_.memorySizeInMB
)
.optionallyWith(architecture.map(value => value: java.lang.String))(
_.architecture
)
.optionallyWith(platform.map(value => value: java.lang.String))(
_.platform
)
.build()
}
def asReadOnly
: zio.aws.costoptimizationhub.model.ComputeConfiguration.ReadOnly =
zio.aws.costoptimizationhub.model.ComputeConfiguration.wrap(buildAwsValue())
}
object ComputeConfiguration {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.costoptimizationhub.model.ComputeConfiguration
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.costoptimizationhub.model.ComputeConfiguration =
zio.aws.costoptimizationhub.model.ComputeConfiguration(
vCpu.map(value => value),
memorySizeInMB.map(value => value),
architecture.map(value => value),
platform.map(value => value)
)
def vCpu: Optional[Double]
def memorySizeInMB: Optional[Integer]
def architecture: Optional[String]
def platform: Optional[String]
def getVCpu: ZIO[Any, AwsError, Double] =
AwsError.unwrapOptionField("vCpu", vCpu)
def getMemorySizeInMB: ZIO[Any, AwsError, Integer] =
AwsError.unwrapOptionField("memorySizeInMB", memorySizeInMB)
def getArchitecture: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("architecture", architecture)
def getPlatform: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("platform", platform)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.costoptimizationhub.model.ComputeConfiguration
) extends zio.aws.costoptimizationhub.model.ComputeConfiguration.ReadOnly {
override val vCpu: Optional[Double] = zio.aws.core.internal
.optionalFromNullable(impl.vCpu())
.map(value => value: Double)
override val memorySizeInMB: Optional[Integer] = zio.aws.core.internal
.optionalFromNullable(impl.memorySizeInMB())
.map(value => value: Integer)
override val architecture: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.architecture())
.map(value => value: String)
override val platform: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.platform())
.map(value => value: String)
}
def wrap(
impl: software.amazon.awssdk.services.costoptimizationhub.model.ComputeConfiguration
): zio.aws.costoptimizationhub.model.ComputeConfiguration.ReadOnly =
new Wrapper(impl)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy