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

zio.aws.tnb.model.UpdateSolNetworkInstanceRequest.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.{TagValue, TagKey, NsInstanceId}
import scala.jdk.CollectionConverters.*
final case class UpdateSolNetworkInstanceRequest(
    modifyVnfInfoData: Optional[zio.aws.tnb.model.UpdateSolNetworkModify] =
      Optional.Absent,
    nsInstanceId: NsInstanceId,
    tags: Optional[Map[TagKey, TagValue]] = Optional.Absent,
    updateNs: Optional[zio.aws.tnb.model.UpdateSolNetworkServiceData] =
      Optional.Absent,
    updateType: zio.aws.tnb.model.UpdateSolNetworkType
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.tnb.model.UpdateSolNetworkInstanceRequest = {
    import UpdateSolNetworkInstanceRequest.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.tnb.model.UpdateSolNetworkInstanceRequest
      .builder()
      .optionallyWith(modifyVnfInfoData.map(value => value.buildAwsValue()))(
        _.modifyVnfInfoData
      )
      .nsInstanceId(NsInstanceId.unwrap(nsInstanceId): 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)
      .optionallyWith(updateNs.map(value => value.buildAwsValue()))(_.updateNs)
      .updateType(updateType.unwrap)
      .build()
  }
  def asReadOnly: zio.aws.tnb.model.UpdateSolNetworkInstanceRequest.ReadOnly =
    zio.aws.tnb.model.UpdateSolNetworkInstanceRequest.wrap(buildAwsValue())
}
object UpdateSolNetworkInstanceRequest {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.tnb.model.UpdateSolNetworkInstanceRequest
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.tnb.model.UpdateSolNetworkInstanceRequest =
      zio.aws.tnb.model.UpdateSolNetworkInstanceRequest(
        modifyVnfInfoData.map(value => value.asEditable),
        nsInstanceId,
        tags.map(value => value),
        updateNs.map(value => value.asEditable),
        updateType
      )
    def modifyVnfInfoData
        : Optional[zio.aws.tnb.model.UpdateSolNetworkModify.ReadOnly]
    def nsInstanceId: NsInstanceId
    def tags: Optional[Map[TagKey, TagValue]]
    def updateNs
        : Optional[zio.aws.tnb.model.UpdateSolNetworkServiceData.ReadOnly]
    def updateType: zio.aws.tnb.model.UpdateSolNetworkType
    def getModifyVnfInfoData: ZIO[
      Any,
      AwsError,
      zio.aws.tnb.model.UpdateSolNetworkModify.ReadOnly
    ] = AwsError.unwrapOptionField("modifyVnfInfoData", modifyVnfInfoData)
    def getNsInstanceId: ZIO[Any, Nothing, NsInstanceId] =
      ZIO.succeed(nsInstanceId)
    def getTags: ZIO[Any, AwsError, Map[TagKey, TagValue]] =
      AwsError.unwrapOptionField("tags", tags)
    def getUpdateNs: ZIO[
      Any,
      AwsError,
      zio.aws.tnb.model.UpdateSolNetworkServiceData.ReadOnly
    ] = AwsError.unwrapOptionField("updateNs", updateNs)
    def getUpdateType
        : ZIO[Any, Nothing, zio.aws.tnb.model.UpdateSolNetworkType] =
      ZIO.succeed(updateType)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.tnb.model.UpdateSolNetworkInstanceRequest
  ) extends zio.aws.tnb.model.UpdateSolNetworkInstanceRequest.ReadOnly {
    override val modifyVnfInfoData
        : Optional[zio.aws.tnb.model.UpdateSolNetworkModify.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.modifyVnfInfoData())
        .map(value => zio.aws.tnb.model.UpdateSolNetworkModify.wrap(value))
    override val nsInstanceId: NsInstanceId =
      zio.aws.tnb.model.primitives.NsInstanceId(impl.nsInstanceId())
    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
      )
    override val updateNs
        : Optional[zio.aws.tnb.model.UpdateSolNetworkServiceData.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.updateNs())
        .map(value => zio.aws.tnb.model.UpdateSolNetworkServiceData.wrap(value))
    override val updateType: zio.aws.tnb.model.UpdateSolNetworkType =
      zio.aws.tnb.model.UpdateSolNetworkType.wrap(impl.updateType())
  }
  def wrap(
      impl: software.amazon.awssdk.services.tnb.model.UpdateSolNetworkInstanceRequest
  ): zio.aws.tnb.model.UpdateSolNetworkInstanceRequest.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy