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

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

package io.github.vigoo.zioaws.swf.model
import java.lang.Integer
import zio.ZIO
import io.github.vigoo.zioaws.swf.model.primitives.{
  OpenDecisionTasksCount,
  Count
}
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters._
final case class WorkflowExecutionOpenCounts(
    openActivityTasks: Count,
    openDecisionTasks: OpenDecisionTasksCount,
    openTimers: Count,
    openChildWorkflowExecutions: Count,
    openLambdaFunctions: Option[Count] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.swf.model.WorkflowExecutionOpenCounts = {
    import WorkflowExecutionOpenCounts.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.swf.model.WorkflowExecutionOpenCounts
      .builder()
      .openActivityTasks(openActivityTasks: Integer)
      .openDecisionTasks(openDecisionTasks: Integer)
      .openTimers(openTimers: Integer)
      .openChildWorkflowExecutions(openChildWorkflowExecutions: Integer)
      .optionallyWith(openLambdaFunctions.map(value => value: Integer))(
        _.openLambdaFunctions
      )
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.swf.model.WorkflowExecutionOpenCounts.ReadOnly =
    io.github.vigoo.zioaws.swf.model.WorkflowExecutionOpenCounts
      .wrap(buildAwsValue())
}
object WorkflowExecutionOpenCounts {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.swf.model.WorkflowExecutionOpenCounts
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable: io.github.vigoo.zioaws.swf.model.WorkflowExecutionOpenCounts =
      io.github.vigoo.zioaws.swf.model.WorkflowExecutionOpenCounts(
        openActivityTasksValue,
        openDecisionTasksValue,
        openTimersValue,
        openChildWorkflowExecutionsValue,
        openLambdaFunctionsValue.map(value => value)
      )
    def openActivityTasksValue: Count
    def openDecisionTasksValue: OpenDecisionTasksCount
    def openTimersValue: Count
    def openChildWorkflowExecutionsValue: Count
    def openLambdaFunctionsValue: Option[Count]
    def openActivityTasks: ZIO[Any, Nothing, Count] =
      ZIO.succeed(openActivityTasksValue)
    def openDecisionTasks: ZIO[Any, Nothing, OpenDecisionTasksCount] =
      ZIO.succeed(openDecisionTasksValue)
    def openTimers: ZIO[Any, Nothing, Count] = ZIO.succeed(openTimersValue)
    def openChildWorkflowExecutions: ZIO[Any, Nothing, Count] =
      ZIO.succeed(openChildWorkflowExecutionsValue)
    def openLambdaFunctions: ZIO[Any, AwsError, Count] = AwsError
      .unwrapOptionField("openLambdaFunctions", openLambdaFunctionsValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.swf.model.WorkflowExecutionOpenCounts
  ) extends io.github.vigoo.zioaws.swf.model.WorkflowExecutionOpenCounts.ReadOnly {
    override def openActivityTasksValue: Count = impl.openActivityTasks(): Count
    override def openDecisionTasksValue: OpenDecisionTasksCount =
      impl.openDecisionTasks(): OpenDecisionTasksCount
    override def openTimersValue: Count = impl.openTimers(): Count
    override def openChildWorkflowExecutionsValue: Count =
      impl.openChildWorkflowExecutions(): Count
    override def openLambdaFunctionsValue: Option[Count] =
      scala.Option(impl.openLambdaFunctions()).map(value => value: Count)
  }
  def wrap(
      impl: software.amazon.awssdk.services.swf.model.WorkflowExecutionOpenCounts
  ): io.github.vigoo.zioaws.swf.model.WorkflowExecutionOpenCounts.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy