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

zio.aws.tnb.model.ListSolNetworkPackagesResponse.scala Maven / Gradle / Ivy

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy