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

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

There is a newer version: 7.28.29.5
Show newest version
package zio.aws.workmail.model
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import zio.aws.workmail.model.primitives.{
  Timestamp,
  OrganizationId,
  WorkMailIdentifier,
  AmazonResourceName,
  OrganizationName
}
import scala.jdk.CollectionConverters._
final case class DescribeOrganizationResponse(
    organizationId: Optional[OrganizationId] = Optional.Absent,
    alias: Optional[OrganizationName] = Optional.Absent,
    state: Optional[String] = Optional.Absent,
    directoryId: Optional[String] = Optional.Absent,
    directoryType: Optional[String] = Optional.Absent,
    defaultMailDomain: Optional[String] = Optional.Absent,
    completedDate: Optional[Timestamp] = Optional.Absent,
    errorMessage: Optional[String] = Optional.Absent,
    arn: Optional[AmazonResourceName] = Optional.Absent,
    migrationAdmin: Optional[WorkMailIdentifier] = Optional.Absent,
    interoperabilityEnabled: Optional[Boolean] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.workmail.model.DescribeOrganizationResponse = {
    import DescribeOrganizationResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.workmail.model.DescribeOrganizationResponse
      .builder()
      .optionallyWith(
        organizationId.map(value =>
          OrganizationId.unwrap(value): java.lang.String
        )
      )(_.organizationId)
      .optionallyWith(
        alias.map(value => OrganizationName.unwrap(value): java.lang.String)
      )(_.alias)
      .optionallyWith(state.map(value => value: java.lang.String))(_.state)
      .optionallyWith(directoryId.map(value => value: java.lang.String))(
        _.directoryId
      )
      .optionallyWith(directoryType.map(value => value: java.lang.String))(
        _.directoryType
      )
      .optionallyWith(defaultMailDomain.map(value => value: java.lang.String))(
        _.defaultMailDomain
      )
      .optionallyWith(
        completedDate.map(value => Timestamp.unwrap(value): Instant)
      )(_.completedDate)
      .optionallyWith(errorMessage.map(value => value: java.lang.String))(
        _.errorMessage
      )
      .optionallyWith(
        arn.map(value => AmazonResourceName.unwrap(value): java.lang.String)
      )(_.arn)
      .optionallyWith(
        migrationAdmin.map(value =>
          WorkMailIdentifier.unwrap(value): java.lang.String
        )
      )(_.migrationAdmin)
      .optionallyWith(
        interoperabilityEnabled.map(value => value: java.lang.Boolean)
      )(_.interoperabilityEnabled)
      .build()
  }
  def asReadOnly: zio.aws.workmail.model.DescribeOrganizationResponse.ReadOnly =
    zio.aws.workmail.model.DescribeOrganizationResponse.wrap(buildAwsValue())
}
object DescribeOrganizationResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.workmail.model.DescribeOrganizationResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.workmail.model.DescribeOrganizationResponse =
      zio.aws.workmail.model.DescribeOrganizationResponse(
        organizationId.map(value => value),
        alias.map(value => value),
        state.map(value => value),
        directoryId.map(value => value),
        directoryType.map(value => value),
        defaultMailDomain.map(value => value),
        completedDate.map(value => value),
        errorMessage.map(value => value),
        arn.map(value => value),
        migrationAdmin.map(value => value),
        interoperabilityEnabled.map(value => value)
      )
    def organizationId: Optional[OrganizationId]
    def alias: Optional[OrganizationName]
    def state: Optional[String]
    def directoryId: Optional[String]
    def directoryType: Optional[String]
    def defaultMailDomain: Optional[String]
    def completedDate: Optional[Timestamp]
    def errorMessage: Optional[String]
    def arn: Optional[AmazonResourceName]
    def migrationAdmin: Optional[WorkMailIdentifier]
    def interoperabilityEnabled: Optional[Boolean]
    def getOrganizationId: ZIO[Any, AwsError, OrganizationId] =
      AwsError.unwrapOptionField("organizationId", organizationId)
    def getAlias: ZIO[Any, AwsError, OrganizationName] =
      AwsError.unwrapOptionField("alias", alias)
    def getState: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("state", state)
    def getDirectoryId: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("directoryId", directoryId)
    def getDirectoryType: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("directoryType", directoryType)
    def getDefaultMailDomain: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("defaultMailDomain", defaultMailDomain)
    def getCompletedDate: ZIO[Any, AwsError, Timestamp] =
      AwsError.unwrapOptionField("completedDate", completedDate)
    def getErrorMessage: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("errorMessage", errorMessage)
    def getArn: ZIO[Any, AwsError, AmazonResourceName] =
      AwsError.unwrapOptionField("arn", arn)
    def getMigrationAdmin: ZIO[Any, AwsError, WorkMailIdentifier] =
      AwsError.unwrapOptionField("migrationAdmin", migrationAdmin)
    def getInteroperabilityEnabled: ZIO[Any, AwsError, Boolean] = AwsError
      .unwrapOptionField("interoperabilityEnabled", interoperabilityEnabled)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.workmail.model.DescribeOrganizationResponse
  ) extends zio.aws.workmail.model.DescribeOrganizationResponse.ReadOnly {
    override val organizationId: Optional[OrganizationId] =
      zio.aws.core.internal
        .optionalFromNullable(impl.organizationId())
        .map(value => zio.aws.workmail.model.primitives.OrganizationId(value))
    override val alias: Optional[OrganizationName] = zio.aws.core.internal
      .optionalFromNullable(impl.alias())
      .map(value => zio.aws.workmail.model.primitives.OrganizationName(value))
    override val state: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.state())
      .map(value => value: String)
    override val directoryId: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.directoryId())
      .map(value => value: String)
    override val directoryType: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.directoryType())
      .map(value => value: String)
    override val defaultMailDomain: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.defaultMailDomain())
      .map(value => value: String)
    override val completedDate: Optional[Timestamp] = zio.aws.core.internal
      .optionalFromNullable(impl.completedDate())
      .map(value => zio.aws.workmail.model.primitives.Timestamp(value))
    override val errorMessage: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.errorMessage())
      .map(value => value: String)
    override val arn: Optional[AmazonResourceName] = zio.aws.core.internal
      .optionalFromNullable(impl.arn())
      .map(value => zio.aws.workmail.model.primitives.AmazonResourceName(value))
    override val migrationAdmin: Optional[WorkMailIdentifier] =
      zio.aws.core.internal
        .optionalFromNullable(impl.migrationAdmin())
        .map(value =>
          zio.aws.workmail.model.primitives.WorkMailIdentifier(value)
        )
    override val interoperabilityEnabled: Optional[Boolean] =
      zio.aws.core.internal
        .optionalFromNullable(impl.interoperabilityEnabled())
        .map(value => value: Boolean)
  }
  def wrap(
      impl: software.amazon.awssdk.services.workmail.model.DescribeOrganizationResponse
  ): zio.aws.workmail.model.DescribeOrganizationResponse.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy