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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy