zio.aws.workmail.model.CreateUserResponse.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-workmail_2.12 Show documentation
Show all versions of zio-aws-workmail_2.12 Show documentation
Low-level AWS wrapper for ZIO
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)
}