All Downloads are FREE. Search and download functionalities are using the official Maven repository.

zio.aws.costoptimizationhub.model.ReservedInstancesCostCalculation.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 ReservedInstancesCostCalculation(
    pricing: Optional[
      zio.aws.costoptimizationhub.model.ReservedInstancesPricing
    ] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.costoptimizationhub.model.ReservedInstancesCostCalculation = {
    import ReservedInstancesCostCalculation.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.costoptimizationhub.model.ReservedInstancesCostCalculation
      .builder()
      .optionallyWith(pricing.map(value => value.buildAwsValue()))(_.pricing)
      .build()
  }
  def asReadOnly
      : zio.aws.costoptimizationhub.model.ReservedInstancesCostCalculation.ReadOnly =
    zio.aws.costoptimizationhub.model.ReservedInstancesCostCalculation
      .wrap(buildAwsValue())
}
object ReservedInstancesCostCalculation {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.costoptimizationhub.model.ReservedInstancesCostCalculation
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable
        : zio.aws.costoptimizationhub.model.ReservedInstancesCostCalculation =
      zio.aws.costoptimizationhub.model.ReservedInstancesCostCalculation(
        pricing.map(value => value.asEditable)
      )
    def pricing: Optional[
      zio.aws.costoptimizationhub.model.ReservedInstancesPricing.ReadOnly
    ]
    def getPricing: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.ReservedInstancesPricing.ReadOnly
    ] = AwsError.unwrapOptionField("pricing", pricing)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.ReservedInstancesCostCalculation
  ) extends zio.aws.costoptimizationhub.model.ReservedInstancesCostCalculation.ReadOnly {
    override val pricing: Optional[
      zio.aws.costoptimizationhub.model.ReservedInstancesPricing.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.pricing())
      .map(value =>
        zio.aws.costoptimizationhub.model.ReservedInstancesPricing.wrap(value)
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.ReservedInstancesCostCalculation
  ): zio.aws.costoptimizationhub.model.ReservedInstancesCostCalculation.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy