zio.aws.workmail.model.StartMailboxExportJobRequest.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.{
IdempotencyClientToken,
RoleArn,
OrganizationId,
S3BucketName,
Description,
EntityIdentifier,
KmsKeyArn,
S3ObjectKey
}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class StartMailboxExportJobRequest(
clientToken: IdempotencyClientToken,
organizationId: OrganizationId,
entityId: EntityIdentifier,
description: Optional[Description] = Optional.Absent,
roleArn: RoleArn,
kmsKeyArn: KmsKeyArn,
s3BucketName: S3BucketName,
s3Prefix: S3ObjectKey
) {
def buildAwsValue()
: software.amazon.awssdk.services.workmail.model.StartMailboxExportJobRequest = {
import StartMailboxExportJobRequest.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.workmail.model.StartMailboxExportJobRequest
.builder()
.clientToken(IdempotencyClientToken.unwrap(clientToken): java.lang.String)
.organizationId(OrganizationId.unwrap(organizationId): java.lang.String)
.entityId(EntityIdentifier.unwrap(entityId): java.lang.String)
.optionallyWith(
description.map(value => Description.unwrap(value): java.lang.String)
)(_.description)
.roleArn(RoleArn.unwrap(roleArn): java.lang.String)
.kmsKeyArn(KmsKeyArn.unwrap(kmsKeyArn): java.lang.String)
.s3BucketName(S3BucketName.unwrap(s3BucketName): java.lang.String)
.s3Prefix(S3ObjectKey.unwrap(s3Prefix): java.lang.String)
.build()
}
def asReadOnly: zio.aws.workmail.model.StartMailboxExportJobRequest.ReadOnly =
zio.aws.workmail.model.StartMailboxExportJobRequest.wrap(buildAwsValue())
}
object StartMailboxExportJobRequest {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.workmail.model.StartMailboxExportJobRequest
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.workmail.model.StartMailboxExportJobRequest =
zio.aws.workmail.model.StartMailboxExportJobRequest(
clientToken,
organizationId,
entityId,
description.map(value => value),
roleArn,
kmsKeyArn,
s3BucketName,
s3Prefix
)
def clientToken: IdempotencyClientToken
def organizationId: OrganizationId
def entityId: EntityIdentifier
def description: Optional[Description]
def roleArn: RoleArn
def kmsKeyArn: KmsKeyArn
def s3BucketName: S3BucketName
def s3Prefix: S3ObjectKey
def getClientToken: ZIO[Any, Nothing, IdempotencyClientToken] =
ZIO.succeed(clientToken)
def getOrganizationId: ZIO[Any, Nothing, OrganizationId] =
ZIO.succeed(organizationId)
def getEntityId: ZIO[Any, Nothing, EntityIdentifier] = ZIO.succeed(entityId)
def getDescription: ZIO[Any, AwsError, Description] =
AwsError.unwrapOptionField("description", description)
def getRoleArn: ZIO[Any, Nothing, RoleArn] = ZIO.succeed(roleArn)
def getKmsKeyArn: ZIO[Any, Nothing, KmsKeyArn] = ZIO.succeed(kmsKeyArn)
def getS3BucketName: ZIO[Any, Nothing, S3BucketName] =
ZIO.succeed(s3BucketName)
def getS3Prefix: ZIO[Any, Nothing, S3ObjectKey] = ZIO.succeed(s3Prefix)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.workmail.model.StartMailboxExportJobRequest
) extends zio.aws.workmail.model.StartMailboxExportJobRequest.ReadOnly {
override val clientToken: IdempotencyClientToken =
zio.aws.workmail.model.primitives
.IdempotencyClientToken(impl.clientToken())
override val organizationId: OrganizationId =
zio.aws.workmail.model.primitives.OrganizationId(impl.organizationId())
override val entityId: EntityIdentifier =
zio.aws.workmail.model.primitives.EntityIdentifier(impl.entityId())
override val description: Optional[Description] = zio.aws.core.internal
.optionalFromNullable(impl.description())
.map(value => zio.aws.workmail.model.primitives.Description(value))
override val roleArn: RoleArn =
zio.aws.workmail.model.primitives.RoleArn(impl.roleArn())
override val kmsKeyArn: KmsKeyArn =
zio.aws.workmail.model.primitives.KmsKeyArn(impl.kmsKeyArn())
override val s3BucketName: S3BucketName =
zio.aws.workmail.model.primitives.S3BucketName(impl.s3BucketName())
override val s3Prefix: S3ObjectKey =
zio.aws.workmail.model.primitives.S3ObjectKey(impl.s3Prefix())
}
def wrap(
impl: software.amazon.awssdk.services.workmail.model.StartMailboxExportJobRequest
): zio.aws.workmail.model.StartMailboxExportJobRequest.ReadOnly = new Wrapper(
impl
)
}