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

io.github.vigoo.zioaws.rdsdata.model.CommitTransactionResponse.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.TransactionStatus
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters.*
final case class CommitTransactionResponse(
    transactionStatus: Option[TransactionStatus] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.rdsdata.model.CommitTransactionResponse = {
    import CommitTransactionResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.rdsdata.model.CommitTransactionResponse
      .builder()
      .optionallyWith(transactionStatus.map(value => value: java.lang.String))(
        _.transactionStatus
      )
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.rdsdata.model.CommitTransactionResponse.ReadOnly =
    io.github.vigoo.zioaws.rdsdata.model.CommitTransactionResponse
      .wrap(buildAwsValue())
}
object CommitTransactionResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.rdsdata.model.CommitTransactionResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable
        : io.github.vigoo.zioaws.rdsdata.model.CommitTransactionResponse =
      io.github.vigoo.zioaws.rdsdata.model
        .CommitTransactionResponse(transactionStatusValue.map(value => value))
    def transactionStatusValue: Option[TransactionStatus]
    def transactionStatus: ZIO[Any, AwsError, TransactionStatus] =
      AwsError.unwrapOptionField("transactionStatus", transactionStatusValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.rdsdata.model.CommitTransactionResponse
  ) extends io.github.vigoo.zioaws.rdsdata.model.CommitTransactionResponse.ReadOnly {
    override def transactionStatusValue: Option[TransactionStatus] = scala
      .Option(impl.transactionStatus())
      .map(value => value: TransactionStatus)
  }
  def wrap(
      impl: software.amazon.awssdk.services.rdsdata.model.CommitTransactionResponse
  ): io.github.vigoo.zioaws.rdsdata.model.CommitTransactionResponse.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy