All Downloads are FREE. Search and download functionalities are using the official Maven repository.

zio.aws.amplifybackend.model.UpdateBackendAuthPasswordPolicyConfig.scala Maven / Gradle / Ivy

There is a newer version: 7.28.29.10
Show newest version
package zio.aws.amplifybackend.model
import zio.aws.amplifybackend.model.primitives.__double
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters.*
final case class UpdateBackendAuthPasswordPolicyConfig(
    additionalConstraints: Optional[
      Iterable[zio.aws.amplifybackend.model.AdditionalConstraintsElement]
    ] = Optional.Absent,
    minimumLength: Optional[__double] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.amplifybackend.model.UpdateBackendAuthPasswordPolicyConfig = {
    import UpdateBackendAuthPasswordPolicyConfig.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.amplifybackend.model.UpdateBackendAuthPasswordPolicyConfig
      .builder()
      .optionallyWith(
        additionalConstraints.map(value =>
          value.map { item =>
            item.unwrap.toString
          }.asJavaCollection
        )
      )(_.additionalConstraintsWithStrings)
      .optionallyWith(minimumLength.map(value => value: java.lang.Double))(
        _.minimumLength
      )
      .build()
  }
  def asReadOnly
      : zio.aws.amplifybackend.model.UpdateBackendAuthPasswordPolicyConfig.ReadOnly =
    zio.aws.amplifybackend.model.UpdateBackendAuthPasswordPolicyConfig
      .wrap(buildAwsValue())
}
object UpdateBackendAuthPasswordPolicyConfig {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.amplifybackend.model.UpdateBackendAuthPasswordPolicyConfig
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable
        : zio.aws.amplifybackend.model.UpdateBackendAuthPasswordPolicyConfig =
      zio.aws.amplifybackend.model.UpdateBackendAuthPasswordPolicyConfig(
        additionalConstraints.map(value => value),
        minimumLength.map(value => value)
      )
    def additionalConstraints: Optional[
      List[zio.aws.amplifybackend.model.AdditionalConstraintsElement]
    ]
    def minimumLength: Optional[__double]
    def getAdditionalConstraints: ZIO[Any, AwsError, List[
      zio.aws.amplifybackend.model.AdditionalConstraintsElement
    ]] =
      AwsError.unwrapOptionField("additionalConstraints", additionalConstraints)
    def getMinimumLength: ZIO[Any, AwsError, __double] =
      AwsError.unwrapOptionField("minimumLength", minimumLength)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.amplifybackend.model.UpdateBackendAuthPasswordPolicyConfig
  ) extends zio.aws.amplifybackend.model.UpdateBackendAuthPasswordPolicyConfig.ReadOnly {
    override val additionalConstraints: Optional[
      List[zio.aws.amplifybackend.model.AdditionalConstraintsElement]
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.additionalConstraints())
      .map(value =>
        value.asScala.map { item =>
          zio.aws.amplifybackend.model.AdditionalConstraintsElement.wrap(item)
        }.toList
      )
    override val minimumLength: Optional[__double] = zio.aws.core.internal
      .optionalFromNullable(impl.minimumLength())
      .map(value => value: __double)
  }
  def wrap(
      impl: software.amazon.awssdk.services.amplifybackend.model.UpdateBackendAuthPasswordPolicyConfig
  ): zio.aws.amplifybackend.model.UpdateBackendAuthPasswordPolicyConfig.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy