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

zio.aws.tnb.model.GetSolFunctionInstanceResponse.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.{
  VnfInstanceId,
  TagValue,
  VnfInstanceArn,
  VnfdId,
  NsInstanceId,
  VnfPkgId,
  TagKey
}
import scala.jdk.CollectionConverters.*
final case class GetSolFunctionInstanceResponse(
    arn: VnfInstanceArn,
    id: VnfInstanceId,
    instantiatedVnfInfo: Optional[zio.aws.tnb.model.GetSolVnfInfo] =
      Optional.Absent,
    instantiationState: zio.aws.tnb.model.VnfInstantiationState,
    metadata: zio.aws.tnb.model.GetSolFunctionInstanceMetadata,
    nsInstanceId: NsInstanceId,
    tags: Optional[Map[TagKey, TagValue]] = Optional.Absent,
    vnfPkgId: VnfPkgId,
    vnfProductName: Optional[String] = Optional.Absent,
    vnfProvider: Optional[String] = Optional.Absent,
    vnfdId: VnfdId,
    vnfdVersion: Optional[String] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.tnb.model.GetSolFunctionInstanceResponse = {
    import GetSolFunctionInstanceResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.tnb.model.GetSolFunctionInstanceResponse
      .builder()
      .arn(VnfInstanceArn.unwrap(arn): java.lang.String)
      .id(VnfInstanceId.unwrap(id): java.lang.String)
      .optionallyWith(instantiatedVnfInfo.map(value => value.buildAwsValue()))(
        _.instantiatedVnfInfo
      )
      .instantiationState(instantiationState.unwrap)
      .metadata(metadata.buildAwsValue())
      .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)
      .vnfPkgId(VnfPkgId.unwrap(vnfPkgId): java.lang.String)
      .optionallyWith(vnfProductName.map(value => value: java.lang.String))(
        _.vnfProductName
      )
      .optionallyWith(vnfProvider.map(value => value: java.lang.String))(
        _.vnfProvider
      )
      .vnfdId(VnfdId.unwrap(vnfdId): java.lang.String)
      .optionallyWith(vnfdVersion.map(value => value: java.lang.String))(
        _.vnfdVersion
      )
      .build()
  }
  def asReadOnly: zio.aws.tnb.model.GetSolFunctionInstanceResponse.ReadOnly =
    zio.aws.tnb.model.GetSolFunctionInstanceResponse.wrap(buildAwsValue())
}
object GetSolFunctionInstanceResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.tnb.model.GetSolFunctionInstanceResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.tnb.model.GetSolFunctionInstanceResponse =
      zio.aws.tnb.model.GetSolFunctionInstanceResponse(
        arn,
        id,
        instantiatedVnfInfo.map(value => value.asEditable),
        instantiationState,
        metadata.asEditable,
        nsInstanceId,
        tags.map(value => value),
        vnfPkgId,
        vnfProductName.map(value => value),
        vnfProvider.map(value => value),
        vnfdId,
        vnfdVersion.map(value => value)
      )
    def arn: VnfInstanceArn
    def id: VnfInstanceId
    def instantiatedVnfInfo: Optional[zio.aws.tnb.model.GetSolVnfInfo.ReadOnly]
    def instantiationState: zio.aws.tnb.model.VnfInstantiationState
    def metadata: zio.aws.tnb.model.GetSolFunctionInstanceMetadata.ReadOnly
    def nsInstanceId: NsInstanceId
    def tags: Optional[Map[TagKey, TagValue]]
    def vnfPkgId: VnfPkgId
    def vnfProductName: Optional[String]
    def vnfProvider: Optional[String]
    def vnfdId: VnfdId
    def vnfdVersion: Optional[String]
    def getArn: ZIO[Any, Nothing, VnfInstanceArn] = ZIO.succeed(arn)
    def getId: ZIO[Any, Nothing, VnfInstanceId] = ZIO.succeed(id)
    def getInstantiatedVnfInfo
        : ZIO[Any, AwsError, zio.aws.tnb.model.GetSolVnfInfo.ReadOnly] =
      AwsError.unwrapOptionField("instantiatedVnfInfo", instantiatedVnfInfo)
    def getInstantiationState
        : ZIO[Any, Nothing, zio.aws.tnb.model.VnfInstantiationState] =
      ZIO.succeed(instantiationState)
    def getMetadata: ZIO[
      Any,
      Nothing,
      zio.aws.tnb.model.GetSolFunctionInstanceMetadata.ReadOnly
    ] = ZIO.succeed(metadata)
    def getNsInstanceId: ZIO[Any, Nothing, NsInstanceId] =
      ZIO.succeed(nsInstanceId)
    def getTags: ZIO[Any, AwsError, Map[TagKey, TagValue]] =
      AwsError.unwrapOptionField("tags", tags)
    def getVnfPkgId: ZIO[Any, Nothing, VnfPkgId] = ZIO.succeed(vnfPkgId)
    def getVnfProductName: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("vnfProductName", vnfProductName)
    def getVnfProvider: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("vnfProvider", vnfProvider)
    def getVnfdId: ZIO[Any, Nothing, VnfdId] = ZIO.succeed(vnfdId)
    def getVnfdVersion: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("vnfdVersion", vnfdVersion)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.tnb.model.GetSolFunctionInstanceResponse
  ) extends zio.aws.tnb.model.GetSolFunctionInstanceResponse.ReadOnly {
    override val arn: VnfInstanceArn =
      zio.aws.tnb.model.primitives.VnfInstanceArn(impl.arn())
    override val id: VnfInstanceId =
      zio.aws.tnb.model.primitives.VnfInstanceId(impl.id())
    override val instantiatedVnfInfo
        : Optional[zio.aws.tnb.model.GetSolVnfInfo.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.instantiatedVnfInfo())
        .map(value => zio.aws.tnb.model.GetSolVnfInfo.wrap(value))
    override val instantiationState: zio.aws.tnb.model.VnfInstantiationState =
      zio.aws.tnb.model.VnfInstantiationState.wrap(impl.instantiationState())
    override val metadata
        : zio.aws.tnb.model.GetSolFunctionInstanceMetadata.ReadOnly =
      zio.aws.tnb.model.GetSolFunctionInstanceMetadata.wrap(impl.metadata())
    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 vnfPkgId: VnfPkgId =
      zio.aws.tnb.model.primitives.VnfPkgId(impl.vnfPkgId())
    override val vnfProductName: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.vnfProductName())
      .map(value => value: String)
    override val vnfProvider: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.vnfProvider())
      .map(value => value: String)
    override val vnfdId: VnfdId =
      zio.aws.tnb.model.primitives.VnfdId(impl.vnfdId())
    override val vnfdVersion: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.vnfdVersion())
      .map(value => value: String)
  }
  def wrap(
      impl: software.amazon.awssdk.services.tnb.model.GetSolFunctionInstanceResponse
  ): zio.aws.tnb.model.GetSolFunctionInstanceResponse.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy