zio.aws.workmail.model.GetDefaultRetentionPolicyResponse.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.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)
}