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