zio.aws.costoptimizationhub.model.Ec2InstanceSavingsPlansConfiguration.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 Ec2InstanceSavingsPlansConfiguration(
accountScope: Optional[String] = Optional.Absent,
term: Optional[String] = Optional.Absent,
paymentOption: Optional[String] = Optional.Absent,
hourlyCommitment: Optional[String] = Optional.Absent,
instanceFamily: Optional[String] = Optional.Absent,
savingsPlansRegion: Optional[String] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.costoptimizationhub.model.Ec2InstanceSavingsPlansConfiguration = {
import Ec2InstanceSavingsPlansConfiguration.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.costoptimizationhub.model.Ec2InstanceSavingsPlansConfiguration
.builder()
.optionallyWith(accountScope.map(value => value: java.lang.String))(
_.accountScope
)
.optionallyWith(term.map(value => value: java.lang.String))(_.term)
.optionallyWith(paymentOption.map(value => value: java.lang.String))(
_.paymentOption
)
.optionallyWith(hourlyCommitment.map(value => value: java.lang.String))(
_.hourlyCommitment
)
.optionallyWith(instanceFamily.map(value => value: java.lang.String))(
_.instanceFamily
)
.optionallyWith(savingsPlansRegion.map(value => value: java.lang.String))(
_.savingsPlansRegion
)
.build()
}
def asReadOnly
: zio.aws.costoptimizationhub.model.Ec2InstanceSavingsPlansConfiguration.ReadOnly =
zio.aws.costoptimizationhub.model.Ec2InstanceSavingsPlansConfiguration
.wrap(buildAwsValue())
}
object Ec2InstanceSavingsPlansConfiguration {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.costoptimizationhub.model.Ec2InstanceSavingsPlansConfiguration
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.costoptimizationhub.model.Ec2InstanceSavingsPlansConfiguration =
zio.aws.costoptimizationhub.model.Ec2InstanceSavingsPlansConfiguration(
accountScope.map(value => value),
term.map(value => value),
paymentOption.map(value => value),
hourlyCommitment.map(value => value),
instanceFamily.map(value => value),
savingsPlansRegion.map(value => value)
)
def accountScope: Optional[String]
def term: Optional[String]
def paymentOption: Optional[String]
def hourlyCommitment: Optional[String]
def instanceFamily: Optional[String]
def savingsPlansRegion: Optional[String]
def getAccountScope: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("accountScope", accountScope)
def getTerm: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("term", term)
def getPaymentOption: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("paymentOption", paymentOption)
def getHourlyCommitment: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("hourlyCommitment", hourlyCommitment)
def getInstanceFamily: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("instanceFamily", instanceFamily)
def getSavingsPlansRegion: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("savingsPlansRegion", savingsPlansRegion)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.costoptimizationhub.model.Ec2InstanceSavingsPlansConfiguration
) extends zio.aws.costoptimizationhub.model.Ec2InstanceSavingsPlansConfiguration.ReadOnly {
override val accountScope: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.accountScope())
.map(value => value: String)
override val term: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.term())
.map(value => value: String)
override val paymentOption: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.paymentOption())
.map(value => value: String)
override val hourlyCommitment: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.hourlyCommitment())
.map(value => value: String)
override val instanceFamily: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.instanceFamily())
.map(value => value: String)
override val savingsPlansRegion: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.savingsPlansRegion())
.map(value => value: String)
}
def wrap(
impl: software.amazon.awssdk.services.costoptimizationhub.model.Ec2InstanceSavingsPlansConfiguration
): zio.aws.costoptimizationhub.model.Ec2InstanceSavingsPlansConfiguration.ReadOnly =
new Wrapper(impl)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy