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

zio.aws.costoptimizationhub.model.StorageConfiguration.scala Maven / Gradle / Ivy

The newest version!
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 StorageConfiguration(
    `type`: Optional[String] = Optional.Absent,
    sizeInGb: Optional[Double] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.costoptimizationhub.model.StorageConfiguration = {
    import StorageConfiguration.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.costoptimizationhub.model.StorageConfiguration
      .builder()
      .optionallyWith(`type`.map(value => value: java.lang.String))(_.`type`)
      .optionallyWith(sizeInGb.map(value => value: java.lang.Double))(
        _.sizeInGb
      )
      .build()
  }
  def asReadOnly
      : zio.aws.costoptimizationhub.model.StorageConfiguration.ReadOnly =
    zio.aws.costoptimizationhub.model.StorageConfiguration.wrap(buildAwsValue())
}
object StorageConfiguration {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.costoptimizationhub.model.StorageConfiguration
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.costoptimizationhub.model.StorageConfiguration =
      zio.aws.costoptimizationhub.model.StorageConfiguration(
        `type`.map(value => value),
        sizeInGb.map(value => value)
      )
    def `type`: Optional[String]
    def sizeInGb: Optional[Double]
    def getType: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("type", `type`)
    def getSizeInGb: ZIO[Any, AwsError, Double] =
      AwsError.unwrapOptionField("sizeInGb", sizeInGb)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.StorageConfiguration
  ) extends zio.aws.costoptimizationhub.model.StorageConfiguration.ReadOnly {
    override val `type`: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.`type`())
      .map(value => value: String)
    override val sizeInGb: Optional[Double] = zio.aws.core.internal
      .optionalFromNullable(impl.sizeInGb())
      .map(value => value: Double)
  }
  def wrap(
      impl: software.amazon.awssdk.services.costoptimizationhub.model.StorageConfiguration
  ): zio.aws.costoptimizationhub.model.StorageConfiguration.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy