All Downloads are FREE. Search and download functionalities are using the official Maven repository.

zio.aws.emrcontainers.model.SparkSqlJobDriver.scala Maven / Gradle / Ivy

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)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy