zio.aws.workmail.model.DescribeEntityResponse.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.WorkMailIdentifier
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class DescribeEntityResponse(
entityId: Optional[WorkMailIdentifier] = Optional.Absent,
name: Optional[String] = Optional.Absent,
`type`: Optional[zio.aws.workmail.model.EntityType] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.workmail.model.DescribeEntityResponse = {
import DescribeEntityResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.workmail.model.DescribeEntityResponse
.builder()
.optionallyWith(
entityId.map(value =>
WorkMailIdentifier.unwrap(value): java.lang.String
)
)(_.entityId)
.optionallyWith(name.map(value => value: java.lang.String))(_.name)
.optionallyWith(`type`.map(value => value.unwrap))(_.`type`)
.build()
}
def asReadOnly: zio.aws.workmail.model.DescribeEntityResponse.ReadOnly =
zio.aws.workmail.model.DescribeEntityResponse.wrap(buildAwsValue())
}
object DescribeEntityResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.workmail.model.DescribeEntityResponse
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.workmail.model.DescribeEntityResponse =
zio.aws.workmail.model.DescribeEntityResponse(
entityId.map(value => value),
name.map(value => value),
`type`.map(value => value)
)
def entityId: Optional[WorkMailIdentifier]
def name: Optional[String]
def `type`: Optional[zio.aws.workmail.model.EntityType]
def getEntityId: ZIO[Any, AwsError, WorkMailIdentifier] =
AwsError.unwrapOptionField("entityId", entityId)
def getName: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("name", name)
def getType: ZIO[Any, AwsError, zio.aws.workmail.model.EntityType] =
AwsError.unwrapOptionField("type", `type`)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.workmail.model.DescribeEntityResponse
) extends zio.aws.workmail.model.DescribeEntityResponse.ReadOnly {
override val entityId: Optional[WorkMailIdentifier] = zio.aws.core.internal
.optionalFromNullable(impl.entityId())
.map(value => zio.aws.workmail.model.primitives.WorkMailIdentifier(value))
override val name: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.name())
.map(value => value: String)
override val `type`: Optional[zio.aws.workmail.model.EntityType] =
zio.aws.core.internal
.optionalFromNullable(impl.`type`())
.map(value => zio.aws.workmail.model.EntityType.wrap(value))
}
def wrap(
impl: software.amazon.awssdk.services.workmail.model.DescribeEntityResponse
): zio.aws.workmail.model.DescribeEntityResponse.ReadOnly = new Wrapper(impl)
}