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

zio.aws.workmail.model.OrganizationSummary.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.{
  DomainName,
  OrganizationName,
  OrganizationId
}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class OrganizationSummary(
    organizationId: Optional[OrganizationId] = Optional.Absent,
    alias: Optional[OrganizationName] = Optional.Absent,
    defaultMailDomain: Optional[DomainName] = Optional.Absent,
    errorMessage: Optional[String] = Optional.Absent,
    state: Optional[String] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.workmail.model.OrganizationSummary = {
    import OrganizationSummary.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.workmail.model.OrganizationSummary
      .builder()
      .optionallyWith(
        organizationId.map(value =>
          OrganizationId.unwrap(value): java.lang.String
        )
      )(_.organizationId)
      .optionallyWith(
        alias.map(value => OrganizationName.unwrap(value): java.lang.String)
      )(_.alias)
      .optionallyWith(
        defaultMailDomain.map(value =>
          DomainName.unwrap(value): java.lang.String
        )
      )(_.defaultMailDomain)
      .optionallyWith(errorMessage.map(value => value: java.lang.String))(
        _.errorMessage
      )
      .optionallyWith(state.map(value => value: java.lang.String))(_.state)
      .build()
  }
  def asReadOnly: zio.aws.workmail.model.OrganizationSummary.ReadOnly =
    zio.aws.workmail.model.OrganizationSummary.wrap(buildAwsValue())
}
object OrganizationSummary {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.workmail.model.OrganizationSummary
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.workmail.model.OrganizationSummary =
      zio.aws.workmail.model.OrganizationSummary(
        organizationId.map(value => value),
        alias.map(value => value),
        defaultMailDomain.map(value => value),
        errorMessage.map(value => value),
        state.map(value => value)
      )
    def organizationId: Optional[OrganizationId]
    def alias: Optional[OrganizationName]
    def defaultMailDomain: Optional[DomainName]
    def errorMessage: Optional[String]
    def state: Optional[String]
    def getOrganizationId: ZIO[Any, AwsError, OrganizationId] =
      AwsError.unwrapOptionField("organizationId", organizationId)
    def getAlias: ZIO[Any, AwsError, OrganizationName] =
      AwsError.unwrapOptionField("alias", alias)
    def getDefaultMailDomain: ZIO[Any, AwsError, DomainName] =
      AwsError.unwrapOptionField("defaultMailDomain", defaultMailDomain)
    def getErrorMessage: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("errorMessage", errorMessage)
    def getState: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("state", state)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.workmail.model.OrganizationSummary
  ) extends zio.aws.workmail.model.OrganizationSummary.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 defaultMailDomain: Optional[DomainName] = zio.aws.core.internal
      .optionalFromNullable(impl.defaultMailDomain())
      .map(value => zio.aws.workmail.model.primitives.DomainName(value))
    override val errorMessage: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.errorMessage())
      .map(value => value: String)
    override val state: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.state())
      .map(value => value: String)
  }
  def wrap(
      impl: software.amazon.awssdk.services.workmail.model.OrganizationSummary
  ): zio.aws.workmail.model.OrganizationSummary.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy