zio.aws.costoptimizationhub.model.SavingsPlansPricing.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 SavingsPlansPricing(
monthlySavingsPlansEligibleCost: Optional[Double] = Optional.Absent,
estimatedMonthlyCommitment: Optional[Double] = Optional.Absent,
savingsPercentage: Optional[Double] = Optional.Absent,
estimatedOnDemandCost: Optional[Double] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.costoptimizationhub.model.SavingsPlansPricing = {
import SavingsPlansPricing.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.costoptimizationhub.model.SavingsPlansPricing
.builder()
.optionallyWith(
monthlySavingsPlansEligibleCost.map(value => value: java.lang.Double)
)(_.monthlySavingsPlansEligibleCost)
.optionallyWith(
estimatedMonthlyCommitment.map(value => value: java.lang.Double)
)(_.estimatedMonthlyCommitment)
.optionallyWith(savingsPercentage.map(value => value: java.lang.Double))(
_.savingsPercentage
)
.optionallyWith(
estimatedOnDemandCost.map(value => value: java.lang.Double)
)(_.estimatedOnDemandCost)
.build()
}
def asReadOnly
: zio.aws.costoptimizationhub.model.SavingsPlansPricing.ReadOnly =
zio.aws.costoptimizationhub.model.SavingsPlansPricing.wrap(buildAwsValue())
}
object SavingsPlansPricing {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.costoptimizationhub.model.SavingsPlansPricing
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.costoptimizationhub.model.SavingsPlansPricing =
zio.aws.costoptimizationhub.model.SavingsPlansPricing(
monthlySavingsPlansEligibleCost.map(value => value),
estimatedMonthlyCommitment.map(value => value),
savingsPercentage.map(value => value),
estimatedOnDemandCost.map(value => value)
)
def monthlySavingsPlansEligibleCost: Optional[Double]
def estimatedMonthlyCommitment: Optional[Double]
def savingsPercentage: Optional[Double]
def estimatedOnDemandCost: Optional[Double]
def getMonthlySavingsPlansEligibleCost: ZIO[Any, AwsError, Double] =
AwsError.unwrapOptionField(
"monthlySavingsPlansEligibleCost",
monthlySavingsPlansEligibleCost
)
def getEstimatedMonthlyCommitment: ZIO[Any, AwsError, Double] =
AwsError.unwrapOptionField(
"estimatedMonthlyCommitment",
estimatedMonthlyCommitment
)
def getSavingsPercentage: ZIO[Any, AwsError, Double] =
AwsError.unwrapOptionField("savingsPercentage", savingsPercentage)
def getEstimatedOnDemandCost: ZIO[Any, AwsError, Double] =
AwsError.unwrapOptionField("estimatedOnDemandCost", estimatedOnDemandCost)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.costoptimizationhub.model.SavingsPlansPricing
) extends zio.aws.costoptimizationhub.model.SavingsPlansPricing.ReadOnly {
override val monthlySavingsPlansEligibleCost: Optional[Double] =
zio.aws.core.internal
.optionalFromNullable(impl.monthlySavingsPlansEligibleCost())
.map(value => value: Double)
override val estimatedMonthlyCommitment: Optional[Double] =
zio.aws.core.internal
.optionalFromNullable(impl.estimatedMonthlyCommitment())
.map(value => value: Double)
override val savingsPercentage: Optional[Double] = zio.aws.core.internal
.optionalFromNullable(impl.savingsPercentage())
.map(value => value: Double)
override val estimatedOnDemandCost: Optional[Double] = zio.aws.core.internal
.optionalFromNullable(impl.estimatedOnDemandCost())
.map(value => value: Double)
}
def wrap(
impl: software.amazon.awssdk.services.costoptimizationhub.model.SavingsPlansPricing
): zio.aws.costoptimizationhub.model.SavingsPlansPricing.ReadOnly =
new Wrapper(impl)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy