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

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

The newest version!
package zio.aws.emrcontainers.model
import zio.aws.emrcontainers.model.primitives.{
  Date,
  ResourceIdString,
  VirtualClusterArn,
  StringEmpty256,
  String128,
  ResourceNameString
}
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import scala.jdk.CollectionConverters._
final case class VirtualCluster(
    id: Optional[ResourceIdString] = Optional.Absent,
    name: Optional[ResourceNameString] = Optional.Absent,
    arn: Optional[VirtualClusterArn] = Optional.Absent,
    state: Optional[zio.aws.emrcontainers.model.VirtualClusterState] =
      Optional.Absent,
    containerProvider: Optional[zio.aws.emrcontainers.model.ContainerProvider] =
      Optional.Absent,
    createdAt: Optional[Date] = Optional.Absent,
    tags: Optional[Map[String128, StringEmpty256]] = Optional.Absent,
    securityConfigurationId: Optional[ResourceIdString] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.emrcontainers.model.VirtualCluster = {
    import VirtualCluster.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.emrcontainers.model.VirtualCluster
      .builder()
      .optionallyWith(
        id.map(value => ResourceIdString.unwrap(value): java.lang.String)
      )(_.id)
      .optionallyWith(
        name.map(value => ResourceNameString.unwrap(value): java.lang.String)
      )(_.name)
      .optionallyWith(
        arn.map(value => VirtualClusterArn.unwrap(value): java.lang.String)
      )(_.arn)
      .optionallyWith(state.map(value => value.unwrap))(_.state)
      .optionallyWith(containerProvider.map(value => value.buildAwsValue()))(
        _.containerProvider
      )
      .optionallyWith(createdAt.map(value => Date.unwrap(value): Instant))(
        _.createdAt
      )
      .optionallyWith(
        tags.map(value =>
          value
            .map({ case (key, value) =>
              (String128.unwrap(key): java.lang.String) -> (StringEmpty256
                .unwrap(value): java.lang.String)
            })
            .asJava
        )
      )(_.tags)
      .optionallyWith(
        securityConfigurationId.map(value =>
          ResourceIdString.unwrap(value): java.lang.String
        )
      )(_.securityConfigurationId)
      .build()
  }
  def asReadOnly: zio.aws.emrcontainers.model.VirtualCluster.ReadOnly =
    zio.aws.emrcontainers.model.VirtualCluster.wrap(buildAwsValue())
}
object VirtualCluster {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.emrcontainers.model.VirtualCluster
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.emrcontainers.model.VirtualCluster =
      zio.aws.emrcontainers.model.VirtualCluster(
        id.map(value => value),
        name.map(value => value),
        arn.map(value => value),
        state.map(value => value),
        containerProvider.map(value => value.asEditable),
        createdAt.map(value => value),
        tags.map(value => value),
        securityConfigurationId.map(value => value)
      )
    def id: Optional[ResourceIdString]
    def name: Optional[ResourceNameString]
    def arn: Optional[VirtualClusterArn]
    def state: Optional[zio.aws.emrcontainers.model.VirtualClusterState]
    def containerProvider
        : Optional[zio.aws.emrcontainers.model.ContainerProvider.ReadOnly]
    def createdAt: Optional[Date]
    def tags: Optional[Map[String128, StringEmpty256]]
    def securityConfigurationId: Optional[ResourceIdString]
    def getId: ZIO[Any, AwsError, ResourceIdString] =
      AwsError.unwrapOptionField("id", id)
    def getName: ZIO[Any, AwsError, ResourceNameString] =
      AwsError.unwrapOptionField("name", name)
    def getArn: ZIO[Any, AwsError, VirtualClusterArn] =
      AwsError.unwrapOptionField("arn", arn)
    def getState
        : ZIO[Any, AwsError, zio.aws.emrcontainers.model.VirtualClusterState] =
      AwsError.unwrapOptionField("state", state)
    def getContainerProvider: ZIO[
      Any,
      AwsError,
      zio.aws.emrcontainers.model.ContainerProvider.ReadOnly
    ] = AwsError.unwrapOptionField("containerProvider", containerProvider)
    def getCreatedAt: ZIO[Any, AwsError, Date] =
      AwsError.unwrapOptionField("createdAt", createdAt)
    def getTags: ZIO[Any, AwsError, Map[String128, StringEmpty256]] =
      AwsError.unwrapOptionField("tags", tags)
    def getSecurityConfigurationId: ZIO[Any, AwsError, ResourceIdString] =
      AwsError.unwrapOptionField(
        "securityConfigurationId",
        securityConfigurationId
      )
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.emrcontainers.model.VirtualCluster
  ) extends zio.aws.emrcontainers.model.VirtualCluster.ReadOnly {
    override val id: Optional[ResourceIdString] = zio.aws.core.internal
      .optionalFromNullable(impl.id())
      .map(value =>
        zio.aws.emrcontainers.model.primitives.ResourceIdString(value)
      )
    override val name: Optional[ResourceNameString] = zio.aws.core.internal
      .optionalFromNullable(impl.name())
      .map(value =>
        zio.aws.emrcontainers.model.primitives.ResourceNameString(value)
      )
    override val arn: Optional[VirtualClusterArn] = zio.aws.core.internal
      .optionalFromNullable(impl.arn())
      .map(value =>
        zio.aws.emrcontainers.model.primitives.VirtualClusterArn(value)
      )
    override val state
        : Optional[zio.aws.emrcontainers.model.VirtualClusterState] =
      zio.aws.core.internal
        .optionalFromNullable(impl.state())
        .map(value =>
          zio.aws.emrcontainers.model.VirtualClusterState.wrap(value)
        )
    override val containerProvider
        : Optional[zio.aws.emrcontainers.model.ContainerProvider.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.containerProvider())
        .map(value => zio.aws.emrcontainers.model.ContainerProvider.wrap(value))
    override val createdAt: Optional[Date] = zio.aws.core.internal
      .optionalFromNullable(impl.createdAt())
      .map(value => zio.aws.emrcontainers.model.primitives.Date(value))
    override val tags: Optional[Map[String128, StringEmpty256]] =
      zio.aws.core.internal
        .optionalFromNullable(impl.tags())
        .map(value =>
          value.asScala
            .map({ case (key, value) =>
              zio.aws.emrcontainers.model.primitives.String128(
                key
              ) -> zio.aws.emrcontainers.model.primitives.StringEmpty256(value)
            })
            .toMap
        )
    override val securityConfigurationId: Optional[ResourceIdString] =
      zio.aws.core.internal
        .optionalFromNullable(impl.securityConfigurationId())
        .map(value =>
          zio.aws.emrcontainers.model.primitives.ResourceIdString(value)
        )
  }
  def wrap(
      impl: software.amazon.awssdk.services.emrcontainers.model.VirtualCluster
  ): zio.aws.emrcontainers.model.VirtualCluster.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy