zio.aws.verifiedpermissions.model.IsAuthorizedWithTokenResponse.scala Maven / Gradle / Ivy
package zio.aws.verifiedpermissions.model
import zio.ZIO
import zio.aws.core.BuilderHelper
import scala.jdk.CollectionConverters._
final case class IsAuthorizedWithTokenResponse(
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.IsAuthorizedWithTokenResponse = {
import IsAuthorizedWithTokenResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.verifiedpermissions.model.IsAuthorizedWithTokenResponse
.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.IsAuthorizedWithTokenResponse.ReadOnly =
zio.aws.verifiedpermissions.model.IsAuthorizedWithTokenResponse
.wrap(buildAwsValue())
}
object IsAuthorizedWithTokenResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.verifiedpermissions.model.IsAuthorizedWithTokenResponse
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.verifiedpermissions.model.IsAuthorizedWithTokenResponse =
zio.aws.verifiedpermissions.model.IsAuthorizedWithTokenResponse(
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.IsAuthorizedWithTokenResponse
) extends zio.aws.verifiedpermissions.model.IsAuthorizedWithTokenResponse.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.IsAuthorizedWithTokenResponse
): zio.aws.verifiedpermissions.model.IsAuthorizedWithTokenResponse.ReadOnly =
new Wrapper(impl)
}