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

zio.aws.tnb.model.CreateSolNetworkInstanceRequest.scala Maven / Gradle / Ivy

There is a newer version: 7.28.29.10
Show newest version
package zio.aws.tnb.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import zio.aws.tnb.model.primitives.{
  CreateSolNetworkInstanceInputNsNameString,
  TagValue,
  CreateSolNetworkInstanceInputNsDescriptionString,
  NsdInfoId,
  TagKey
}
import scala.jdk.CollectionConverters.*
final case class CreateSolNetworkInstanceRequest(
    nsDescription: Optional[CreateSolNetworkInstanceInputNsDescriptionString] =
      Optional.Absent,
    nsName: CreateSolNetworkInstanceInputNsNameString,
    nsdInfoId: NsdInfoId,
    tags: Optional[Map[TagKey, TagValue]] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.tnb.model.CreateSolNetworkInstanceRequest = {
    import CreateSolNetworkInstanceRequest.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.tnb.model.CreateSolNetworkInstanceRequest
      .builder()
      .optionallyWith(
        nsDescription.map(value =>
          CreateSolNetworkInstanceInputNsDescriptionString.unwrap(
            value
          ): java.lang.String
        )
      )(_.nsDescription)
      .nsName(
        CreateSolNetworkInstanceInputNsNameString.unwrap(
          nsName
        ): java.lang.String
      )
      .nsdInfoId(NsdInfoId.unwrap(nsdInfoId): java.lang.String)
      .optionallyWith(
        tags.map(value =>
          value
            .map({ case (key, value) =>
              (TagKey.unwrap(key): java.lang.String) -> (TagValue
                .unwrap(value): java.lang.String)
            })
            .asJava
        )
      )(_.tags)
      .build()
  }
  def asReadOnly: zio.aws.tnb.model.CreateSolNetworkInstanceRequest.ReadOnly =
    zio.aws.tnb.model.CreateSolNetworkInstanceRequest.wrap(buildAwsValue())
}
object CreateSolNetworkInstanceRequest {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.tnb.model.CreateSolNetworkInstanceRequest
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.tnb.model.CreateSolNetworkInstanceRequest =
      zio.aws.tnb.model.CreateSolNetworkInstanceRequest(
        nsDescription.map(value => value),
        nsName,
        nsdInfoId,
        tags.map(value => value)
      )
    def nsDescription
        : Optional[CreateSolNetworkInstanceInputNsDescriptionString]
    def nsName: CreateSolNetworkInstanceInputNsNameString
    def nsdInfoId: NsdInfoId
    def tags: Optional[Map[TagKey, TagValue]]
    def getNsDescription
        : ZIO[Any, AwsError, CreateSolNetworkInstanceInputNsDescriptionString] =
      AwsError.unwrapOptionField("nsDescription", nsDescription)
    def getNsName
        : ZIO[Any, Nothing, CreateSolNetworkInstanceInputNsNameString] =
      ZIO.succeed(nsName)
    def getNsdInfoId: ZIO[Any, Nothing, NsdInfoId] = ZIO.succeed(nsdInfoId)
    def getTags: ZIO[Any, AwsError, Map[TagKey, TagValue]] =
      AwsError.unwrapOptionField("tags", tags)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.tnb.model.CreateSolNetworkInstanceRequest
  ) extends zio.aws.tnb.model.CreateSolNetworkInstanceRequest.ReadOnly {
    override val nsDescription
        : Optional[CreateSolNetworkInstanceInputNsDescriptionString] =
      zio.aws.core.internal
        .optionalFromNullable(impl.nsDescription())
        .map(value =>
          zio.aws.tnb.model.primitives
            .CreateSolNetworkInstanceInputNsDescriptionString(value)
        )
    override val nsName: CreateSolNetworkInstanceInputNsNameString =
      zio.aws.tnb.model.primitives
        .CreateSolNetworkInstanceInputNsNameString(impl.nsName())
    override val nsdInfoId: NsdInfoId =
      zio.aws.tnb.model.primitives.NsdInfoId(impl.nsdInfoId())
    override val tags: Optional[Map[TagKey, TagValue]] = zio.aws.core.internal
      .optionalFromNullable(impl.tags())
      .map(value =>
        value.asScala
          .map({ case (key, value) =>
            zio.aws.tnb.model.primitives
              .TagKey(key) -> zio.aws.tnb.model.primitives.TagValue(value)
          })
          .toMap
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.tnb.model.CreateSolNetworkInstanceRequest
  ): zio.aws.tnb.model.CreateSolNetworkInstanceRequest.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy