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