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

zio.aws.tnb.model.GetSolFunctionPackageResponse.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, VnfPkgId, VnfPkgArn}
import scala.jdk.CollectionConverters.*
final case class GetSolFunctionPackageResponse(
    arn: VnfPkgArn,
    id: VnfPkgId,
    metadata: Optional[zio.aws.tnb.model.GetSolFunctionPackageMetadata] =
      Optional.Absent,
    onboardingState: zio.aws.tnb.model.OnboardingState,
    operationalState: zio.aws.tnb.model.OperationalState,
    tags: Optional[Map[TagKey, TagValue]] = Optional.Absent,
    usageState: zio.aws.tnb.model.UsageState,
    vnfProductName: Optional[String] = Optional.Absent,
    vnfProvider: Optional[String] = Optional.Absent,
    vnfdId: Optional[String] = Optional.Absent,
    vnfdVersion: Optional[String] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.tnb.model.GetSolFunctionPackageResponse = {
    import GetSolFunctionPackageResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.tnb.model.GetSolFunctionPackageResponse
      .builder()
      .arn(VnfPkgArn.unwrap(arn): java.lang.String)
      .id(VnfPkgId.unwrap(id): java.lang.String)
      .optionallyWith(metadata.map(value => value.buildAwsValue()))(_.metadata)
      .onboardingState(onboardingState.unwrap)
      .operationalState(operationalState.unwrap)
      .optionallyWith(
        tags.map(value =>
          value
            .map({ case (key, value) =>
              (TagKey.unwrap(key): java.lang.String) -> (TagValue.unwrap(
                value
              ): java.lang.String)
            })
            .asJava
        )
      )(_.tags)
      .usageState(usageState.unwrap)
      .optionallyWith(vnfProductName.map(value => value: java.lang.String))(
        _.vnfProductName
      )
      .optionallyWith(vnfProvider.map(value => value: java.lang.String))(
        _.vnfProvider
      )
      .optionallyWith(vnfdId.map(value => value: java.lang.String))(_.vnfdId)
      .optionallyWith(vnfdVersion.map(value => value: java.lang.String))(
        _.vnfdVersion
      )
      .build()
  }
  def asReadOnly: zio.aws.tnb.model.GetSolFunctionPackageResponse.ReadOnly =
    zio.aws.tnb.model.GetSolFunctionPackageResponse.wrap(buildAwsValue())
}
object GetSolFunctionPackageResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.tnb.model.GetSolFunctionPackageResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.tnb.model.GetSolFunctionPackageResponse =
      zio.aws.tnb.model.GetSolFunctionPackageResponse(
        arn,
        id,
        metadata.map(value => value.asEditable),
        onboardingState,
        operationalState,
        tags.map(value => value),
        usageState,
        vnfProductName.map(value => value),
        vnfProvider.map(value => value),
        vnfdId.map(value => value),
        vnfdVersion.map(value => value)
      )
    def arn: VnfPkgArn
    def id: VnfPkgId
    def metadata
        : Optional[zio.aws.tnb.model.GetSolFunctionPackageMetadata.ReadOnly]
    def onboardingState: zio.aws.tnb.model.OnboardingState
    def operationalState: zio.aws.tnb.model.OperationalState
    def tags: Optional[Map[TagKey, TagValue]]
    def usageState: zio.aws.tnb.model.UsageState
    def vnfProductName: Optional[String]
    def vnfProvider: Optional[String]
    def vnfdId: Optional[String]
    def vnfdVersion: Optional[String]
    def getArn: ZIO[Any, Nothing, VnfPkgArn] = ZIO.succeed(arn)
    def getId: ZIO[Any, Nothing, VnfPkgId] = ZIO.succeed(id)
    def getMetadata: ZIO[
      Any,
      AwsError,
      zio.aws.tnb.model.GetSolFunctionPackageMetadata.ReadOnly
    ] = AwsError.unwrapOptionField("metadata", metadata)
    def getOnboardingState
        : ZIO[Any, Nothing, zio.aws.tnb.model.OnboardingState] =
      ZIO.succeed(onboardingState)
    def getOperationalState
        : ZIO[Any, Nothing, zio.aws.tnb.model.OperationalState] =
      ZIO.succeed(operationalState)
    def getTags: ZIO[Any, AwsError, Map[TagKey, TagValue]] =
      AwsError.unwrapOptionField("tags", tags)
    def getUsageState: ZIO[Any, Nothing, zio.aws.tnb.model.UsageState] =
      ZIO.succeed(usageState)
    def getVnfProductName: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("vnfProductName", vnfProductName)
    def getVnfProvider: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("vnfProvider", vnfProvider)
    def getVnfdId: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("vnfdId", vnfdId)
    def getVnfdVersion: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("vnfdVersion", vnfdVersion)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.tnb.model.GetSolFunctionPackageResponse
  ) extends zio.aws.tnb.model.GetSolFunctionPackageResponse.ReadOnly {
    override val arn: VnfPkgArn =
      zio.aws.tnb.model.primitives.VnfPkgArn(impl.arn())
    override val id: VnfPkgId = zio.aws.tnb.model.primitives.VnfPkgId(impl.id())
    override val metadata
        : Optional[zio.aws.tnb.model.GetSolFunctionPackageMetadata.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.metadata())
        .map(value =>
          zio.aws.tnb.model.GetSolFunctionPackageMetadata.wrap(value)
        )
    override val onboardingState: zio.aws.tnb.model.OnboardingState =
      zio.aws.tnb.model.OnboardingState.wrap(impl.onboardingState())
    override val operationalState: zio.aws.tnb.model.OperationalState =
      zio.aws.tnb.model.OperationalState.wrap(impl.operationalState())
    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 usageState: zio.aws.tnb.model.UsageState =
      zio.aws.tnb.model.UsageState.wrap(impl.usageState())
    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: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.vnfdId())
      .map(value => value: String)
    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.GetSolFunctionPackageResponse
  ): zio.aws.tnb.model.GetSolFunctionPackageResponse.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy