zio.aws.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration.scala Maven / Gradle / Ivy
package zio.aws.verifiedpermissions.model
import zio.aws.verifiedpermissions.model.primitives.{ClientId, UserPoolArn}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class UpdateCognitoUserPoolConfiguration(
userPoolArn: UserPoolArn,
clientIds: Optional[Iterable[ClientId]] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration = {
import UpdateCognitoUserPoolConfiguration.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration
.builder()
.userPoolArn(UserPoolArn.unwrap(userPoolArn): java.lang.String)
.optionallyWith(
clientIds.map(value =>
value.map { item =>
ClientId.unwrap(item): java.lang.String
}.asJavaCollection
)
)(_.clientIds)
.build()
}
def asReadOnly
: zio.aws.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration.ReadOnly =
zio.aws.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration
.wrap(buildAwsValue())
}
object UpdateCognitoUserPoolConfiguration {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration =
zio.aws.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration(
userPoolArn,
clientIds.map(value => value)
)
def userPoolArn: UserPoolArn
def clientIds: Optional[List[ClientId]]
def getUserPoolArn: ZIO[Any, Nothing, UserPoolArn] =
ZIO.succeed(userPoolArn)
def getClientIds: ZIO[Any, AwsError, List[ClientId]] =
AwsError.unwrapOptionField("clientIds", clientIds)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration
) extends zio.aws.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration.ReadOnly {
override val userPoolArn: UserPoolArn =
zio.aws.verifiedpermissions.model.primitives
.UserPoolArn(impl.userPoolArn())
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
)
}
def wrap(
impl: software.amazon.awssdk.services.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration
): zio.aws.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration.ReadOnly =
new Wrapper(impl)
}