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

io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeEventsResponse.scala Maven / Gradle / Ivy

package io.github.vigoo.zioaws.elasticbeanstalk.model
import zio.ZIO
import io.github.vigoo.zioaws.elasticbeanstalk.model.primitives.Token
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters._
final case class DescribeEventsResponse(
    events: Option[
      Iterable[io.github.vigoo.zioaws.elasticbeanstalk.model.EventDescription]
    ] = None,
    nextToken: Option[Token] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.elasticbeanstalk.model.DescribeEventsResponse = {
    import DescribeEventsResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.elasticbeanstalk.model.DescribeEventsResponse
      .builder()
      .optionallyWith(
        events.map(value =>
          value.map { item =>
            item.buildAwsValue()
          }.asJavaCollection
        )
      )(_.events)
      .optionallyWith(nextToken.map(value => value: java.lang.String))(
        _.nextToken
      )
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeEventsResponse.ReadOnly =
    io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeEventsResponse
      .wrap(buildAwsValue())
}
object DescribeEventsResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.elasticbeanstalk.model.DescribeEventsResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable
        : io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeEventsResponse =
      io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeEventsResponse(
        eventsValue.map(value =>
          value.map { item =>
            item.editable
          }
        ),
        nextTokenValue.map(value => value)
      )
    def eventsValue: Option[List[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EventDescription.ReadOnly
    ]]
    def nextTokenValue: Option[Token]
    def events: ZIO[Any, AwsError, List[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EventDescription.ReadOnly
    ]] = AwsError.unwrapOptionField("events", eventsValue)
    def nextToken: ZIO[Any, AwsError, Token] =
      AwsError.unwrapOptionField("nextToken", nextTokenValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.elasticbeanstalk.model.DescribeEventsResponse
  ) extends io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeEventsResponse.ReadOnly {
    override def eventsValue: Option[List[
      io.github.vigoo.zioaws.elasticbeanstalk.model.EventDescription.ReadOnly
    ]] = scala
      .Option(impl.events())
      .map(value =>
        value.asScala.map { item =>
          io.github.vigoo.zioaws.elasticbeanstalk.model.EventDescription
            .wrap(item)
        }.toList
      )
    override def nextTokenValue: Option[Token] =
      scala.Option(impl.nextToken()).map(value => value: Token)
  }
  def wrap(
      impl: software.amazon.awssdk.services.elasticbeanstalk.model.DescribeEventsResponse
  ): io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeEventsResponse.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy