zio.aws.verifiedpermissions.model.PolicyStoreItem.scala Maven / Gradle / Ivy
package zio.aws.verifiedpermissions.model
import zio.aws.verifiedpermissions.model.primitives.{
TimestampFormat,
ResourceArn,
PolicyStoreId
}
import zio.ZIO
import zio.aws.core.BuilderHelper
import java.time.Instant
import scala.jdk.CollectionConverters._
final case class PolicyStoreItem(
policyStoreId: PolicyStoreId,
arn: ResourceArn,
createdDate: TimestampFormat
) {
def buildAwsValue()
: software.amazon.awssdk.services.verifiedpermissions.model.PolicyStoreItem = {
import PolicyStoreItem.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.verifiedpermissions.model.PolicyStoreItem
.builder()
.policyStoreId(PolicyStoreId.unwrap(policyStoreId): java.lang.String)
.arn(ResourceArn.unwrap(arn): java.lang.String)
.createdDate(TimestampFormat.unwrap(createdDate): Instant)
.build()
}
def asReadOnly: zio.aws.verifiedpermissions.model.PolicyStoreItem.ReadOnly =
zio.aws.verifiedpermissions.model.PolicyStoreItem.wrap(buildAwsValue())
}
object PolicyStoreItem {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.verifiedpermissions.model.PolicyStoreItem
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.verifiedpermissions.model.PolicyStoreItem =
zio.aws.verifiedpermissions.model
.PolicyStoreItem(policyStoreId, arn, createdDate)
def policyStoreId: PolicyStoreId
def arn: ResourceArn
def createdDate: TimestampFormat
def getPolicyStoreId: ZIO[Any, Nothing, PolicyStoreId] =
ZIO.succeed(policyStoreId)
def getArn: ZIO[Any, Nothing, ResourceArn] = ZIO.succeed(arn)
def getCreatedDate: ZIO[Any, Nothing, TimestampFormat] =
ZIO.succeed(createdDate)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.verifiedpermissions.model.PolicyStoreItem
) extends zio.aws.verifiedpermissions.model.PolicyStoreItem.ReadOnly {
override val policyStoreId: PolicyStoreId =
zio.aws.verifiedpermissions.model.primitives
.PolicyStoreId(impl.policyStoreId())
override val arn: ResourceArn =
zio.aws.verifiedpermissions.model.primitives.ResourceArn(impl.arn())
override val createdDate: TimestampFormat =
zio.aws.verifiedpermissions.model.primitives
.TimestampFormat(impl.createdDate())
}
def wrap(
impl: software.amazon.awssdk.services.verifiedpermissions.model.PolicyStoreItem
): zio.aws.verifiedpermissions.model.PolicyStoreItem.ReadOnly = new Wrapper(
impl
)
}