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

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

There is a newer version: 7.28.29.5
Show newest version
package zio.aws.workmail.model
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import zio.aws.workmail.model.primitives.{
  Timestamp,
  MobileDeviceAccessRuleDescription,
  DeviceId,
  WorkMailIdentifier
}
import scala.jdk.CollectionConverters._
final case class GetMobileDeviceAccessOverrideResponse(
    userId: Optional[WorkMailIdentifier] = Optional.Absent,
    deviceId: Optional[DeviceId] = Optional.Absent,
    effect: Optional[zio.aws.workmail.model.MobileDeviceAccessRuleEffect] =
      Optional.Absent,
    description: Optional[MobileDeviceAccessRuleDescription] = Optional.Absent,
    dateCreated: Optional[Timestamp] = Optional.Absent,
    dateModified: Optional[Timestamp] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.workmail.model.GetMobileDeviceAccessOverrideResponse = {
    import GetMobileDeviceAccessOverrideResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.workmail.model.GetMobileDeviceAccessOverrideResponse
      .builder()
      .optionallyWith(
        userId.map(value => WorkMailIdentifier.unwrap(value): java.lang.String)
      )(_.userId)
      .optionallyWith(
        deviceId.map(value => DeviceId.unwrap(value): java.lang.String)
      )(_.deviceId)
      .optionallyWith(effect.map(value => value.unwrap))(_.effect)
      .optionallyWith(
        description.map(value =>
          MobileDeviceAccessRuleDescription.unwrap(value): java.lang.String
        )
      )(_.description)
      .optionallyWith(
        dateCreated.map(value => Timestamp.unwrap(value): Instant)
      )(_.dateCreated)
      .optionallyWith(
        dateModified.map(value => Timestamp.unwrap(value): Instant)
      )(_.dateModified)
      .build()
  }
  def asReadOnly
      : zio.aws.workmail.model.GetMobileDeviceAccessOverrideResponse.ReadOnly =
    zio.aws.workmail.model.GetMobileDeviceAccessOverrideResponse
      .wrap(buildAwsValue())
}
object GetMobileDeviceAccessOverrideResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.workmail.model.GetMobileDeviceAccessOverrideResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable
        : zio.aws.workmail.model.GetMobileDeviceAccessOverrideResponse =
      zio.aws.workmail.model.GetMobileDeviceAccessOverrideResponse(
        userId.map(value => value),
        deviceId.map(value => value),
        effect.map(value => value),
        description.map(value => value),
        dateCreated.map(value => value),
        dateModified.map(value => value)
      )
    def userId: Optional[WorkMailIdentifier]
    def deviceId: Optional[DeviceId]
    def effect: Optional[zio.aws.workmail.model.MobileDeviceAccessRuleEffect]
    def description: Optional[MobileDeviceAccessRuleDescription]
    def dateCreated: Optional[Timestamp]
    def dateModified: Optional[Timestamp]
    def getUserId: ZIO[Any, AwsError, WorkMailIdentifier] =
      AwsError.unwrapOptionField("userId", userId)
    def getDeviceId: ZIO[Any, AwsError, DeviceId] =
      AwsError.unwrapOptionField("deviceId", deviceId)
    def getEffect: ZIO[
      Any,
      AwsError,
      zio.aws.workmail.model.MobileDeviceAccessRuleEffect
    ] = AwsError.unwrapOptionField("effect", effect)
    def getDescription: ZIO[Any, AwsError, MobileDeviceAccessRuleDescription] =
      AwsError.unwrapOptionField("description", description)
    def getDateCreated: ZIO[Any, AwsError, Timestamp] =
      AwsError.unwrapOptionField("dateCreated", dateCreated)
    def getDateModified: ZIO[Any, AwsError, Timestamp] =
      AwsError.unwrapOptionField("dateModified", dateModified)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.workmail.model.GetMobileDeviceAccessOverrideResponse
  ) extends zio.aws.workmail.model.GetMobileDeviceAccessOverrideResponse.ReadOnly {
    override val userId: Optional[WorkMailIdentifier] = zio.aws.core.internal
      .optionalFromNullable(impl.userId())
      .map(value => zio.aws.workmail.model.primitives.WorkMailIdentifier(value))
    override val deviceId: Optional[DeviceId] = zio.aws.core.internal
      .optionalFromNullable(impl.deviceId())
      .map(value => zio.aws.workmail.model.primitives.DeviceId(value))
    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 description: Optional[MobileDeviceAccessRuleDescription] =
      zio.aws.core.internal
        .optionalFromNullable(impl.description())
        .map(value =>
          zio.aws.workmail.model.primitives
            .MobileDeviceAccessRuleDescription(value)
        )
    override val dateCreated: Optional[Timestamp] = zio.aws.core.internal
      .optionalFromNullable(impl.dateCreated())
      .map(value => zio.aws.workmail.model.primitives.Timestamp(value))
    override val dateModified: Optional[Timestamp] = zio.aws.core.internal
      .optionalFromNullable(impl.dateModified())
      .map(value => zio.aws.workmail.model.primitives.Timestamp(value))
  }
  def wrap(
      impl: software.amazon.awssdk.services.workmail.model.GetMobileDeviceAccessOverrideResponse
  ): zio.aws.workmail.model.GetMobileDeviceAccessOverrideResponse.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy