zio.aws.emrcontainers.model.SparkSqlJobDriver.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-emrcontainers_2.12 Show documentation
Show all versions of zio-aws-emrcontainers_2.12 Show documentation
Low-level AWS wrapper for ZIO
The newest version!
package zio.aws.emrcontainers.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import zio.aws.emrcontainers.model.primitives.{
SparkSqlParameters,
EntryPointPath
}
import scala.jdk.CollectionConverters._
final case class SparkSqlJobDriver(
entryPoint: Optional[EntryPointPath] = Optional.Absent,
sparkSqlParameters: Optional[SparkSqlParameters] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.emrcontainers.model.SparkSqlJobDriver = {
import SparkSqlJobDriver.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.emrcontainers.model.SparkSqlJobDriver
.builder()
.optionallyWith(
entryPoint.map(value => EntryPointPath.unwrap(value): java.lang.String)
)(_.entryPoint)
.optionallyWith(
sparkSqlParameters.map(value =>
SparkSqlParameters.unwrap(value): java.lang.String
)
)(_.sparkSqlParameters)
.build()
}
def asReadOnly: zio.aws.emrcontainers.model.SparkSqlJobDriver.ReadOnly =
zio.aws.emrcontainers.model.SparkSqlJobDriver.wrap(buildAwsValue())
}
object SparkSqlJobDriver {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.emrcontainers.model.SparkSqlJobDriver
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.emrcontainers.model.SparkSqlJobDriver =
zio.aws.emrcontainers.model.SparkSqlJobDriver(
entryPoint.map(value => value),
sparkSqlParameters.map(value => value)
)
def entryPoint: Optional[EntryPointPath]
def sparkSqlParameters: Optional[SparkSqlParameters]
def getEntryPoint: ZIO[Any, AwsError, EntryPointPath] =
AwsError.unwrapOptionField("entryPoint", entryPoint)
def getSparkSqlParameters: ZIO[Any, AwsError, SparkSqlParameters] =
AwsError.unwrapOptionField("sparkSqlParameters", sparkSqlParameters)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.emrcontainers.model.SparkSqlJobDriver
) extends zio.aws.emrcontainers.model.SparkSqlJobDriver.ReadOnly {
override val entryPoint: Optional[EntryPointPath] = zio.aws.core.internal
.optionalFromNullable(impl.entryPoint())
.map(value =>
zio.aws.emrcontainers.model.primitives.EntryPointPath(value)
)
override val sparkSqlParameters: Optional[SparkSqlParameters] =
zio.aws.core.internal
.optionalFromNullable(impl.sparkSqlParameters())
.map(value =>
zio.aws.emrcontainers.model.primitives.SparkSqlParameters(value)
)
}
def wrap(
impl: software.amazon.awssdk.services.emrcontainers.model.SparkSqlJobDriver
): zio.aws.emrcontainers.model.SparkSqlJobDriver.ReadOnly = new Wrapper(impl)
}