zio.aws.verifiedpermissions.model.UpdateConfiguration.scala Maven / Gradle / Ivy
package zio.aws.verifiedpermissions.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class UpdateConfiguration(
cognitoUserPoolConfiguration: Optional[
zio.aws.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration
] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.verifiedpermissions.model.UpdateConfiguration = {
import UpdateConfiguration.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.verifiedpermissions.model.UpdateConfiguration
.builder()
.optionallyWith(
cognitoUserPoolConfiguration.map(value => value.buildAwsValue())
)(_.cognitoUserPoolConfiguration)
.build()
}
def asReadOnly
: zio.aws.verifiedpermissions.model.UpdateConfiguration.ReadOnly =
zio.aws.verifiedpermissions.model.UpdateConfiguration.wrap(buildAwsValue())
}
object UpdateConfiguration {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.verifiedpermissions.model.UpdateConfiguration
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.verifiedpermissions.model.UpdateConfiguration =
zio.aws.verifiedpermissions.model.UpdateConfiguration(
cognitoUserPoolConfiguration.map(value => value.asEditable)
)
def cognitoUserPoolConfiguration: Optional[
zio.aws.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration.ReadOnly
]
def getCognitoUserPoolConfiguration: ZIO[
Any,
AwsError,
zio.aws.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration.ReadOnly
] = AwsError.unwrapOptionField(
"cognitoUserPoolConfiguration",
cognitoUserPoolConfiguration
)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.verifiedpermissions.model.UpdateConfiguration
) extends zio.aws.verifiedpermissions.model.UpdateConfiguration.ReadOnly {
override val cognitoUserPoolConfiguration: Optional[
zio.aws.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration.ReadOnly
] = zio.aws.core.internal
.optionalFromNullable(impl.cognitoUserPoolConfiguration())
.map(value =>
zio.aws.verifiedpermissions.model.UpdateCognitoUserPoolConfiguration
.wrap(value)
)
}
def wrap(
impl: software.amazon.awssdk.services.verifiedpermissions.model.UpdateConfiguration
): zio.aws.verifiedpermissions.model.UpdateConfiguration.ReadOnly =
new Wrapper(impl)
}