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

zio.aws.tnb.model.GetSolNetworkOperationResponse.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.{
  NsLcmOpOccArn,
  TagValue,
  NsInstanceId,
  NsLcmOpOccId,
  TagKey
}
import scala.jdk.CollectionConverters.*
final case class GetSolNetworkOperationResponse(
    arn: NsLcmOpOccArn,
    error: Optional[zio.aws.tnb.model.ProblemDetails] = Optional.Absent,
    id: Optional[NsLcmOpOccId] = Optional.Absent,
    lcmOperationType: Optional[zio.aws.tnb.model.LcmOperationType] =
      Optional.Absent,
    metadata: Optional[zio.aws.tnb.model.GetSolNetworkOperationMetadata] =
      Optional.Absent,
    nsInstanceId: Optional[NsInstanceId] = Optional.Absent,
    operationState: Optional[zio.aws.tnb.model.NsLcmOperationState] =
      Optional.Absent,
    tags: Optional[Map[TagKey, TagValue]] = Optional.Absent,
    tasks: Optional[
      Iterable[zio.aws.tnb.model.GetSolNetworkOperationTaskDetails]
    ] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.tnb.model.GetSolNetworkOperationResponse = {
    import GetSolNetworkOperationResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.tnb.model.GetSolNetworkOperationResponse
      .builder()
      .arn(NsLcmOpOccArn.unwrap(arn): java.lang.String)
      .optionallyWith(error.map(value => value.buildAwsValue()))(_.error)
      .optionallyWith(
        id.map(value => NsLcmOpOccId.unwrap(value): java.lang.String)
      )(_.id)
      .optionallyWith(lcmOperationType.map(value => value.unwrap))(
        _.lcmOperationType
      )
      .optionallyWith(metadata.map(value => value.buildAwsValue()))(_.metadata)
      .optionallyWith(
        nsInstanceId.map(value => NsInstanceId.unwrap(value): java.lang.String)
      )(_.nsInstanceId)
      .optionallyWith(operationState.map(value => value.unwrap))(
        _.operationState
      )
      .optionallyWith(
        tags.map(value =>
          value
            .map({ case (key, value) =>
              (TagKey.unwrap(key): java.lang.String) -> (TagValue
                .unwrap(value): java.lang.String)
            })
            .asJava
        )
      )(_.tags)
      .optionallyWith(
        tasks.map(value =>
          value.map { item =>
            item.buildAwsValue()
          }.asJavaCollection
        )
      )(_.tasks)
      .build()
  }
  def asReadOnly: zio.aws.tnb.model.GetSolNetworkOperationResponse.ReadOnly =
    zio.aws.tnb.model.GetSolNetworkOperationResponse.wrap(buildAwsValue())
}
object GetSolNetworkOperationResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.tnb.model.GetSolNetworkOperationResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.tnb.model.GetSolNetworkOperationResponse =
      zio.aws.tnb.model.GetSolNetworkOperationResponse(
        arn,
        error.map(value => value.asEditable),
        id.map(value => value),
        lcmOperationType.map(value => value),
        metadata.map(value => value.asEditable),
        nsInstanceId.map(value => value),
        operationState.map(value => value),
        tags.map(value => value),
        tasks.map(value =>
          value.map { item =>
            item.asEditable
          }
        )
      )
    def arn: NsLcmOpOccArn
    def error: Optional[zio.aws.tnb.model.ProblemDetails.ReadOnly]
    def id: Optional[NsLcmOpOccId]
    def lcmOperationType: Optional[zio.aws.tnb.model.LcmOperationType]
    def metadata
        : Optional[zio.aws.tnb.model.GetSolNetworkOperationMetadata.ReadOnly]
    def nsInstanceId: Optional[NsInstanceId]
    def operationState: Optional[zio.aws.tnb.model.NsLcmOperationState]
    def tags: Optional[Map[TagKey, TagValue]]
    def tasks: Optional[
      List[zio.aws.tnb.model.GetSolNetworkOperationTaskDetails.ReadOnly]
    ]
    def getArn: ZIO[Any, Nothing, NsLcmOpOccArn] = ZIO.succeed(arn)
    def getError
        : ZIO[Any, AwsError, zio.aws.tnb.model.ProblemDetails.ReadOnly] =
      AwsError.unwrapOptionField("error", error)
    def getId: ZIO[Any, AwsError, NsLcmOpOccId] =
      AwsError.unwrapOptionField("id", id)
    def getLcmOperationType
        : ZIO[Any, AwsError, zio.aws.tnb.model.LcmOperationType] =
      AwsError.unwrapOptionField("lcmOperationType", lcmOperationType)
    def getMetadata: ZIO[
      Any,
      AwsError,
      zio.aws.tnb.model.GetSolNetworkOperationMetadata.ReadOnly
    ] = AwsError.unwrapOptionField("metadata", metadata)
    def getNsInstanceId: ZIO[Any, AwsError, NsInstanceId] =
      AwsError.unwrapOptionField("nsInstanceId", nsInstanceId)
    def getOperationState
        : ZIO[Any, AwsError, zio.aws.tnb.model.NsLcmOperationState] =
      AwsError.unwrapOptionField("operationState", operationState)
    def getTags: ZIO[Any, AwsError, Map[TagKey, TagValue]] =
      AwsError.unwrapOptionField("tags", tags)
    def getTasks: ZIO[Any, AwsError, List[
      zio.aws.tnb.model.GetSolNetworkOperationTaskDetails.ReadOnly
    ]] = AwsError.unwrapOptionField("tasks", tasks)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.tnb.model.GetSolNetworkOperationResponse
  ) extends zio.aws.tnb.model.GetSolNetworkOperationResponse.ReadOnly {
    override val arn: NsLcmOpOccArn =
      zio.aws.tnb.model.primitives.NsLcmOpOccArn(impl.arn())
    override val error: Optional[zio.aws.tnb.model.ProblemDetails.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.error())
        .map(value => zio.aws.tnb.model.ProblemDetails.wrap(value))
    override val id: Optional[NsLcmOpOccId] = zio.aws.core.internal
      .optionalFromNullable(impl.id())
      .map(value => zio.aws.tnb.model.primitives.NsLcmOpOccId(value))
    override val lcmOperationType
        : Optional[zio.aws.tnb.model.LcmOperationType] = zio.aws.core.internal
      .optionalFromNullable(impl.lcmOperationType())
      .map(value => zio.aws.tnb.model.LcmOperationType.wrap(value))
    override val metadata
        : Optional[zio.aws.tnb.model.GetSolNetworkOperationMetadata.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.metadata())
        .map(value =>
          zio.aws.tnb.model.GetSolNetworkOperationMetadata.wrap(value)
        )
    override val nsInstanceId: Optional[NsInstanceId] = zio.aws.core.internal
      .optionalFromNullable(impl.nsInstanceId())
      .map(value => zio.aws.tnb.model.primitives.NsInstanceId(value))
    override val operationState
        : Optional[zio.aws.tnb.model.NsLcmOperationState] =
      zio.aws.core.internal
        .optionalFromNullable(impl.operationState())
        .map(value => zio.aws.tnb.model.NsLcmOperationState.wrap(value))
    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 tasks: Optional[
      List[zio.aws.tnb.model.GetSolNetworkOperationTaskDetails.ReadOnly]
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.tasks())
      .map(value =>
        value.asScala.map { item =>
          zio.aws.tnb.model.GetSolNetworkOperationTaskDetails.wrap(item)
        }.toList
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.tnb.model.GetSolNetworkOperationResponse
  ): zio.aws.tnb.model.GetSolNetworkOperationResponse.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy