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

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

There is a newer version: 7.28.29.5
Show newest version
package zio.aws.workmail.model
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import zio.aws.workmail.model.primitives.RetentionPeriod
import java.lang.Integer
import scala.jdk.CollectionConverters._
final case class FolderConfiguration(
    name: zio.aws.workmail.model.FolderName,
    action: zio.aws.workmail.model.RetentionAction,
    period: Optional[RetentionPeriod] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.workmail.model.FolderConfiguration = {
    import FolderConfiguration.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.workmail.model.FolderConfiguration
      .builder()
      .name(name.unwrap)
      .action(action.unwrap)
      .optionallyWith(
        period.map(value => RetentionPeriod.unwrap(value): Integer)
      )(_.period)
      .build()
  }
  def asReadOnly: zio.aws.workmail.model.FolderConfiguration.ReadOnly =
    zio.aws.workmail.model.FolderConfiguration.wrap(buildAwsValue())
}
object FolderConfiguration {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.workmail.model.FolderConfiguration
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.workmail.model.FolderConfiguration =
      zio.aws.workmail.model
        .FolderConfiguration(name, action, period.map(value => value))
    def name: zio.aws.workmail.model.FolderName
    def action: zio.aws.workmail.model.RetentionAction
    def period: Optional[RetentionPeriod]
    def getName: ZIO[Any, Nothing, zio.aws.workmail.model.FolderName] =
      ZIO.succeed(name)
    def getAction: ZIO[Any, Nothing, zio.aws.workmail.model.RetentionAction] =
      ZIO.succeed(action)
    def getPeriod: ZIO[Any, AwsError, RetentionPeriod] =
      AwsError.unwrapOptionField("period", period)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.workmail.model.FolderConfiguration
  ) extends zio.aws.workmail.model.FolderConfiguration.ReadOnly {
    override val name: zio.aws.workmail.model.FolderName =
      zio.aws.workmail.model.FolderName.wrap(impl.name())
    override val action: zio.aws.workmail.model.RetentionAction =
      zio.aws.workmail.model.RetentionAction.wrap(impl.action())
    override val period: Optional[RetentionPeriod] = zio.aws.core.internal
      .optionalFromNullable(impl.period())
      .map(value => zio.aws.workmail.model.primitives.RetentionPeriod(value))
  }
  def wrap(
      impl: software.amazon.awssdk.services.workmail.model.FolderConfiguration
  ): zio.aws.workmail.model.FolderConfiguration.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy