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