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

io.github.vigoo.zioaws.rdsdata.model.ResultSetOptions.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 ResultSetOptions(
    decimalReturnType: Option[
      io.github.vigoo.zioaws.rdsdata.model.DecimalReturnType
    ] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.rdsdata.model.ResultSetOptions = {
    import ResultSetOptions.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.rdsdata.model.ResultSetOptions
      .builder()
      .optionallyWith(decimalReturnType.map(value => value.unwrap))(
        _.decimalReturnType
      )
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.rdsdata.model.ResultSetOptions.ReadOnly =
    io.github.vigoo.zioaws.rdsdata.model.ResultSetOptions.wrap(buildAwsValue())
}
object ResultSetOptions {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.rdsdata.model.ResultSetOptions
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable: io.github.vigoo.zioaws.rdsdata.model.ResultSetOptions =
      io.github.vigoo.zioaws.rdsdata.model
        .ResultSetOptions(decimalReturnTypeValue.map(value => value))
    def decimalReturnTypeValue
        : Option[io.github.vigoo.zioaws.rdsdata.model.DecimalReturnType]
    def decimalReturnType: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.rdsdata.model.DecimalReturnType
    ] = AwsError.unwrapOptionField("decimalReturnType", decimalReturnTypeValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.rdsdata.model.ResultSetOptions
  ) extends io.github.vigoo.zioaws.rdsdata.model.ResultSetOptions.ReadOnly {
    override def decimalReturnTypeValue
        : Option[io.github.vigoo.zioaws.rdsdata.model.DecimalReturnType] = scala
      .Option(impl.decimalReturnType())
      .map(value =>
        io.github.vigoo.zioaws.rdsdata.model.DecimalReturnType.wrap(value)
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.rdsdata.model.ResultSetOptions
  ): io.github.vigoo.zioaws.rdsdata.model.ResultSetOptions.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy