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

zio.aws.emrcontainers.model.ContainerProvider.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.ClusterId
import scala.jdk.CollectionConverters._
final case class ContainerProvider(
    `type`: zio.aws.emrcontainers.model.ContainerProviderType,
    id: ClusterId,
    info: Optional[zio.aws.emrcontainers.model.ContainerInfo] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.emrcontainers.model.ContainerProvider = {
    import ContainerProvider.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.emrcontainers.model.ContainerProvider
      .builder()
      .`type`(`type`.unwrap)
      .id(ClusterId.unwrap(id): java.lang.String)
      .optionallyWith(info.map(value => value.buildAwsValue()))(_.info)
      .build()
  }
  def asReadOnly: zio.aws.emrcontainers.model.ContainerProvider.ReadOnly =
    zio.aws.emrcontainers.model.ContainerProvider.wrap(buildAwsValue())
}
object ContainerProvider {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.emrcontainers.model.ContainerProvider
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.emrcontainers.model.ContainerProvider =
      zio.aws.emrcontainers.model
        .ContainerProvider(`type`, id, info.map(value => value.asEditable))
    def `type`: zio.aws.emrcontainers.model.ContainerProviderType
    def id: ClusterId
    def info: Optional[zio.aws.emrcontainers.model.ContainerInfo.ReadOnly]
    def getType
        : ZIO[Any, Nothing, zio.aws.emrcontainers.model.ContainerProviderType] =
      ZIO.succeed(`type`)
    def getId: ZIO[Any, Nothing, ClusterId] = ZIO.succeed(id)
    def getInfo: ZIO[
      Any,
      AwsError,
      zio.aws.emrcontainers.model.ContainerInfo.ReadOnly
    ] = AwsError.unwrapOptionField("info", info)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.emrcontainers.model.ContainerProvider
  ) extends zio.aws.emrcontainers.model.ContainerProvider.ReadOnly {
    override val `type`: zio.aws.emrcontainers.model.ContainerProviderType =
      zio.aws.emrcontainers.model.ContainerProviderType.wrap(impl.`type`())
    override val id: ClusterId =
      zio.aws.emrcontainers.model.primitives.ClusterId(impl.id())
    override val info
        : Optional[zio.aws.emrcontainers.model.ContainerInfo.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.info())
        .map(value => zio.aws.emrcontainers.model.ContainerInfo.wrap(value))
  }
  def wrap(
      impl: software.amazon.awssdk.services.emrcontainers.model.ContainerProvider
  ): zio.aws.emrcontainers.model.ContainerProvider.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy