zio.aws.costoptimizationhub.model.ElastiCacheReservedInstances.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 ElastiCacheReservedInstances(
configuration: Optional[
zio.aws.costoptimizationhub.model.ElastiCacheReservedInstancesConfiguration
] = Optional.Absent,
costCalculation: Optional[
zio.aws.costoptimizationhub.model.ReservedInstancesCostCalculation
] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.costoptimizationhub.model.ElastiCacheReservedInstances = {
import ElastiCacheReservedInstances.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.costoptimizationhub.model.ElastiCacheReservedInstances
.builder()
.optionallyWith(configuration.map(value => value.buildAwsValue()))(
_.configuration
)
.optionallyWith(costCalculation.map(value => value.buildAwsValue()))(
_.costCalculation
)
.build()
}
def asReadOnly
: zio.aws.costoptimizationhub.model.ElastiCacheReservedInstances.ReadOnly =
zio.aws.costoptimizationhub.model.ElastiCacheReservedInstances
.wrap(buildAwsValue())
}
object ElastiCacheReservedInstances {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.costoptimizationhub.model.ElastiCacheReservedInstances
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.costoptimizationhub.model.ElastiCacheReservedInstances =
zio.aws.costoptimizationhub.model.ElastiCacheReservedInstances(
configuration.map(value => value.asEditable),
costCalculation.map(value => value.asEditable)
)
def configuration: Optional[
zio.aws.costoptimizationhub.model.ElastiCacheReservedInstancesConfiguration.ReadOnly
]
def costCalculation: Optional[
zio.aws.costoptimizationhub.model.ReservedInstancesCostCalculation.ReadOnly
]
def getConfiguration: ZIO[
Any,
AwsError,
zio.aws.costoptimizationhub.model.ElastiCacheReservedInstancesConfiguration.ReadOnly
] = AwsError.unwrapOptionField("configuration", configuration)
def getCostCalculation: ZIO[
Any,
AwsError,
zio.aws.costoptimizationhub.model.ReservedInstancesCostCalculation.ReadOnly
] = AwsError.unwrapOptionField("costCalculation", costCalculation)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.costoptimizationhub.model.ElastiCacheReservedInstances
) extends zio.aws.costoptimizationhub.model.ElastiCacheReservedInstances.ReadOnly {
override val configuration: Optional[
zio.aws.costoptimizationhub.model.ElastiCacheReservedInstancesConfiguration.ReadOnly
] = zio.aws.core.internal
.optionalFromNullable(impl.configuration())
.map(value =>
zio.aws.costoptimizationhub.model.ElastiCacheReservedInstancesConfiguration
.wrap(value)
)
override val costCalculation: Optional[
zio.aws.costoptimizationhub.model.ReservedInstancesCostCalculation.ReadOnly
] = zio.aws.core.internal
.optionalFromNullable(impl.costCalculation())
.map(value =>
zio.aws.costoptimizationhub.model.ReservedInstancesCostCalculation
.wrap(value)
)
}
def wrap(
impl: software.amazon.awssdk.services.costoptimizationhub.model.ElastiCacheReservedInstances
): zio.aws.costoptimizationhub.model.ElastiCacheReservedInstances.ReadOnly =
new Wrapper(impl)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy