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