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