All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy