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