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

zio.aws.costoptimizationhub.model.ResourcePricing.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 ResourcePricing(
    estimatedCostBeforeDiscounts: Optional[Double] = Optional.Absent,
    estimatedNetUnusedAmortizedCommitments: Optional[Double] = Optional.Absent,
    estimatedDiscounts: Optional[
      zio.aws.costoptimizationhub.model.EstimatedDiscounts
    ] = Optional.Absent,
    estimatedCostAfterDiscounts: Optional[Double] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.costoptimizationhub.model.ResourcePricing = {
    import ResourcePricing.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.costoptimizationhub.model.ResourcePricing
      .builder()
      .optionallyWith(
        estimatedCostBeforeDiscounts.map(value => value: java.lang.Double)
      )(_.estimatedCostBeforeDiscounts)
      .optionallyWith(
        estimatedNetUnusedAmortizedCommitments.map(value =>
          value: java.lang.Double
        )
      )(_.estimatedNetUnusedAmortizedCommitments)
      .optionallyWith(estimatedDiscounts.map(value => value.buildAwsValue()))(
        _.estimatedDiscounts
      )
      .optionallyWith(
        estimatedCostAfterDiscounts.map(value => value: java.lang.Double)
      )(_.estimatedCostAfterDiscounts)
      .build()
  }
  def asReadOnly: zio.aws.costoptimizationhub.model.ResourcePricing.ReadOnly =
    zio.aws.costoptimizationhub.model.ResourcePricing.wrap(buildAwsValue())
}
object ResourcePricing {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.costoptimizationhub.model.ResourcePricing
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.costoptimizationhub.model.ResourcePricing =
      zio.aws.costoptimizationhub.model.ResourcePricing(
        estimatedCostBeforeDiscounts.map(value => value),
        estimatedNetUnusedAmortizedCommitments.map(value => value),
        estimatedDiscounts.map(value => value.asEditable),
        estimatedCostAfterDiscounts.map(value => value)
      )
    def estimatedCostBeforeDiscounts: Optional[Double]
    def estimatedNetUnusedAmortizedCommitments: Optional[Double]
    def estimatedDiscounts: Optional[
      zio.aws.costoptimizationhub.model.EstimatedDiscounts.ReadOnly
    ]
    def estimatedCostAfterDiscounts: Optional[Double]
    def getEstimatedCostBeforeDiscounts: ZIO[Any, AwsError, Double] =
      AwsError.unwrapOptionField(
        "estimatedCostBeforeDiscounts",
        estimatedCostBeforeDiscounts
      )
    def getEstimatedNetUnusedAmortizedCommitments: ZIO[Any, AwsError, Double] =
      AwsError.unwrapOptionField(
        "estimatedNetUnusedAmortizedCommitments",
        estimatedNetUnusedAmortizedCommitments
      )
    def getEstimatedDiscounts: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.EstimatedDiscounts.ReadOnly
    ] = AwsError.unwrapOptionField("estimatedDiscounts", estimatedDiscounts)
    def getEstimatedCostAfterDiscounts: ZIO[Any, AwsError, Double] =
      AwsError.unwrapOptionField(
        "estimatedCostAfterDiscounts",
        estimatedCostAfterDiscounts
      )
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.ResourcePricing
  ) extends zio.aws.costoptimizationhub.model.ResourcePricing.ReadOnly {
    override val estimatedCostBeforeDiscounts: Optional[Double] =
      zio.aws.core.internal
        .optionalFromNullable(impl.estimatedCostBeforeDiscounts())
        .map(value => value: Double)
    override val estimatedNetUnusedAmortizedCommitments: Optional[Double] =
      zio.aws.core.internal
        .optionalFromNullable(impl.estimatedNetUnusedAmortizedCommitments())
        .map(value => value: Double)
    override val estimatedDiscounts: Optional[
      zio.aws.costoptimizationhub.model.EstimatedDiscounts.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.estimatedDiscounts())
      .map(value =>
        zio.aws.costoptimizationhub.model.EstimatedDiscounts.wrap(value)
      )
    override val estimatedCostAfterDiscounts: Optional[Double] =
      zio.aws.core.internal
        .optionalFromNullable(impl.estimatedCostAfterDiscounts())
        .map(value => value: Double)
  }
  def wrap(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.ResourcePricing
  ): zio.aws.costoptimizationhub.model.ResourcePricing.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy