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

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

There is a newer version: 7.28.29.5
Show newest version
package zio.aws.workmail.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class GetMailDomainResponse(
    records: Optional[Iterable[zio.aws.workmail.model.DnsRecord]] =
      Optional.Absent,
    isTestDomain: Optional[Boolean] = Optional.Absent,
    isDefault: Optional[Boolean] = Optional.Absent,
    ownershipVerificationStatus: Optional[
      zio.aws.workmail.model.DnsRecordVerificationStatus
    ] = Optional.Absent,
    dkimVerificationStatus: Optional[
      zio.aws.workmail.model.DnsRecordVerificationStatus
    ] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.workmail.model.GetMailDomainResponse = {
    import GetMailDomainResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.workmail.model.GetMailDomainResponse
      .builder()
      .optionallyWith(
        records.map(value =>
          value.map { item =>
            item.buildAwsValue()
          }.asJavaCollection
        )
      )(_.records)
      .optionallyWith(isTestDomain.map(value => value: java.lang.Boolean))(
        _.isTestDomain
      )
      .optionallyWith(isDefault.map(value => value: java.lang.Boolean))(
        _.isDefault
      )
      .optionallyWith(ownershipVerificationStatus.map(value => value.unwrap))(
        _.ownershipVerificationStatus
      )
      .optionallyWith(dkimVerificationStatus.map(value => value.unwrap))(
        _.dkimVerificationStatus
      )
      .build()
  }
  def asReadOnly: zio.aws.workmail.model.GetMailDomainResponse.ReadOnly =
    zio.aws.workmail.model.GetMailDomainResponse.wrap(buildAwsValue())
}
object GetMailDomainResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.workmail.model.GetMailDomainResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.workmail.model.GetMailDomainResponse =
      zio.aws.workmail.model.GetMailDomainResponse(
        records.map(value =>
          value.map { item =>
            item.asEditable
          }
        ),
        isTestDomain.map(value => value),
        isDefault.map(value => value),
        ownershipVerificationStatus.map(value => value),
        dkimVerificationStatus.map(value => value)
      )
    def records: Optional[List[zio.aws.workmail.model.DnsRecord.ReadOnly]]
    def isTestDomain: Optional[Boolean]
    def isDefault: Optional[Boolean]
    def ownershipVerificationStatus
        : Optional[zio.aws.workmail.model.DnsRecordVerificationStatus]
    def dkimVerificationStatus
        : Optional[zio.aws.workmail.model.DnsRecordVerificationStatus]
    def getRecords
        : ZIO[Any, AwsError, List[zio.aws.workmail.model.DnsRecord.ReadOnly]] =
      AwsError.unwrapOptionField("records", records)
    def getIsTestDomain: ZIO[Any, AwsError, Boolean] =
      AwsError.unwrapOptionField("isTestDomain", isTestDomain)
    def getIsDefault: ZIO[Any, AwsError, Boolean] =
      AwsError.unwrapOptionField("isDefault", isDefault)
    def getOwnershipVerificationStatus: ZIO[
      Any,
      AwsError,
      zio.aws.workmail.model.DnsRecordVerificationStatus
    ] = AwsError.unwrapOptionField(
      "ownershipVerificationStatus",
      ownershipVerificationStatus
    )
    def getDkimVerificationStatus: ZIO[
      Any,
      AwsError,
      zio.aws.workmail.model.DnsRecordVerificationStatus
    ] = AwsError.unwrapOptionField(
      "dkimVerificationStatus",
      dkimVerificationStatus
    )
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.workmail.model.GetMailDomainResponse
  ) extends zio.aws.workmail.model.GetMailDomainResponse.ReadOnly {
    override val records
        : Optional[List[zio.aws.workmail.model.DnsRecord.ReadOnly]] =
      zio.aws.core.internal
        .optionalFromNullable(impl.records())
        .map(value =>
          value.asScala.map { item =>
            zio.aws.workmail.model.DnsRecord.wrap(item)
          }.toList
        )
    override val isTestDomain: Optional[Boolean] = zio.aws.core.internal
      .optionalFromNullable(impl.isTestDomain())
      .map(value => value: Boolean)
    override val isDefault: Optional[Boolean] = zio.aws.core.internal
      .optionalFromNullable(impl.isDefault())
      .map(value => value: Boolean)
    override val ownershipVerificationStatus
        : Optional[zio.aws.workmail.model.DnsRecordVerificationStatus] =
      zio.aws.core.internal
        .optionalFromNullable(impl.ownershipVerificationStatus())
        .map(value =>
          zio.aws.workmail.model.DnsRecordVerificationStatus.wrap(value)
        )
    override val dkimVerificationStatus
        : Optional[zio.aws.workmail.model.DnsRecordVerificationStatus] =
      zio.aws.core.internal
        .optionalFromNullable(impl.dkimVerificationStatus())
        .map(value =>
          zio.aws.workmail.model.DnsRecordVerificationStatus.wrap(value)
        )
  }
  def wrap(
      impl: software.amazon.awssdk.services.workmail.model.GetMailDomainResponse
  ): zio.aws.workmail.model.GetMailDomainResponse.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy