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

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

There is a newer version: 7.28.29.5
Show newest version
package zio.aws.workmail.model
import zio.aws.workmail.model.primitives.ShortString
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class GetDefaultRetentionPolicyResponse(
    id: Optional[ShortString] = Optional.Absent,
    name: Optional[ShortString] = Optional.Absent,
    description: Optional[String] = Optional.Absent,
    folderConfigurations: Optional[
      Iterable[zio.aws.workmail.model.FolderConfiguration]
    ] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.workmail.model.GetDefaultRetentionPolicyResponse = {
    import GetDefaultRetentionPolicyResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.workmail.model.GetDefaultRetentionPolicyResponse
      .builder()
      .optionallyWith(
        id.map(value => ShortString.unwrap(value): java.lang.String)
      )(_.id)
      .optionallyWith(
        name.map(value => ShortString.unwrap(value): java.lang.String)
      )(_.name)
      .optionallyWith(description.map(value => value: java.lang.String))(
        _.description
      )
      .optionallyWith(
        folderConfigurations.map(value =>
          value.map { item =>
            item.buildAwsValue()
          }.asJavaCollection
        )
      )(_.folderConfigurations)
      .build()
  }
  def asReadOnly
      : zio.aws.workmail.model.GetDefaultRetentionPolicyResponse.ReadOnly =
    zio.aws.workmail.model.GetDefaultRetentionPolicyResponse
      .wrap(buildAwsValue())
}
object GetDefaultRetentionPolicyResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.workmail.model.GetDefaultRetentionPolicyResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.workmail.model.GetDefaultRetentionPolicyResponse =
      zio.aws.workmail.model.GetDefaultRetentionPolicyResponse(
        id.map(value => value),
        name.map(value => value),
        description.map(value => value),
        folderConfigurations.map(value =>
          value.map { item =>
            item.asEditable
          }
        )
      )
    def id: Optional[ShortString]
    def name: Optional[ShortString]
    def description: Optional[String]
    def folderConfigurations
        : Optional[List[zio.aws.workmail.model.FolderConfiguration.ReadOnly]]
    def getId: ZIO[Any, AwsError, ShortString] =
      AwsError.unwrapOptionField("id", id)
    def getName: ZIO[Any, AwsError, ShortString] =
      AwsError.unwrapOptionField("name", name)
    def getDescription: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("description", description)
    def getFolderConfigurations: ZIO[Any, AwsError, List[
      zio.aws.workmail.model.FolderConfiguration.ReadOnly
    ]] =
      AwsError.unwrapOptionField("folderConfigurations", folderConfigurations)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.workmail.model.GetDefaultRetentionPolicyResponse
  ) extends zio.aws.workmail.model.GetDefaultRetentionPolicyResponse.ReadOnly {
    override val id: Optional[ShortString] = zio.aws.core.internal
      .optionalFromNullable(impl.id())
      .map(value => zio.aws.workmail.model.primitives.ShortString(value))
    override val name: Optional[ShortString] = zio.aws.core.internal
      .optionalFromNullable(impl.name())
      .map(value => zio.aws.workmail.model.primitives.ShortString(value))
    override val description: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.description())
      .map(value => value: String)
    override val folderConfigurations
        : Optional[List[zio.aws.workmail.model.FolderConfiguration.ReadOnly]] =
      zio.aws.core.internal
        .optionalFromNullable(impl.folderConfigurations())
        .map(value =>
          value.asScala.map { item =>
            zio.aws.workmail.model.FolderConfiguration.wrap(item)
          }.toList
        )
  }
  def wrap(
      impl: software.amazon.awssdk.services.workmail.model.GetDefaultRetentionPolicyResponse
  ): zio.aws.workmail.model.GetDefaultRetentionPolicyResponse.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy