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

io.github.vigoo.zioaws.rdsdata.model.UpdateResult.scala Maven / Gradle / Ivy

There is a newer version: 4.17.280.4
Show newest version
package io.github.vigoo.zioaws.rdsdata.model
import zio.ZIO
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters.*
final case class UpdateResult(
    generatedFields: Option[
      Iterable[io.github.vigoo.zioaws.rdsdata.model.Field]
    ] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.rdsdata.model.UpdateResult = {
    import UpdateResult.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.rdsdata.model.UpdateResult
      .builder()
      .optionallyWith(
        generatedFields.map(value =>
          value.map { item =>
            item.buildAwsValue()
          }.asJavaCollection
        )
      )(_.generatedFields)
      .build()
  }
  def asReadOnly: io.github.vigoo.zioaws.rdsdata.model.UpdateResult.ReadOnly =
    io.github.vigoo.zioaws.rdsdata.model.UpdateResult.wrap(buildAwsValue())
}
object UpdateResult {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.rdsdata.model.UpdateResult
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable: io.github.vigoo.zioaws.rdsdata.model.UpdateResult =
      io.github.vigoo.zioaws.rdsdata.model.UpdateResult(
        generatedFieldsValue.map(value =>
          value.map { item =>
            item.editable
          }
        )
      )
    def generatedFieldsValue
        : Option[List[io.github.vigoo.zioaws.rdsdata.model.Field.ReadOnly]]
    def generatedFields: ZIO[Any, AwsError, List[
      io.github.vigoo.zioaws.rdsdata.model.Field.ReadOnly
    ]] = AwsError.unwrapOptionField("generatedFields", generatedFieldsValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.rdsdata.model.UpdateResult
  ) extends io.github.vigoo.zioaws.rdsdata.model.UpdateResult.ReadOnly {
    override def generatedFieldsValue
        : Option[List[io.github.vigoo.zioaws.rdsdata.model.Field.ReadOnly]] =
      scala
        .Option(impl.generatedFields())
        .map(value =>
          value.asScala.map { item =>
            io.github.vigoo.zioaws.rdsdata.model.Field.wrap(item)
          }.toList
        )
  }
  def wrap(
      impl: software.amazon.awssdk.services.rdsdata.model.UpdateResult
  ): io.github.vigoo.zioaws.rdsdata.model.UpdateResult.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy