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

zio.aws.emrcontainers.model.SparkSubmitJobDriver.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.{
  SparkSubmitParameters,
  EntryPointArgument,
  EntryPointPath
}
import scala.jdk.CollectionConverters._
final case class SparkSubmitJobDriver(
    entryPoint: EntryPointPath,
    entryPointArguments: Optional[Iterable[EntryPointArgument]] =
      Optional.Absent,
    sparkSubmitParameters: Optional[SparkSubmitParameters] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.emrcontainers.model.SparkSubmitJobDriver = {
    import SparkSubmitJobDriver.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.emrcontainers.model.SparkSubmitJobDriver
      .builder()
      .entryPoint(EntryPointPath.unwrap(entryPoint): java.lang.String)
      .optionallyWith(
        entryPointArguments.map(value =>
          value.map { item =>
            EntryPointArgument.unwrap(item): java.lang.String
          }.asJavaCollection
        )
      )(_.entryPointArguments)
      .optionallyWith(
        sparkSubmitParameters.map(value =>
          SparkSubmitParameters.unwrap(value): java.lang.String
        )
      )(_.sparkSubmitParameters)
      .build()
  }
  def asReadOnly: zio.aws.emrcontainers.model.SparkSubmitJobDriver.ReadOnly =
    zio.aws.emrcontainers.model.SparkSubmitJobDriver.wrap(buildAwsValue())
}
object SparkSubmitJobDriver {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.emrcontainers.model.SparkSubmitJobDriver
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.emrcontainers.model.SparkSubmitJobDriver =
      zio.aws.emrcontainers.model.SparkSubmitJobDriver(
        entryPoint,
        entryPointArguments.map(value => value),
        sparkSubmitParameters.map(value => value)
      )
    def entryPoint: EntryPointPath
    def entryPointArguments: Optional[List[EntryPointArgument]]
    def sparkSubmitParameters: Optional[SparkSubmitParameters]
    def getEntryPoint: ZIO[Any, Nothing, EntryPointPath] =
      ZIO.succeed(entryPoint)
    def getEntryPointArguments: ZIO[Any, AwsError, List[EntryPointArgument]] =
      AwsError.unwrapOptionField("entryPointArguments", entryPointArguments)
    def getSparkSubmitParameters: ZIO[Any, AwsError, SparkSubmitParameters] =
      AwsError.unwrapOptionField("sparkSubmitParameters", sparkSubmitParameters)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.emrcontainers.model.SparkSubmitJobDriver
  ) extends zio.aws.emrcontainers.model.SparkSubmitJobDriver.ReadOnly {
    override val entryPoint: EntryPointPath =
      zio.aws.emrcontainers.model.primitives.EntryPointPath(impl.entryPoint())
    override val entryPointArguments: Optional[List[EntryPointArgument]] =
      zio.aws.core.internal
        .optionalFromNullable(impl.entryPointArguments())
        .map(value =>
          value.asScala.map { item =>
            zio.aws.emrcontainers.model.primitives.EntryPointArgument(item)
          }.toList
        )
    override val sparkSubmitParameters: Optional[SparkSubmitParameters] =
      zio.aws.core.internal
        .optionalFromNullable(impl.sparkSubmitParameters())
        .map(value =>
          zio.aws.emrcontainers.model.primitives.SparkSubmitParameters(value)
        )
  }
  def wrap(
      impl: software.amazon.awssdk.services.emrcontainers.model.SparkSubmitJobDriver
  ): zio.aws.emrcontainers.model.SparkSubmitJobDriver.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy