zio.aws.managedblockchainquery.model.GetTransactionRequest.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.{
QueryTransactionId,
QueryTransactionHash
}
import scala.jdk.CollectionConverters.*
final case class GetTransactionRequest(
transactionHash: Optional[QueryTransactionHash] = Optional.Absent,
transactionId: Optional[QueryTransactionId] = Optional.Absent,
network: zio.aws.managedblockchainquery.model.QueryNetwork
) {
def buildAwsValue()
: software.amazon.awssdk.services.managedblockchainquery.model.GetTransactionRequest = {
import GetTransactionRequest.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.managedblockchainquery.model.GetTransactionRequest
.builder()
.optionallyWith(
transactionHash.map(value =>
QueryTransactionHash.unwrap(value): java.lang.String
)
)(_.transactionHash)
.optionallyWith(
transactionId.map(value =>
QueryTransactionId.unwrap(value): java.lang.String
)
)(_.transactionId)
.network(network.unwrap)
.build()
}
def asReadOnly
: zio.aws.managedblockchainquery.model.GetTransactionRequest.ReadOnly =
zio.aws.managedblockchainquery.model.GetTransactionRequest
.wrap(buildAwsValue())
}
object GetTransactionRequest {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.managedblockchainquery.model.GetTransactionRequest
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.managedblockchainquery.model.GetTransactionRequest =
zio.aws.managedblockchainquery.model.GetTransactionRequest(
transactionHash.map(value => value),
transactionId.map(value => value),
network
)
def transactionHash: Optional[QueryTransactionHash]
def transactionId: Optional[QueryTransactionId]
def network: zio.aws.managedblockchainquery.model.QueryNetwork
def getTransactionHash: ZIO[Any, AwsError, QueryTransactionHash] =
AwsError.unwrapOptionField("transactionHash", transactionHash)
def getTransactionId: ZIO[Any, AwsError, QueryTransactionId] =
AwsError.unwrapOptionField("transactionId", transactionId)
def getNetwork
: ZIO[Any, Nothing, zio.aws.managedblockchainquery.model.QueryNetwork] =
ZIO.succeed(network)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.managedblockchainquery.model.GetTransactionRequest
) extends zio.aws.managedblockchainquery.model.GetTransactionRequest.ReadOnly {
override val transactionHash: Optional[QueryTransactionHash] =
zio.aws.core.internal
.optionalFromNullable(impl.transactionHash())
.map(value =>
zio.aws.managedblockchainquery.model.primitives
.QueryTransactionHash(value)
)
override val transactionId: Optional[QueryTransactionId] =
zio.aws.core.internal
.optionalFromNullable(impl.transactionId())
.map(value =>
zio.aws.managedblockchainquery.model.primitives
.QueryTransactionId(value)
)
override val network: zio.aws.managedblockchainquery.model.QueryNetwork =
zio.aws.managedblockchainquery.model.QueryNetwork.wrap(impl.network())
}
def wrap(
impl: software.amazon.awssdk.services.managedblockchainquery.model.GetTransactionRequest
): zio.aws.managedblockchainquery.model.GetTransactionRequest.ReadOnly =
new Wrapper(impl)
}