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

zio.aws.emrcontainers.model.CreateManagedEndpointResponse.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.{
  EndpointArn,
  ResourceNameString,
  ResourceIdString
}
import scala.jdk.CollectionConverters._
final case class CreateManagedEndpointResponse(
    id: Optional[ResourceIdString] = Optional.Absent,
    name: Optional[ResourceNameString] = Optional.Absent,
    arn: Optional[EndpointArn] = Optional.Absent,
    virtualClusterId: Optional[ResourceIdString] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.emrcontainers.model.CreateManagedEndpointResponse = {
    import CreateManagedEndpointResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.emrcontainers.model.CreateManagedEndpointResponse
      .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 => EndpointArn.unwrap(value): java.lang.String)
      )(_.arn)
      .optionallyWith(
        virtualClusterId.map(value =>
          ResourceIdString.unwrap(value): java.lang.String
        )
      )(_.virtualClusterId)
      .build()
  }
  def asReadOnly
      : zio.aws.emrcontainers.model.CreateManagedEndpointResponse.ReadOnly =
    zio.aws.emrcontainers.model.CreateManagedEndpointResponse
      .wrap(buildAwsValue())
}
object CreateManagedEndpointResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.emrcontainers.model.CreateManagedEndpointResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.emrcontainers.model.CreateManagedEndpointResponse =
      zio.aws.emrcontainers.model.CreateManagedEndpointResponse(
        id.map(value => value),
        name.map(value => value),
        arn.map(value => value),
        virtualClusterId.map(value => value)
      )
    def id: Optional[ResourceIdString]
    def name: Optional[ResourceNameString]
    def arn: Optional[EndpointArn]
    def virtualClusterId: 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, EndpointArn] =
      AwsError.unwrapOptionField("arn", arn)
    def getVirtualClusterId: ZIO[Any, AwsError, ResourceIdString] =
      AwsError.unwrapOptionField("virtualClusterId", virtualClusterId)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.emrcontainers.model.CreateManagedEndpointResponse
  ) extends zio.aws.emrcontainers.model.CreateManagedEndpointResponse.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[EndpointArn] = zio.aws.core.internal
      .optionalFromNullable(impl.arn())
      .map(value => zio.aws.emrcontainers.model.primitives.EndpointArn(value))
    override val virtualClusterId: Optional[ResourceIdString] =
      zio.aws.core.internal
        .optionalFromNullable(impl.virtualClusterId())
        .map(value =>
          zio.aws.emrcontainers.model.primitives.ResourceIdString(value)
        )
  }
  def wrap(
      impl: software.amazon.awssdk.services.emrcontainers.model.CreateManagedEndpointResponse
  ): zio.aws.emrcontainers.model.CreateManagedEndpointResponse.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy