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

io.github.vigoo.zioaws.rdsdata.model.ArrayValue.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.rdsdata.model.primitives.{
  BoxedLong,
  BoxedDouble,
  BoxedBoolean
}
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters.*
final case class ArrayValue(
    arrayValues: Option[
      Iterable[io.github.vigoo.zioaws.rdsdata.model.ArrayValue]
    ] = None,
    booleanValues: Option[Iterable[BoxedBoolean]] = None,
    doubleValues: Option[Iterable[BoxedDouble]] = None,
    longValues: Option[Iterable[BoxedLong]] = None,
    stringValues: Option[Iterable[String]] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.rdsdata.model.ArrayValue = {
    import ArrayValue.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.rdsdata.model.ArrayValue
      .builder()
      .optionallyWith(
        arrayValues.map(value =>
          value.map { item =>
            item.buildAwsValue()
          }.asJavaCollection
        )
      )(_.arrayValues)
      .optionallyWith(
        booleanValues.map(value =>
          value.map { item =>
            item: java.lang.Boolean
          }.asJavaCollection
        )
      )(_.booleanValues)
      .optionallyWith(
        doubleValues.map(value =>
          value.map { item =>
            item: java.lang.Double
          }.asJavaCollection
        )
      )(_.doubleValues)
      .optionallyWith(
        longValues.map(value =>
          value.map { item =>
            item: java.lang.Long
          }.asJavaCollection
        )
      )(_.longValues)
      .optionallyWith(
        stringValues.map(value =>
          value.map { item =>
            item: java.lang.String
          }.asJavaCollection
        )
      )(_.stringValues)
      .build()
  }
  def asReadOnly: io.github.vigoo.zioaws.rdsdata.model.ArrayValue.ReadOnly =
    io.github.vigoo.zioaws.rdsdata.model.ArrayValue.wrap(buildAwsValue())
}
object ArrayValue {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.rdsdata.model.ArrayValue
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable: io.github.vigoo.zioaws.rdsdata.model.ArrayValue =
      io.github.vigoo.zioaws.rdsdata.model.ArrayValue(
        arrayValuesValue.map(value =>
          value.map { item =>
            item.editable
          }
        ),
        booleanValuesValue.map(value => value),
        doubleValuesValue.map(value => value),
        longValuesValue.map(value => value),
        stringValuesValue.map(value => value)
      )
    def arrayValuesValue
        : Option[List[io.github.vigoo.zioaws.rdsdata.model.ArrayValue.ReadOnly]]
    def booleanValuesValue: Option[List[BoxedBoolean]]
    def doubleValuesValue: Option[List[BoxedDouble]]
    def longValuesValue: Option[List[BoxedLong]]
    def stringValuesValue: Option[List[String]]
    def arrayValues: ZIO[Any, AwsError, List[
      io.github.vigoo.zioaws.rdsdata.model.ArrayValue.ReadOnly
    ]] = AwsError.unwrapOptionField("arrayValues", arrayValuesValue)
    def booleanValues: ZIO[Any, AwsError, List[BoxedBoolean]] =
      AwsError.unwrapOptionField("booleanValues", booleanValuesValue)
    def doubleValues: ZIO[Any, AwsError, List[BoxedDouble]] =
      AwsError.unwrapOptionField("doubleValues", doubleValuesValue)
    def longValues: ZIO[Any, AwsError, List[BoxedLong]] =
      AwsError.unwrapOptionField("longValues", longValuesValue)
    def stringValues: ZIO[Any, AwsError, List[String]] =
      AwsError.unwrapOptionField("stringValues", stringValuesValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.rdsdata.model.ArrayValue
  ) extends io.github.vigoo.zioaws.rdsdata.model.ArrayValue.ReadOnly {
    override def arrayValuesValue: Option[
      List[io.github.vigoo.zioaws.rdsdata.model.ArrayValue.ReadOnly]
    ] = scala
      .Option(impl.arrayValues())
      .map(value =>
        value.asScala.map { item =>
          io.github.vigoo.zioaws.rdsdata.model.ArrayValue.wrap(item)
        }.toList
      )
    override def booleanValuesValue: Option[List[BoxedBoolean]] = scala
      .Option(impl.booleanValues())
      .map(value =>
        value.asScala.map { item =>
          item: BoxedBoolean
        }.toList
      )
    override def doubleValuesValue: Option[List[BoxedDouble]] = scala
      .Option(impl.doubleValues())
      .map(value =>
        value.asScala.map { item =>
          item: BoxedDouble
        }.toList
      )
    override def longValuesValue: Option[List[BoxedLong]] = scala
      .Option(impl.longValues())
      .map(value =>
        value.asScala.map { item =>
          item: BoxedLong
        }.toList
      )
    override def stringValuesValue: Option[List[String]] = scala
      .Option(impl.stringValues())
      .map(value =>
        value.asScala.map { item =>
          item: String
        }.toList
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.rdsdata.model.ArrayValue
  ): io.github.vigoo.zioaws.rdsdata.model.ArrayValue.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy