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