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

zio.aws.costoptimizationhub.model.UpdatePreferencesRequest.scala Maven / Gradle / Ivy

There is a newer version: 7.28.29.14
Show 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 UpdatePreferencesRequest(
    savingsEstimationMode: Optional[
      zio.aws.costoptimizationhub.model.SavingsEstimationMode
    ] = Optional.Absent,
    memberAccountDiscountVisibility: Optional[
      zio.aws.costoptimizationhub.model.MemberAccountDiscountVisibility
    ] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.costoptimizationhub.model.UpdatePreferencesRequest = {
    import UpdatePreferencesRequest.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.costoptimizationhub.model.UpdatePreferencesRequest
      .builder()
      .optionallyWith(savingsEstimationMode.map(value => value.unwrap))(
        _.savingsEstimationMode
      )
      .optionallyWith(
        memberAccountDiscountVisibility.map(value => value.unwrap)
      )(_.memberAccountDiscountVisibility)
      .build()
  }
  def asReadOnly
      : zio.aws.costoptimizationhub.model.UpdatePreferencesRequest.ReadOnly =
    zio.aws.costoptimizationhub.model.UpdatePreferencesRequest
      .wrap(buildAwsValue())
}
object UpdatePreferencesRequest {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.costoptimizationhub.model.UpdatePreferencesRequest
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.costoptimizationhub.model.UpdatePreferencesRequest =
      zio.aws.costoptimizationhub.model.UpdatePreferencesRequest(
        savingsEstimationMode.map(value => value),
        memberAccountDiscountVisibility.map(value => value)
      )
    def savingsEstimationMode
        : Optional[zio.aws.costoptimizationhub.model.SavingsEstimationMode]
    def memberAccountDiscountVisibility: Optional[
      zio.aws.costoptimizationhub.model.MemberAccountDiscountVisibility
    ]
    def getSavingsEstimationMode: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.SavingsEstimationMode
    ] =
      AwsError.unwrapOptionField("savingsEstimationMode", savingsEstimationMode)
    def getMemberAccountDiscountVisibility: ZIO[
      Any,
      AwsError,
      zio.aws.costoptimizationhub.model.MemberAccountDiscountVisibility
    ] = AwsError.unwrapOptionField(
      "memberAccountDiscountVisibility",
      memberAccountDiscountVisibility
    )
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.UpdatePreferencesRequest
  ) extends zio.aws.costoptimizationhub.model.UpdatePreferencesRequest.ReadOnly {
    override val savingsEstimationMode
        : Optional[zio.aws.costoptimizationhub.model.SavingsEstimationMode] =
      zio.aws.core.internal
        .optionalFromNullable(impl.savingsEstimationMode())
        .map(value =>
          zio.aws.costoptimizationhub.model.SavingsEstimationMode.wrap(value)
        )
    override val memberAccountDiscountVisibility: Optional[
      zio.aws.costoptimizationhub.model.MemberAccountDiscountVisibility
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.memberAccountDiscountVisibility())
      .map(value =>
        zio.aws.costoptimizationhub.model.MemberAccountDiscountVisibility
          .wrap(value)
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.UpdatePreferencesRequest
  ): zio.aws.costoptimizationhub.model.UpdatePreferencesRequest.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy