zio.aws.workmail.model.PutMobileDeviceAccessOverrideRequest.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.{
MobileDeviceAccessRuleDescription,
DeviceId,
EntityIdentifier,
OrganizationId
}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class PutMobileDeviceAccessOverrideRequest(
organizationId: OrganizationId,
userId: EntityIdentifier,
deviceId: DeviceId,
effect: zio.aws.workmail.model.MobileDeviceAccessRuleEffect,
description: Optional[MobileDeviceAccessRuleDescription] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.workmail.model.PutMobileDeviceAccessOverrideRequest = {
import PutMobileDeviceAccessOverrideRequest.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.workmail.model.PutMobileDeviceAccessOverrideRequest
.builder()
.organizationId(OrganizationId.unwrap(organizationId): java.lang.String)
.userId(EntityIdentifier.unwrap(userId): java.lang.String)
.deviceId(DeviceId.unwrap(deviceId): java.lang.String)
.effect(effect.unwrap)
.optionallyWith(
description.map(value =>
MobileDeviceAccessRuleDescription.unwrap(value): java.lang.String
)
)(_.description)
.build()
}
def asReadOnly
: zio.aws.workmail.model.PutMobileDeviceAccessOverrideRequest.ReadOnly =
zio.aws.workmail.model.PutMobileDeviceAccessOverrideRequest
.wrap(buildAwsValue())
}
object PutMobileDeviceAccessOverrideRequest {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.workmail.model.PutMobileDeviceAccessOverrideRequest
] = BuilderHelper.apply
trait ReadOnly {
def asEditable
: zio.aws.workmail.model.PutMobileDeviceAccessOverrideRequest =
zio.aws.workmail.model.PutMobileDeviceAccessOverrideRequest(
organizationId,
userId,
deviceId,
effect,
description.map(value => value)
)
def organizationId: OrganizationId
def userId: EntityIdentifier
def deviceId: DeviceId
def effect: zio.aws.workmail.model.MobileDeviceAccessRuleEffect
def description: Optional[MobileDeviceAccessRuleDescription]
def getOrganizationId: ZIO[Any, Nothing, OrganizationId] =
ZIO.succeed(organizationId)
def getUserId: ZIO[Any, Nothing, EntityIdentifier] = ZIO.succeed(userId)
def getDeviceId: ZIO[Any, Nothing, DeviceId] = ZIO.succeed(deviceId)
def getEffect: ZIO[
Any,
Nothing,
zio.aws.workmail.model.MobileDeviceAccessRuleEffect
] = ZIO.succeed(effect)
def getDescription: ZIO[Any, AwsError, MobileDeviceAccessRuleDescription] =
AwsError.unwrapOptionField("description", description)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.workmail.model.PutMobileDeviceAccessOverrideRequest
) extends zio.aws.workmail.model.PutMobileDeviceAccessOverrideRequest.ReadOnly {
override val organizationId: OrganizationId =
zio.aws.workmail.model.primitives.OrganizationId(impl.organizationId())
override val userId: EntityIdentifier =
zio.aws.workmail.model.primitives.EntityIdentifier(impl.userId())
override val deviceId: DeviceId =
zio.aws.workmail.model.primitives.DeviceId(impl.deviceId())
override val effect: zio.aws.workmail.model.MobileDeviceAccessRuleEffect =
zio.aws.workmail.model.MobileDeviceAccessRuleEffect.wrap(impl.effect())
override val description: Optional[MobileDeviceAccessRuleDescription] =
zio.aws.core.internal
.optionalFromNullable(impl.description())
.map(value =>
zio.aws.workmail.model.primitives
.MobileDeviceAccessRuleDescription(value)
)
}
def wrap(
impl: software.amazon.awssdk.services.workmail.model.PutMobileDeviceAccessOverrideRequest
): zio.aws.workmail.model.PutMobileDeviceAccessOverrideRequest.ReadOnly =
new Wrapper(impl)
}