zio.aws.verifiedpermissions.model.IdentitySourceItemDetails.scala Maven / Gradle / Ivy
package zio.aws.verifiedpermissions.model
import zio.aws.verifiedpermissions.model.primitives.{
DiscoveryUrl,
UserPoolArn,
ClientId
}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class IdentitySourceItemDetails(
clientIds: Optional[Iterable[ClientId]] = Optional.Absent,
userPoolArn: Optional[UserPoolArn] = Optional.Absent,
discoveryUrl: Optional[DiscoveryUrl] = Optional.Absent,
openIdIssuer: Optional[zio.aws.verifiedpermissions.model.OpenIdIssuer] =
Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.verifiedpermissions.model.IdentitySourceItemDetails = {
import IdentitySourceItemDetails.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.verifiedpermissions.model.IdentitySourceItemDetails
.builder()
.optionallyWith(
clientIds.map(value =>
value.map { item =>
ClientId.unwrap(item): java.lang.String
}.asJavaCollection
)
)(_.clientIds)
.optionallyWith(
userPoolArn.map(value => UserPoolArn.unwrap(value): java.lang.String)
)(_.userPoolArn)
.optionallyWith(
discoveryUrl.map(value => DiscoveryUrl.unwrap(value): java.lang.String)
)(_.discoveryUrl)
.optionallyWith(openIdIssuer.map(value => value.unwrap))(_.openIdIssuer)
.build()
}
def asReadOnly
: zio.aws.verifiedpermissions.model.IdentitySourceItemDetails.ReadOnly =
zio.aws.verifiedpermissions.model.IdentitySourceItemDetails
.wrap(buildAwsValue())
}
object IdentitySourceItemDetails {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.verifiedpermissions.model.IdentitySourceItemDetails
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.verifiedpermissions.model.IdentitySourceItemDetails =
zio.aws.verifiedpermissions.model.IdentitySourceItemDetails(
clientIds.map(value => value),
userPoolArn.map(value => value),
discoveryUrl.map(value => value),
openIdIssuer.map(value => value)
)
def clientIds: Optional[List[ClientId]]
def userPoolArn: Optional[UserPoolArn]
def discoveryUrl: Optional[DiscoveryUrl]
def openIdIssuer: Optional[zio.aws.verifiedpermissions.model.OpenIdIssuer]
def getClientIds: ZIO[Any, AwsError, List[ClientId]] =
AwsError.unwrapOptionField("clientIds", clientIds)
def getUserPoolArn: ZIO[Any, AwsError, UserPoolArn] =
AwsError.unwrapOptionField("userPoolArn", userPoolArn)
def getDiscoveryUrl: ZIO[Any, AwsError, DiscoveryUrl] =
AwsError.unwrapOptionField("discoveryUrl", discoveryUrl)
def getOpenIdIssuer
: ZIO[Any, AwsError, zio.aws.verifiedpermissions.model.OpenIdIssuer] =
AwsError.unwrapOptionField("openIdIssuer", openIdIssuer)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.verifiedpermissions.model.IdentitySourceItemDetails
) extends zio.aws.verifiedpermissions.model.IdentitySourceItemDetails.ReadOnly {
override val clientIds: Optional[List[ClientId]] = zio.aws.core.internal
.optionalFromNullable(impl.clientIds())
.map(value =>
value.asScala.map { item =>
zio.aws.verifiedpermissions.model.primitives.ClientId(item)
}.toList
)
override val userPoolArn: Optional[UserPoolArn] = zio.aws.core.internal
.optionalFromNullable(impl.userPoolArn())
.map(value =>
zio.aws.verifiedpermissions.model.primitives.UserPoolArn(value)
)
override val discoveryUrl: Optional[DiscoveryUrl] = zio.aws.core.internal
.optionalFromNullable(impl.discoveryUrl())
.map(value =>
zio.aws.verifiedpermissions.model.primitives.DiscoveryUrl(value)
)
override val openIdIssuer
: Optional[zio.aws.verifiedpermissions.model.OpenIdIssuer] =
zio.aws.core.internal
.optionalFromNullable(impl.openIdIssuer())
.map(value =>
zio.aws.verifiedpermissions.model.OpenIdIssuer.wrap(value)
)
}
def wrap(
impl: software.amazon.awssdk.services.verifiedpermissions.model.IdentitySourceItemDetails
): zio.aws.verifiedpermissions.model.IdentitySourceItemDetails.ReadOnly =
new Wrapper(impl)
}