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