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

zio.aws.verifiedpermissions.model.EntitiesDefinition.scala Maven / Gradle / Ivy

There is a newer version: 7.28.29.5
Show newest version
package zio.aws.verifiedpermissions.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class EntitiesDefinition(
    entityList: Optional[
      Iterable[zio.aws.verifiedpermissions.model.EntityItem]
    ] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.verifiedpermissions.model.EntitiesDefinition = {
    import EntitiesDefinition.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.verifiedpermissions.model.EntitiesDefinition
      .builder()
      .optionallyWith(
        entityList.map(value =>
          value.map { item =>
            item.buildAwsValue()
          }.asJavaCollection
        )
      )(_.entityList)
      .build()
  }
  def asReadOnly
      : zio.aws.verifiedpermissions.model.EntitiesDefinition.ReadOnly =
    zio.aws.verifiedpermissions.model.EntitiesDefinition.wrap(buildAwsValue())
}
object EntitiesDefinition {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.verifiedpermissions.model.EntitiesDefinition
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.verifiedpermissions.model.EntitiesDefinition =
      zio.aws.verifiedpermissions.model.EntitiesDefinition(
        entityList.map(value =>
          value.map { item =>
            item.asEditable
          }
        )
      )
    def entityList
        : Optional[List[zio.aws.verifiedpermissions.model.EntityItem.ReadOnly]]
    def getEntityList: ZIO[Any, AwsError, List[
      zio.aws.verifiedpermissions.model.EntityItem.ReadOnly
    ]] = AwsError.unwrapOptionField("entityList", entityList)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.verifiedpermissions.model.EntitiesDefinition
  ) extends zio.aws.verifiedpermissions.model.EntitiesDefinition.ReadOnly {
    override val entityList: Optional[
      List[zio.aws.verifiedpermissions.model.EntityItem.ReadOnly]
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.entityList())
      .map(value =>
        value.asScala.map { item =>
          zio.aws.verifiedpermissions.model.EntityItem.wrap(item)
        }.toList
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.verifiedpermissions.model.EntitiesDefinition
  ): zio.aws.verifiedpermissions.model.EntitiesDefinition.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy