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

zio.aws.workmail.model.PutMailboxPermissionsRequest.scala Maven / Gradle / Ivy

There is a newer version: 7.28.29.5
Show newest version
package zio.aws.workmail.model
import zio.aws.workmail.model.primitives.{EntityIdentifier, OrganizationId}
import zio.ZIO
import zio.aws.core.BuilderHelper
import scala.jdk.CollectionConverters._
final case class PutMailboxPermissionsRequest(
    organizationId: OrganizationId,
    entityId: EntityIdentifier,
    granteeId: EntityIdentifier,
    permissionValues: Iterable[zio.aws.workmail.model.PermissionType]
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.workmail.model.PutMailboxPermissionsRequest = {
    import PutMailboxPermissionsRequest.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.workmail.model.PutMailboxPermissionsRequest
      .builder()
      .organizationId(OrganizationId.unwrap(organizationId): java.lang.String)
      .entityId(EntityIdentifier.unwrap(entityId): java.lang.String)
      .granteeId(EntityIdentifier.unwrap(granteeId): java.lang.String)
      .permissionValuesWithStrings(permissionValues.map { item =>
        item.unwrap.toString
      }.asJavaCollection)
      .build()
  }
  def asReadOnly: zio.aws.workmail.model.PutMailboxPermissionsRequest.ReadOnly =
    zio.aws.workmail.model.PutMailboxPermissionsRequest.wrap(buildAwsValue())
}
object PutMailboxPermissionsRequest {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.workmail.model.PutMailboxPermissionsRequest
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.workmail.model.PutMailboxPermissionsRequest =
      zio.aws.workmail.model.PutMailboxPermissionsRequest(
        organizationId,
        entityId,
        granteeId,
        permissionValues
      )
    def organizationId: OrganizationId
    def entityId: EntityIdentifier
    def granteeId: EntityIdentifier
    def permissionValues: List[zio.aws.workmail.model.PermissionType]
    def getOrganizationId: ZIO[Any, Nothing, OrganizationId] =
      ZIO.succeed(organizationId)
    def getEntityId: ZIO[Any, Nothing, EntityIdentifier] = ZIO.succeed(entityId)
    def getGranteeId: ZIO[Any, Nothing, EntityIdentifier] =
      ZIO.succeed(granteeId)
    def getPermissionValues
        : ZIO[Any, Nothing, List[zio.aws.workmail.model.PermissionType]] =
      ZIO.succeed(permissionValues)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.workmail.model.PutMailboxPermissionsRequest
  ) extends zio.aws.workmail.model.PutMailboxPermissionsRequest.ReadOnly {
    override val organizationId: OrganizationId =
      zio.aws.workmail.model.primitives.OrganizationId(impl.organizationId())
    override val entityId: EntityIdentifier =
      zio.aws.workmail.model.primitives.EntityIdentifier(impl.entityId())
    override val granteeId: EntityIdentifier =
      zio.aws.workmail.model.primitives.EntityIdentifier(impl.granteeId())
    override val permissionValues: List[zio.aws.workmail.model.PermissionType] =
      impl
        .permissionValues()
        .asScala
        .map { item =>
          zio.aws.workmail.model.PermissionType.wrap(item)
        }
        .toList
  }
  def wrap(
      impl: software.amazon.awssdk.services.workmail.model.PutMailboxPermissionsRequest
  ): zio.aws.workmail.model.PutMailboxPermissionsRequest.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy