zio.aws.workmail.model.GetMobileDeviceAccessEffectResponse.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.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class GetMobileDeviceAccessEffectResponse(
effect: Optional[zio.aws.workmail.model.MobileDeviceAccessRuleEffect] =
Optional.Absent,
matchedRules: Optional[
Iterable[zio.aws.workmail.model.MobileDeviceAccessMatchedRule]
] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.workmail.model.GetMobileDeviceAccessEffectResponse = {
import GetMobileDeviceAccessEffectResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.workmail.model.GetMobileDeviceAccessEffectResponse
.builder()
.optionallyWith(effect.map(value => value.unwrap))(_.effect)
.optionallyWith(
matchedRules.map(value =>
value.map { item =>
item.buildAwsValue()
}.asJavaCollection
)
)(_.matchedRules)
.build()
}
def asReadOnly
: zio.aws.workmail.model.GetMobileDeviceAccessEffectResponse.ReadOnly =
zio.aws.workmail.model.GetMobileDeviceAccessEffectResponse
.wrap(buildAwsValue())
}
object GetMobileDeviceAccessEffectResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.workmail.model.GetMobileDeviceAccessEffectResponse
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.workmail.model.GetMobileDeviceAccessEffectResponse =
zio.aws.workmail.model.GetMobileDeviceAccessEffectResponse(
effect.map(value => value),
matchedRules.map(value =>
value.map { item =>
item.asEditable
}
)
)
def effect: Optional[zio.aws.workmail.model.MobileDeviceAccessRuleEffect]
def matchedRules: Optional[
List[zio.aws.workmail.model.MobileDeviceAccessMatchedRule.ReadOnly]
]
def getEffect: ZIO[
Any,
AwsError,
zio.aws.workmail.model.MobileDeviceAccessRuleEffect
] = AwsError.unwrapOptionField("effect", effect)
def getMatchedRules: ZIO[Any, AwsError, List[
zio.aws.workmail.model.MobileDeviceAccessMatchedRule.ReadOnly
]] = AwsError.unwrapOptionField("matchedRules", matchedRules)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.workmail.model.GetMobileDeviceAccessEffectResponse
) extends zio.aws.workmail.model.GetMobileDeviceAccessEffectResponse.ReadOnly {
override val effect
: Optional[zio.aws.workmail.model.MobileDeviceAccessRuleEffect] =
zio.aws.core.internal
.optionalFromNullable(impl.effect())
.map(value =>
zio.aws.workmail.model.MobileDeviceAccessRuleEffect.wrap(value)
)
override val matchedRules: Optional[
List[zio.aws.workmail.model.MobileDeviceAccessMatchedRule.ReadOnly]
] = zio.aws.core.internal
.optionalFromNullable(impl.matchedRules())
.map(value =>
value.asScala.map { item =>
zio.aws.workmail.model.MobileDeviceAccessMatchedRule.wrap(item)
}.toList
)
}
def wrap(
impl: software.amazon.awssdk.services.workmail.model.GetMobileDeviceAccessEffectResponse
): zio.aws.workmail.model.GetMobileDeviceAccessEffectResponse.ReadOnly =
new Wrapper(impl)
}