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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy