zio.aws.workmail.model.GetAccessControlEffectRequest.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-workmail_2.12 Show documentation
Show all versions of zio-aws-workmail_2.12 Show documentation
Low-level AWS wrapper for ZIO
package zio.aws.workmail.model
import zio.aws.workmail.model.primitives.{
AccessControlRuleAction,
OrganizationId,
WorkMailIdentifier,
IpAddress,
ImpersonationRoleId
}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class GetAccessControlEffectRequest(
organizationId: OrganizationId,
ipAddress: IpAddress,
action: AccessControlRuleAction,
userId: Optional[WorkMailIdentifier] = Optional.Absent,
impersonationRoleId: Optional[ImpersonationRoleId] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.workmail.model.GetAccessControlEffectRequest = {
import GetAccessControlEffectRequest.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.workmail.model.GetAccessControlEffectRequest
.builder()
.organizationId(OrganizationId.unwrap(organizationId): java.lang.String)
.ipAddress(IpAddress.unwrap(ipAddress): java.lang.String)
.action(AccessControlRuleAction.unwrap(action): java.lang.String)
.optionallyWith(
userId.map(value => WorkMailIdentifier.unwrap(value): java.lang.String)
)(_.userId)
.optionallyWith(
impersonationRoleId.map(value =>
ImpersonationRoleId.unwrap(value): java.lang.String
)
)(_.impersonationRoleId)
.build()
}
def asReadOnly
: zio.aws.workmail.model.GetAccessControlEffectRequest.ReadOnly =
zio.aws.workmail.model.GetAccessControlEffectRequest.wrap(buildAwsValue())
}
object GetAccessControlEffectRequest {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.workmail.model.GetAccessControlEffectRequest
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.workmail.model.GetAccessControlEffectRequest =
zio.aws.workmail.model.GetAccessControlEffectRequest(
organizationId,
ipAddress,
action,
userId.map(value => value),
impersonationRoleId.map(value => value)
)
def organizationId: OrganizationId
def ipAddress: IpAddress
def action: AccessControlRuleAction
def userId: Optional[WorkMailIdentifier]
def impersonationRoleId: Optional[ImpersonationRoleId]
def getOrganizationId: ZIO[Any, Nothing, OrganizationId] =
ZIO.succeed(organizationId)
def getIpAddress: ZIO[Any, Nothing, IpAddress] = ZIO.succeed(ipAddress)
def getAction: ZIO[Any, Nothing, AccessControlRuleAction] =
ZIO.succeed(action)
def getUserId: ZIO[Any, AwsError, WorkMailIdentifier] =
AwsError.unwrapOptionField("userId", userId)
def getImpersonationRoleId: ZIO[Any, AwsError, ImpersonationRoleId] =
AwsError.unwrapOptionField("impersonationRoleId", impersonationRoleId)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.workmail.model.GetAccessControlEffectRequest
) extends zio.aws.workmail.model.GetAccessControlEffectRequest.ReadOnly {
override val organizationId: OrganizationId =
zio.aws.workmail.model.primitives.OrganizationId(impl.organizationId())
override val ipAddress: IpAddress =
zio.aws.workmail.model.primitives.IpAddress(impl.ipAddress())
override val action: AccessControlRuleAction =
zio.aws.workmail.model.primitives.AccessControlRuleAction(impl.action())
override val userId: Optional[WorkMailIdentifier] = zio.aws.core.internal
.optionalFromNullable(impl.userId())
.map(value => zio.aws.workmail.model.primitives.WorkMailIdentifier(value))
override val impersonationRoleId: Optional[ImpersonationRoleId] =
zio.aws.core.internal
.optionalFromNullable(impl.impersonationRoleId())
.map(value =>
zio.aws.workmail.model.primitives.ImpersonationRoleId(value)
)
}
def wrap(
impl: software.amazon.awssdk.services.workmail.model.GetAccessControlEffectRequest
): zio.aws.workmail.model.GetAccessControlEffectRequest.ReadOnly =
new Wrapper(impl)
}