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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy