zio.aws.costoptimizationhub.model.RedshiftReservedInstancesConfiguration.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 RedshiftReservedInstancesConfiguration(
accountScope: Optional[String] = Optional.Absent,
service: Optional[String] = Optional.Absent,
normalizedUnitsToPurchase: Optional[String] = Optional.Absent,
term: Optional[String] = Optional.Absent,
paymentOption: Optional[String] = Optional.Absent,
numberOfInstancesToPurchase: Optional[String] = Optional.Absent,
instanceFamily: Optional[String] = Optional.Absent,
instanceType: Optional[String] = Optional.Absent,
reservedInstancesRegion: Optional[String] = Optional.Absent,
sizeFlexEligible: Optional[Boolean] = Optional.Absent,
currentGeneration: Optional[String] = Optional.Absent,
upfrontCost: Optional[String] = Optional.Absent,
monthlyRecurringCost: Optional[String] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.costoptimizationhub.model.RedshiftReservedInstancesConfiguration = {
import RedshiftReservedInstancesConfiguration.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.costoptimizationhub.model.RedshiftReservedInstancesConfiguration
.builder()
.optionallyWith(accountScope.map(value => value: java.lang.String))(
_.accountScope
)
.optionallyWith(service.map(value => value: java.lang.String))(_.service)
.optionallyWith(
normalizedUnitsToPurchase.map(value => value: java.lang.String)
)(_.normalizedUnitsToPurchase)
.optionallyWith(term.map(value => value: java.lang.String))(_.term)
.optionallyWith(paymentOption.map(value => value: java.lang.String))(
_.paymentOption
)
.optionallyWith(
numberOfInstancesToPurchase.map(value => value: java.lang.String)
)(_.numberOfInstancesToPurchase)
.optionallyWith(instanceFamily.map(value => value: java.lang.String))(
_.instanceFamily
)
.optionallyWith(instanceType.map(value => value: java.lang.String))(
_.instanceType
)
.optionallyWith(
reservedInstancesRegion.map(value => value: java.lang.String)
)(_.reservedInstancesRegion)
.optionallyWith(sizeFlexEligible.map(value => value: java.lang.Boolean))(
_.sizeFlexEligible
)
.optionallyWith(currentGeneration.map(value => value: java.lang.String))(
_.currentGeneration
)
.optionallyWith(upfrontCost.map(value => value: java.lang.String))(
_.upfrontCost
)
.optionallyWith(
monthlyRecurringCost.map(value => value: java.lang.String)
)(_.monthlyRecurringCost)
.build()
}
def asReadOnly
: zio.aws.costoptimizationhub.model.RedshiftReservedInstancesConfiguration.ReadOnly =
zio.aws.costoptimizationhub.model.RedshiftReservedInstancesConfiguration
.wrap(buildAwsValue())
}
object RedshiftReservedInstancesConfiguration {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.costoptimizationhub.model.RedshiftReservedInstancesConfiguration
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.costoptimizationhub.model.RedshiftReservedInstancesConfiguration =
zio.aws.costoptimizationhub.model.RedshiftReservedInstancesConfiguration(
accountScope.map(value => value),
service.map(value => value),
normalizedUnitsToPurchase.map(value => value),
term.map(value => value),
paymentOption.map(value => value),
numberOfInstancesToPurchase.map(value => value),
instanceFamily.map(value => value),
instanceType.map(value => value),
reservedInstancesRegion.map(value => value),
sizeFlexEligible.map(value => value),
currentGeneration.map(value => value),
upfrontCost.map(value => value),
monthlyRecurringCost.map(value => value)
)
def accountScope: Optional[String]
def service: Optional[String]
def normalizedUnitsToPurchase: Optional[String]
def term: Optional[String]
def paymentOption: Optional[String]
def numberOfInstancesToPurchase: Optional[String]
def instanceFamily: Optional[String]
def instanceType: Optional[String]
def reservedInstancesRegion: Optional[String]
def sizeFlexEligible: Optional[Boolean]
def currentGeneration: Optional[String]
def upfrontCost: Optional[String]
def monthlyRecurringCost: Optional[String]
def getAccountScope: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("accountScope", accountScope)
def getService: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("service", service)
def getNormalizedUnitsToPurchase: ZIO[Any, AwsError, String] = AwsError
.unwrapOptionField("normalizedUnitsToPurchase", normalizedUnitsToPurchase)
def getTerm: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("term", term)
def getPaymentOption: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("paymentOption", paymentOption)
def getNumberOfInstancesToPurchase: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField(
"numberOfInstancesToPurchase",
numberOfInstancesToPurchase
)
def getInstanceFamily: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("instanceFamily", instanceFamily)
def getInstanceType: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("instanceType", instanceType)
def getReservedInstancesRegion: ZIO[Any, AwsError, String] = AwsError
.unwrapOptionField("reservedInstancesRegion", reservedInstancesRegion)
def getSizeFlexEligible: ZIO[Any, AwsError, Boolean] =
AwsError.unwrapOptionField("sizeFlexEligible", sizeFlexEligible)
def getCurrentGeneration: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("currentGeneration", currentGeneration)
def getUpfrontCost: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("upfrontCost", upfrontCost)
def getMonthlyRecurringCost: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("monthlyRecurringCost", monthlyRecurringCost)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.costoptimizationhub.model.RedshiftReservedInstancesConfiguration
) extends zio.aws.costoptimizationhub.model.RedshiftReservedInstancesConfiguration.ReadOnly {
override val accountScope: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.accountScope())
.map(value => value: String)
override val service: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.service())
.map(value => value: String)
override val normalizedUnitsToPurchase: Optional[String] =
zio.aws.core.internal
.optionalFromNullable(impl.normalizedUnitsToPurchase())
.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 numberOfInstancesToPurchase: Optional[String] =
zio.aws.core.internal
.optionalFromNullable(impl.numberOfInstancesToPurchase())
.map(value => value: String)
override val instanceFamily: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.instanceFamily())
.map(value => value: String)
override val instanceType: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.instanceType())
.map(value => value: String)
override val reservedInstancesRegion: Optional[String] =
zio.aws.core.internal
.optionalFromNullable(impl.reservedInstancesRegion())
.map(value => value: String)
override val sizeFlexEligible: Optional[Boolean] = zio.aws.core.internal
.optionalFromNullable(impl.sizeFlexEligible())
.map(value => value: Boolean)
override val currentGeneration: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.currentGeneration())
.map(value => value: String)
override val upfrontCost: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.upfrontCost())
.map(value => value: String)
override val monthlyRecurringCost: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.monthlyRecurringCost())
.map(value => value: String)
}
def wrap(
impl: software.amazon.awssdk.services.costoptimizationhub.model.RedshiftReservedInstancesConfiguration
): zio.aws.costoptimizationhub.model.RedshiftReservedInstancesConfiguration.ReadOnly =
new Wrapper(impl)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy