zio.aws.snowdevicemanagement.model.ListExecutionsResponse.scala Maven / Gradle / Ivy
The newest version!
package zio.aws.snowdevicemanagement.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import zio.aws.snowdevicemanagement.model.primitives.NextToken
import scala.jdk.CollectionConverters._
final case class ListExecutionsResponse(
executions: Optional[
Iterable[zio.aws.snowdevicemanagement.model.ExecutionSummary]
] = Optional.Absent,
nextToken: Optional[NextToken] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.snowdevicemanagement.model.ListExecutionsResponse = {
import ListExecutionsResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.snowdevicemanagement.model.ListExecutionsResponse
.builder()
.optionallyWith(
executions.map(value =>
value.map { item =>
item.buildAwsValue()
}.asJavaCollection
)
)(_.executions)
.optionallyWith(
nextToken.map(value => NextToken.unwrap(value): java.lang.String)
)(_.nextToken)
.build()
}
def asReadOnly
: zio.aws.snowdevicemanagement.model.ListExecutionsResponse.ReadOnly =
zio.aws.snowdevicemanagement.model.ListExecutionsResponse
.wrap(buildAwsValue())
}
object ListExecutionsResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.snowdevicemanagement.model.ListExecutionsResponse
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.snowdevicemanagement.model.ListExecutionsResponse =
zio.aws.snowdevicemanagement.model.ListExecutionsResponse(
executions.map(value =>
value.map { item =>
item.asEditable
}
),
nextToken.map(value => value)
)
def executions: Optional[
List[zio.aws.snowdevicemanagement.model.ExecutionSummary.ReadOnly]
]
def nextToken: Optional[NextToken]
def getExecutions: ZIO[Any, AwsError, List[
zio.aws.snowdevicemanagement.model.ExecutionSummary.ReadOnly
]] = AwsError.unwrapOptionField("executions", executions)
def getNextToken: ZIO[Any, AwsError, NextToken] =
AwsError.unwrapOptionField("nextToken", nextToken)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.snowdevicemanagement.model.ListExecutionsResponse
) extends zio.aws.snowdevicemanagement.model.ListExecutionsResponse.ReadOnly {
override val executions: Optional[
List[zio.aws.snowdevicemanagement.model.ExecutionSummary.ReadOnly]
] = zio.aws.core.internal
.optionalFromNullable(impl.executions())
.map(value =>
value.asScala.map { item =>
zio.aws.snowdevicemanagement.model.ExecutionSummary.wrap(item)
}.toList
)
override val nextToken: Optional[NextToken] = zio.aws.core.internal
.optionalFromNullable(impl.nextToken())
.map(value =>
zio.aws.snowdevicemanagement.model.primitives.NextToken(value)
)
}
def wrap(
impl: software.amazon.awssdk.services.snowdevicemanagement.model.ListExecutionsResponse
): zio.aws.snowdevicemanagement.model.ListExecutionsResponse.ReadOnly =
new Wrapper(impl)
}