zio.aws.verifiedpermissions.model.IsAuthorizedResponse.scala Maven / Gradle / Ivy
package zio.aws.verifiedpermissions.model
import zio.ZIO
import zio.aws.core.BuilderHelper
import scala.jdk.CollectionConverters._
final case class IsAuthorizedResponse(
decision: zio.aws.verifiedpermissions.model.Decision,
determiningPolicies: Iterable[
zio.aws.verifiedpermissions.model.DeterminingPolicyItem
],
errors: Iterable[zio.aws.verifiedpermissions.model.EvaluationErrorItem]
) {
def buildAwsValue()
: software.amazon.awssdk.services.verifiedpermissions.model.IsAuthorizedResponse = {
import IsAuthorizedResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.verifiedpermissions.model.IsAuthorizedResponse
.builder()
.decision(decision.unwrap)
.determiningPolicies(determiningPolicies.map { item =>
item.buildAwsValue()
}.asJavaCollection)
.errors(errors.map { item =>
item.buildAwsValue()
}.asJavaCollection)
.build()
}
def asReadOnly
: zio.aws.verifiedpermissions.model.IsAuthorizedResponse.ReadOnly =
zio.aws.verifiedpermissions.model.IsAuthorizedResponse.wrap(buildAwsValue())
}
object IsAuthorizedResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.verifiedpermissions.model.IsAuthorizedResponse
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.verifiedpermissions.model.IsAuthorizedResponse =
zio.aws.verifiedpermissions.model.IsAuthorizedResponse(
decision,
determiningPolicies.map { item =>
item.asEditable
},
errors.map { item =>
item.asEditable
}
)
def decision: zio.aws.verifiedpermissions.model.Decision
def determiningPolicies
: List[zio.aws.verifiedpermissions.model.DeterminingPolicyItem.ReadOnly]
def errors
: List[zio.aws.verifiedpermissions.model.EvaluationErrorItem.ReadOnly]
def getDecision
: ZIO[Any, Nothing, zio.aws.verifiedpermissions.model.Decision] =
ZIO.succeed(decision)
def getDeterminingPolicies: ZIO[Any, Nothing, List[
zio.aws.verifiedpermissions.model.DeterminingPolicyItem.ReadOnly
]] = ZIO.succeed(determiningPolicies)
def getErrors: ZIO[Any, Nothing, List[
zio.aws.verifiedpermissions.model.EvaluationErrorItem.ReadOnly
]] = ZIO.succeed(errors)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.verifiedpermissions.model.IsAuthorizedResponse
) extends zio.aws.verifiedpermissions.model.IsAuthorizedResponse.ReadOnly {
override val decision: zio.aws.verifiedpermissions.model.Decision =
zio.aws.verifiedpermissions.model.Decision.wrap(impl.decision())
override val determiningPolicies: List[
zio.aws.verifiedpermissions.model.DeterminingPolicyItem.ReadOnly
] = impl
.determiningPolicies()
.asScala
.map { item =>
zio.aws.verifiedpermissions.model.DeterminingPolicyItem.wrap(item)
}
.toList
override val errors
: List[zio.aws.verifiedpermissions.model.EvaluationErrorItem.ReadOnly] =
impl
.errors()
.asScala
.map { item =>
zio.aws.verifiedpermissions.model.EvaluationErrorItem.wrap(item)
}
.toList
}
def wrap(
impl: software.amazon.awssdk.services.verifiedpermissions.model.IsAuthorizedResponse
): zio.aws.verifiedpermissions.model.IsAuthorizedResponse.ReadOnly =
new Wrapper(impl)
}