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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy