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