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

zio.aws.emrcontainers.model.CreateVirtualClusterRequest.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.{
  ResourceIdString,
  StringEmpty256,
  String128,
  ClientToken,
  ResourceNameString
}
import scala.jdk.CollectionConverters._
final case class CreateVirtualClusterRequest(
    name: ResourceNameString,
    containerProvider: zio.aws.emrcontainers.model.ContainerProvider,
    clientToken: ClientToken,
    tags: Optional[Map[String128, StringEmpty256]] = Optional.Absent,
    securityConfigurationId: Optional[ResourceIdString] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.emrcontainers.model.CreateVirtualClusterRequest = {
    import CreateVirtualClusterRequest.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.emrcontainers.model.CreateVirtualClusterRequest
      .builder()
      .name(ResourceNameString.unwrap(name): java.lang.String)
      .containerProvider(containerProvider.buildAwsValue())
      .clientToken(ClientToken.unwrap(clientToken): java.lang.String)
      .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.CreateVirtualClusterRequest.ReadOnly =
    zio.aws.emrcontainers.model.CreateVirtualClusterRequest
      .wrap(buildAwsValue())
}
object CreateVirtualClusterRequest {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.emrcontainers.model.CreateVirtualClusterRequest
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.emrcontainers.model.CreateVirtualClusterRequest =
      zio.aws.emrcontainers.model.CreateVirtualClusterRequest(
        name,
        containerProvider.asEditable,
        clientToken,
        tags.map(value => value),
        securityConfigurationId.map(value => value)
      )
    def name: ResourceNameString
    def containerProvider
        : zio.aws.emrcontainers.model.ContainerProvider.ReadOnly
    def clientToken: ClientToken
    def tags: Optional[Map[String128, StringEmpty256]]
    def securityConfigurationId: Optional[ResourceIdString]
    def getName: ZIO[Any, Nothing, ResourceNameString] = ZIO.succeed(name)
    def getContainerProvider: ZIO[
      Any,
      Nothing,
      zio.aws.emrcontainers.model.ContainerProvider.ReadOnly
    ] = ZIO.succeed(containerProvider)
    def getClientToken: ZIO[Any, Nothing, ClientToken] =
      ZIO.succeed(clientToken)
    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.CreateVirtualClusterRequest
  ) extends zio.aws.emrcontainers.model.CreateVirtualClusterRequest.ReadOnly {
    override val name: ResourceNameString =
      zio.aws.emrcontainers.model.primitives.ResourceNameString(impl.name())
    override val containerProvider
        : zio.aws.emrcontainers.model.ContainerProvider.ReadOnly =
      zio.aws.emrcontainers.model.ContainerProvider
        .wrap(impl.containerProvider())
    override val clientToken: ClientToken =
      zio.aws.emrcontainers.model.primitives.ClientToken(impl.clientToken())
    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.CreateVirtualClusterRequest
  ): zio.aws.emrcontainers.model.CreateVirtualClusterRequest.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy