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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy