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

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

There is a newer version: 7.28.29.5
Show newest version
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)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy