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

zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest.scala Maven / Gradle / Ivy

There is a newer version: 7.28.29.5
Show newest version
package zio.aws.verifiedpermissions.model
import zio.aws.verifiedpermissions.model.primitives.{
  PrincipalEntityType,
  IdentitySourceId,
  PolicyStoreId
}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class UpdateIdentitySourceRequest(
    policyStoreId: PolicyStoreId,
    identitySourceId: IdentitySourceId,
    updateConfiguration: zio.aws.verifiedpermissions.model.UpdateConfiguration,
    principalEntityType: Optional[PrincipalEntityType] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.verifiedpermissions.model.UpdateIdentitySourceRequest = {
    import UpdateIdentitySourceRequest.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.verifiedpermissions.model.UpdateIdentitySourceRequest
      .builder()
      .policyStoreId(PolicyStoreId.unwrap(policyStoreId): java.lang.String)
      .identitySourceId(
        IdentitySourceId.unwrap(identitySourceId): java.lang.String
      )
      .updateConfiguration(updateConfiguration.buildAwsValue())
      .optionallyWith(
        principalEntityType.map(value =>
          PrincipalEntityType.unwrap(value): java.lang.String
        )
      )(_.principalEntityType)
      .build()
  }
  def asReadOnly
      : zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest.ReadOnly =
    zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest
      .wrap(buildAwsValue())
}
object UpdateIdentitySourceRequest {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.verifiedpermissions.model.UpdateIdentitySourceRequest
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable
        : zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest =
      zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest(
        policyStoreId,
        identitySourceId,
        updateConfiguration.asEditable,
        principalEntityType.map(value => value)
      )
    def policyStoreId: PolicyStoreId
    def identitySourceId: IdentitySourceId
    def updateConfiguration
        : zio.aws.verifiedpermissions.model.UpdateConfiguration.ReadOnly
    def principalEntityType: Optional[PrincipalEntityType]
    def getPolicyStoreId: ZIO[Any, Nothing, PolicyStoreId] =
      ZIO.succeed(policyStoreId)
    def getIdentitySourceId: ZIO[Any, Nothing, IdentitySourceId] =
      ZIO.succeed(identitySourceId)
    def getUpdateConfiguration: ZIO[
      Any,
      Nothing,
      zio.aws.verifiedpermissions.model.UpdateConfiguration.ReadOnly
    ] = ZIO.succeed(updateConfiguration)
    def getPrincipalEntityType: ZIO[Any, AwsError, PrincipalEntityType] =
      AwsError.unwrapOptionField("principalEntityType", principalEntityType)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.verifiedpermissions.model.UpdateIdentitySourceRequest
  ) extends zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest.ReadOnly {
    override val policyStoreId: PolicyStoreId =
      zio.aws.verifiedpermissions.model.primitives
        .PolicyStoreId(impl.policyStoreId())
    override val identitySourceId: IdentitySourceId =
      zio.aws.verifiedpermissions.model.primitives
        .IdentitySourceId(impl.identitySourceId())
    override val updateConfiguration
        : zio.aws.verifiedpermissions.model.UpdateConfiguration.ReadOnly =
      zio.aws.verifiedpermissions.model.UpdateConfiguration
        .wrap(impl.updateConfiguration())
    override val principalEntityType: Optional[PrincipalEntityType] =
      zio.aws.core.internal
        .optionalFromNullable(impl.principalEntityType())
        .map(value =>
          zio.aws.verifiedpermissions.model.primitives
            .PrincipalEntityType(value)
        )
  }
  def wrap(
      impl: software.amazon.awssdk.services.verifiedpermissions.model.UpdateIdentitySourceRequest
  ): zio.aws.verifiedpermissions.model.UpdateIdentitySourceRequest.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy