zio.aws.snowdevicemanagement.model.ListTasksResponse.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 ListTasksResponse(
nextToken: Optional[NextToken] = Optional.Absent,
tasks: Optional[Iterable[zio.aws.snowdevicemanagement.model.TaskSummary]] =
Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.snowdevicemanagement.model.ListTasksResponse = {
import ListTasksResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.snowdevicemanagement.model.ListTasksResponse
.builder()
.optionallyWith(
nextToken.map(value => NextToken.unwrap(value): java.lang.String)
)(_.nextToken)
.optionallyWith(
tasks.map(value =>
value.map { item =>
item.buildAwsValue()
}.asJavaCollection
)
)(_.tasks)
.build()
}
def asReadOnly
: zio.aws.snowdevicemanagement.model.ListTasksResponse.ReadOnly =
zio.aws.snowdevicemanagement.model.ListTasksResponse.wrap(buildAwsValue())
}
object ListTasksResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.snowdevicemanagement.model.ListTasksResponse
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.snowdevicemanagement.model.ListTasksResponse =
zio.aws.snowdevicemanagement.model.ListTasksResponse(
nextToken.map(value => value),
tasks.map(value =>
value.map { item =>
item.asEditable
}
)
)
def nextToken: Optional[NextToken]
def tasks: Optional[
List[zio.aws.snowdevicemanagement.model.TaskSummary.ReadOnly]
]
def getNextToken: ZIO[Any, AwsError, NextToken] =
AwsError.unwrapOptionField("nextToken", nextToken)
def getTasks: ZIO[Any, AwsError, List[
zio.aws.snowdevicemanagement.model.TaskSummary.ReadOnly
]] = AwsError.unwrapOptionField("tasks", tasks)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.snowdevicemanagement.model.ListTasksResponse
) extends zio.aws.snowdevicemanagement.model.ListTasksResponse.ReadOnly {
override val nextToken: Optional[NextToken] = zio.aws.core.internal
.optionalFromNullable(impl.nextToken())
.map(value =>
zio.aws.snowdevicemanagement.model.primitives.NextToken(value)
)
override val tasks: Optional[
List[zio.aws.snowdevicemanagement.model.TaskSummary.ReadOnly]
] = zio.aws.core.internal
.optionalFromNullable(impl.tasks())
.map(value =>
value.asScala.map { item =>
zio.aws.snowdevicemanagement.model.TaskSummary.wrap(item)
}.toList
)
}
def wrap(
impl: software.amazon.awssdk.services.snowdevicemanagement.model.ListTasksResponse
): zio.aws.snowdevicemanagement.model.ListTasksResponse.ReadOnly =
new Wrapper(impl)
}