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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy