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

zio.aws.workmail.model.CreateImpersonationRoleResponse.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.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)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy