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