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

io.github.vigoo.zioaws.redshiftdata.model.SubStatementData.scala Maven / Gradle / Ivy

package io.github.vigoo.zioaws.redshiftdata.model
import scala.jdk.CollectionConverters.*
import java.time.Instant
import zio.{ Chunk, ZIO }
import software.amazon.awssdk.core.SdkBytes
final case class SubStatementData(createdAt: scala.Option[primitives.Timestamp] = None, duration: scala.Option[Long] = None, error: scala.Option[String] = None, hasResultSet: scala.Option[Boolean] = None, id: primitives.StatementId, queryString: scala.Option[primitives.StatementString] = None, redshiftQueryId: scala.Option[Long] = None, resultRows: scala.Option[Long] = None, resultSize: scala.Option[Long] = None, status: scala.Option[StatementStatusString] = None, updatedAt: scala.Option[primitives.Timestamp] = None) {
  def buildAwsValue(): software.amazon.awssdk.services.redshiftdata.model.SubStatementData = {
    import SubStatementData.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.redshiftdata.model.SubStatementData.builder().optionallyWith(createdAt.map(value => value: java.time.Instant))(_.createdAt).optionallyWith(duration.map(value => value: java.lang.Long))(_.duration).optionallyWith(error.map(value => value: java.lang.String))(_.error).optionallyWith(hasResultSet.map(value => value: java.lang.Boolean))(_.hasResultSet).id(id: java.lang.String).optionallyWith(queryString.map(value => value: java.lang.String))(_.queryString).optionallyWith(redshiftQueryId.map(value => value: java.lang.Long))(_.redshiftQueryId).optionallyWith(resultRows.map(value => value: java.lang.Long))(_.resultRows).optionallyWith(resultSize.map(value => value: java.lang.Long))(_.resultSize).optionallyWith(status.map(value => value.unwrap))(_.status).optionallyWith(updatedAt.map(value => value: java.time.Instant))(_.updatedAt).build()
  }
  def asReadOnly: SubStatementData.ReadOnly = SubStatementData.wrap(buildAwsValue())
}
object SubStatementData {
  private lazy val zioAwsBuilderHelper: io.github.vigoo.zioaws.core.BuilderHelper[software.amazon.awssdk.services.redshiftdata.model.SubStatementData] = io.github.vigoo.zioaws.core.BuilderHelper.apply
  trait ReadOnly {
    def editable: SubStatementData = SubStatementData(createdAtValue.map(value => value), durationValue.map(value => value), errorValue.map(value => value), hasResultSetValue.map(value => value), idValue, queryStringValue.map(value => value), redshiftQueryIdValue.map(value => value), resultRowsValue.map(value => value), resultSizeValue.map(value => value), statusValue.map(value => value), updatedAtValue.map(value => value))
    def createdAtValue: scala.Option[primitives.Timestamp]
    def durationValue: scala.Option[Long]
    def errorValue: scala.Option[String]
    def hasResultSetValue: scala.Option[Boolean]
    def idValue: primitives.StatementId
    def queryStringValue: scala.Option[primitives.StatementString]
    def redshiftQueryIdValue: scala.Option[Long]
    def resultRowsValue: scala.Option[Long]
    def resultSizeValue: scala.Option[Long]
    def statusValue: scala.Option[StatementStatusString]
    def updatedAtValue: scala.Option[primitives.Timestamp]
    def createdAt: ZIO[Any, io.github.vigoo.zioaws.core.AwsError, primitives.Timestamp] = io.github.vigoo.zioaws.core.AwsError.unwrapOptionField("createdAt", createdAtValue)
    def duration: ZIO[Any, io.github.vigoo.zioaws.core.AwsError, Long] = io.github.vigoo.zioaws.core.AwsError.unwrapOptionField("duration", durationValue)
    def error: ZIO[Any, io.github.vigoo.zioaws.core.AwsError, String] = io.github.vigoo.zioaws.core.AwsError.unwrapOptionField("error", errorValue)
    def hasResultSet: ZIO[Any, io.github.vigoo.zioaws.core.AwsError, Boolean] = io.github.vigoo.zioaws.core.AwsError.unwrapOptionField("hasResultSet", hasResultSetValue)
    def id: ZIO[Any, Nothing, primitives.StatementId] = ZIO.succeed(idValue)
    def queryString: ZIO[Any, io.github.vigoo.zioaws.core.AwsError, primitives.StatementString] = io.github.vigoo.zioaws.core.AwsError.unwrapOptionField("queryString", queryStringValue)
    def redshiftQueryId: ZIO[Any, io.github.vigoo.zioaws.core.AwsError, Long] = io.github.vigoo.zioaws.core.AwsError.unwrapOptionField("redshiftQueryId", redshiftQueryIdValue)
    def resultRows: ZIO[Any, io.github.vigoo.zioaws.core.AwsError, Long] = io.github.vigoo.zioaws.core.AwsError.unwrapOptionField("resultRows", resultRowsValue)
    def resultSize: ZIO[Any, io.github.vigoo.zioaws.core.AwsError, Long] = io.github.vigoo.zioaws.core.AwsError.unwrapOptionField("resultSize", resultSizeValue)
    def status: ZIO[Any, io.github.vigoo.zioaws.core.AwsError, StatementStatusString] = io.github.vigoo.zioaws.core.AwsError.unwrapOptionField("status", statusValue)
    def updatedAt: ZIO[Any, io.github.vigoo.zioaws.core.AwsError, primitives.Timestamp] = io.github.vigoo.zioaws.core.AwsError.unwrapOptionField("updatedAt", updatedAtValue)
  }
  private class Wrapper(impl: software.amazon.awssdk.services.redshiftdata.model.SubStatementData) extends SubStatementData.ReadOnly {
    override def createdAtValue: scala.Option[primitives.Timestamp] = scala.Option(impl.createdAt()).map(value => value: primitives.Timestamp)
    override def durationValue: scala.Option[Long] = scala.Option(impl.duration()).map(value => value: Long)
    override def errorValue: scala.Option[String] = scala.Option(impl.error()).map(value => value: String)
    override def hasResultSetValue: scala.Option[Boolean] = scala.Option(impl.hasResultSet()).map(value => value: Boolean)
    override def idValue: primitives.StatementId = impl.id(): primitives.StatementId
    override def queryStringValue: scala.Option[primitives.StatementString] = scala.Option(impl.queryString()).map(value => value: primitives.StatementString)
    override def redshiftQueryIdValue: scala.Option[Long] = scala.Option(impl.redshiftQueryId()).map(value => value: Long)
    override def resultRowsValue: scala.Option[Long] = scala.Option(impl.resultRows()).map(value => value: Long)
    override def resultSizeValue: scala.Option[Long] = scala.Option(impl.resultSize()).map(value => value: Long)
    override def statusValue: scala.Option[StatementStatusString] = scala.Option(impl.status()).map(value => StatementStatusString.wrap(value))
    override def updatedAtValue: scala.Option[primitives.Timestamp] = scala.Option(impl.updatedAt()).map(value => value: primitives.Timestamp)
  }
  def wrap(impl: software.amazon.awssdk.services.redshiftdata.model.SubStatementData): ReadOnly = new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy