zio.aws.costoptimizationhub.model.GetPreferencesResponse.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 GetPreferencesResponse(
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.GetPreferencesResponse = {
import GetPreferencesResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.costoptimizationhub.model.GetPreferencesResponse
.builder()
.optionallyWith(savingsEstimationMode.map(value => value.unwrap))(
_.savingsEstimationMode
)
.optionallyWith(
memberAccountDiscountVisibility.map(value => value.unwrap)
)(_.memberAccountDiscountVisibility)
.build()
}
def asReadOnly
: zio.aws.costoptimizationhub.model.GetPreferencesResponse.ReadOnly =
zio.aws.costoptimizationhub.model.GetPreferencesResponse
.wrap(buildAwsValue())
}
object GetPreferencesResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.costoptimizationhub.model.GetPreferencesResponse
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.costoptimizationhub.model.GetPreferencesResponse =
zio.aws.costoptimizationhub.model.GetPreferencesResponse(
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.GetPreferencesResponse
) extends zio.aws.costoptimizationhub.model.GetPreferencesResponse.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.GetPreferencesResponse
): zio.aws.costoptimizationhub.model.GetPreferencesResponse.ReadOnly =
new Wrapper(impl)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy