
io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeInstancesHealthResponse.scala Maven / Gradle / Ivy
package io.github.vigoo.zioaws.elasticbeanstalk.model
import zio.ZIO
import io.github.vigoo.zioaws.elasticbeanstalk.model.primitives.{
NextToken,
RefreshedAt
}
import java.time.Instant
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters._
final case class DescribeInstancesHealthResponse(
instanceHealthList: Option[Iterable[
io.github.vigoo.zioaws.elasticbeanstalk.model.SingleInstanceHealth
]] = None,
refreshedAt: Option[RefreshedAt] = None,
nextToken: Option[NextToken] = None
) {
def buildAwsValue()
: software.amazon.awssdk.services.elasticbeanstalk.model.DescribeInstancesHealthResponse = {
import DescribeInstancesHealthResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.elasticbeanstalk.model.DescribeInstancesHealthResponse
.builder()
.optionallyWith(
instanceHealthList.map(value =>
value.map { item =>
item.buildAwsValue()
}.asJavaCollection
)
)(_.instanceHealthList)
.optionallyWith(refreshedAt.map(value => value: Instant))(_.refreshedAt)
.optionallyWith(nextToken.map(value => value: java.lang.String))(
_.nextToken
)
.build()
}
def asReadOnly
: io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeInstancesHealthResponse.ReadOnly =
io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeInstancesHealthResponse
.wrap(buildAwsValue())
}
object DescribeInstancesHealthResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.elasticbeanstalk.model.DescribeInstancesHealthResponse
] = BuilderHelper.apply
trait ReadOnly {
def editable
: io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeInstancesHealthResponse =
io.github.vigoo.zioaws.elasticbeanstalk.model
.DescribeInstancesHealthResponse(
instanceHealthListValue.map(value =>
value.map { item =>
item.editable
}
),
refreshedAtValue.map(value => value),
nextTokenValue.map(value => value)
)
def instanceHealthListValue: Option[List[
io.github.vigoo.zioaws.elasticbeanstalk.model.SingleInstanceHealth.ReadOnly
]]
def refreshedAtValue: Option[RefreshedAt]
def nextTokenValue: Option[NextToken]
def instanceHealthList: ZIO[Any, AwsError, List[
io.github.vigoo.zioaws.elasticbeanstalk.model.SingleInstanceHealth.ReadOnly
]] =
AwsError.unwrapOptionField("instanceHealthList", instanceHealthListValue)
def refreshedAt: ZIO[Any, AwsError, RefreshedAt] =
AwsError.unwrapOptionField("refreshedAt", refreshedAtValue)
def nextToken: ZIO[Any, AwsError, NextToken] =
AwsError.unwrapOptionField("nextToken", nextTokenValue)
}
private class Wrapper(
impl: software.amazon.awssdk.services.elasticbeanstalk.model.DescribeInstancesHealthResponse
) extends io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeInstancesHealthResponse.ReadOnly {
override def instanceHealthListValue: Option[List[
io.github.vigoo.zioaws.elasticbeanstalk.model.SingleInstanceHealth.ReadOnly
]] = scala
.Option(impl.instanceHealthList())
.map(value =>
value.asScala.map { item =>
io.github.vigoo.zioaws.elasticbeanstalk.model.SingleInstanceHealth
.wrap(item)
}.toList
)
override def refreshedAtValue: Option[RefreshedAt] =
scala.Option(impl.refreshedAt()).map(value => value: RefreshedAt)
override def nextTokenValue: Option[NextToken] =
scala.Option(impl.nextToken()).map(value => value: NextToken)
}
def wrap(
impl: software.amazon.awssdk.services.elasticbeanstalk.model.DescribeInstancesHealthResponse
): io.github.vigoo.zioaws.elasticbeanstalk.model.DescribeInstancesHealthResponse.ReadOnly =
new Wrapper(impl)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy