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

io.github.vigoo.zioaws.swf.model.DescribeWorkflowExecutionResponse.scala Maven / Gradle / Ivy

package io.github.vigoo.zioaws.swf.model
import zio.ZIO
import io.github.vigoo.zioaws.swf.model.primitives.{Data, Timestamp}
import java.time.Instant
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters._
final case class DescribeWorkflowExecutionResponse(
    executionInfo: io.github.vigoo.zioaws.swf.model.WorkflowExecutionInfo,
    executionConfiguration: io.github.vigoo.zioaws.swf.model.WorkflowExecutionConfiguration,
    openCounts: io.github.vigoo.zioaws.swf.model.WorkflowExecutionOpenCounts,
    latestActivityTaskTimestamp: Option[Timestamp] = None,
    latestExecutionContext: Option[Data] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.swf.model.DescribeWorkflowExecutionResponse = {
    import DescribeWorkflowExecutionResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.swf.model.DescribeWorkflowExecutionResponse
      .builder()
      .executionInfo(executionInfo.buildAwsValue())
      .executionConfiguration(executionConfiguration.buildAwsValue())
      .openCounts(openCounts.buildAwsValue())
      .optionallyWith(latestActivityTaskTimestamp.map(value => value: Instant))(
        _.latestActivityTaskTimestamp
      )
      .optionallyWith(
        latestExecutionContext.map(value => value: java.lang.String)
      )(_.latestExecutionContext)
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.swf.model.DescribeWorkflowExecutionResponse.ReadOnly =
    io.github.vigoo.zioaws.swf.model.DescribeWorkflowExecutionResponse
      .wrap(buildAwsValue())
}
object DescribeWorkflowExecutionResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.swf.model.DescribeWorkflowExecutionResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable
        : io.github.vigoo.zioaws.swf.model.DescribeWorkflowExecutionResponse =
      io.github.vigoo.zioaws.swf.model.DescribeWorkflowExecutionResponse(
        executionInfoValue.editable,
        executionConfigurationValue.editable,
        openCountsValue.editable,
        latestActivityTaskTimestampValue.map(value => value),
        latestExecutionContextValue.map(value => value)
      )
    def executionInfoValue
        : io.github.vigoo.zioaws.swf.model.WorkflowExecutionInfo.ReadOnly
    def executionConfigurationValue
        : io.github.vigoo.zioaws.swf.model.WorkflowExecutionConfiguration.ReadOnly
    def openCountsValue
        : io.github.vigoo.zioaws.swf.model.WorkflowExecutionOpenCounts.ReadOnly
    def latestActivityTaskTimestampValue: Option[Timestamp]
    def latestExecutionContextValue: Option[Data]
    def executionInfo: ZIO[
      Any,
      Nothing,
      io.github.vigoo.zioaws.swf.model.WorkflowExecutionInfo.ReadOnly
    ] = ZIO.succeed(executionInfoValue)
    def executionConfiguration: ZIO[
      Any,
      Nothing,
      io.github.vigoo.zioaws.swf.model.WorkflowExecutionConfiguration.ReadOnly
    ] = ZIO.succeed(executionConfigurationValue)
    def openCounts: ZIO[
      Any,
      Nothing,
      io.github.vigoo.zioaws.swf.model.WorkflowExecutionOpenCounts.ReadOnly
    ] = ZIO.succeed(openCountsValue)
    def latestActivityTaskTimestamp: ZIO[Any, AwsError, Timestamp] =
      AwsError.unwrapOptionField(
        "latestActivityTaskTimestamp",
        latestActivityTaskTimestampValue
      )
    def latestExecutionContext: ZIO[Any, AwsError, Data] = AwsError
      .unwrapOptionField("latestExecutionContext", latestExecutionContextValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.swf.model.DescribeWorkflowExecutionResponse
  ) extends io.github.vigoo.zioaws.swf.model.DescribeWorkflowExecutionResponse.ReadOnly {
    override def executionInfoValue
        : io.github.vigoo.zioaws.swf.model.WorkflowExecutionInfo.ReadOnly =
      io.github.vigoo.zioaws.swf.model.WorkflowExecutionInfo
        .wrap(impl.executionInfo())
    override def executionConfigurationValue
        : io.github.vigoo.zioaws.swf.model.WorkflowExecutionConfiguration.ReadOnly =
      io.github.vigoo.zioaws.swf.model.WorkflowExecutionConfiguration
        .wrap(impl.executionConfiguration())
    override def openCountsValue
        : io.github.vigoo.zioaws.swf.model.WorkflowExecutionOpenCounts.ReadOnly =
      io.github.vigoo.zioaws.swf.model.WorkflowExecutionOpenCounts
        .wrap(impl.openCounts())
    override def latestActivityTaskTimestampValue: Option[Timestamp] = scala
      .Option(impl.latestActivityTaskTimestamp())
      .map(value => value: Timestamp)
    override def latestExecutionContextValue: Option[Data] =
      scala.Option(impl.latestExecutionContext()).map(value => value: Data)
  }
  def wrap(
      impl: software.amazon.awssdk.services.swf.model.DescribeWorkflowExecutionResponse
  ): io.github.vigoo.zioaws.swf.model.DescribeWorkflowExecutionResponse.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy