io.github.vigoo.zioaws.rdsdata.model.UpdateResult.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-rdsdata_3 Show documentation
Show all versions of zio-aws-rdsdata_3 Show documentation
Low-level AWS wrapper for ZIO
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