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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy