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

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

package io.github.vigoo.zioaws.swf.model
import zio.ZIO
import io.github.vigoo.zioaws.swf.model.primitives.{Data, EventId, WorkflowId}
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters._
final case class StartChildWorkflowExecutionFailedEventAttributes(
    workflowType: io.github.vigoo.zioaws.swf.model.WorkflowType,
    cause: io.github.vigoo.zioaws.swf.model.StartChildWorkflowExecutionFailedCause,
    workflowId: WorkflowId,
    initiatedEventId: EventId,
    decisionTaskCompletedEventId: EventId,
    control: Option[Data] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.swf.model.StartChildWorkflowExecutionFailedEventAttributes = {
    import StartChildWorkflowExecutionFailedEventAttributes.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.swf.model.StartChildWorkflowExecutionFailedEventAttributes
      .builder()
      .workflowType(workflowType.buildAwsValue())
      .cause(cause.unwrap)
      .workflowId(workflowId: java.lang.String)
      .initiatedEventId(initiatedEventId: java.lang.Long)
      .decisionTaskCompletedEventId(
        decisionTaskCompletedEventId: java.lang.Long
      )
      .optionallyWith(control.map(value => value: java.lang.String))(_.control)
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.swf.model.StartChildWorkflowExecutionFailedEventAttributes.ReadOnly =
    io.github.vigoo.zioaws.swf.model.StartChildWorkflowExecutionFailedEventAttributes
      .wrap(buildAwsValue())
}
object StartChildWorkflowExecutionFailedEventAttributes {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.swf.model.StartChildWorkflowExecutionFailedEventAttributes
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable
        : io.github.vigoo.zioaws.swf.model.StartChildWorkflowExecutionFailedEventAttributes =
      io.github.vigoo.zioaws.swf.model
        .StartChildWorkflowExecutionFailedEventAttributes(
          workflowTypeValue.editable,
          causeValue,
          workflowIdValue,
          initiatedEventIdValue,
          decisionTaskCompletedEventIdValue,
          controlValue.map(value => value)
        )
    def workflowTypeValue
        : io.github.vigoo.zioaws.swf.model.WorkflowType.ReadOnly
    def causeValue
        : io.github.vigoo.zioaws.swf.model.StartChildWorkflowExecutionFailedCause
    def workflowIdValue: WorkflowId
    def initiatedEventIdValue: EventId
    def decisionTaskCompletedEventIdValue: EventId
    def controlValue: Option[Data]
    def workflowType: ZIO[
      Any,
      Nothing,
      io.github.vigoo.zioaws.swf.model.WorkflowType.ReadOnly
    ] = ZIO.succeed(workflowTypeValue)
    def cause: ZIO[
      Any,
      Nothing,
      io.github.vigoo.zioaws.swf.model.StartChildWorkflowExecutionFailedCause
    ] = ZIO.succeed(causeValue)
    def workflowId: ZIO[Any, Nothing, WorkflowId] = ZIO.succeed(workflowIdValue)
    def initiatedEventId: ZIO[Any, Nothing, EventId] =
      ZIO.succeed(initiatedEventIdValue)
    def decisionTaskCompletedEventId: ZIO[Any, Nothing, EventId] =
      ZIO.succeed(decisionTaskCompletedEventIdValue)
    def control: ZIO[Any, AwsError, Data] =
      AwsError.unwrapOptionField("control", controlValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.swf.model.StartChildWorkflowExecutionFailedEventAttributes
  ) extends io.github.vigoo.zioaws.swf.model.StartChildWorkflowExecutionFailedEventAttributes.ReadOnly {
    override def workflowTypeValue
        : io.github.vigoo.zioaws.swf.model.WorkflowType.ReadOnly =
      io.github.vigoo.zioaws.swf.model.WorkflowType.wrap(impl.workflowType())
    override def causeValue
        : io.github.vigoo.zioaws.swf.model.StartChildWorkflowExecutionFailedCause =
      io.github.vigoo.zioaws.swf.model.StartChildWorkflowExecutionFailedCause
        .wrap(impl.cause())
    override def workflowIdValue: WorkflowId = impl.workflowId(): WorkflowId
    override def initiatedEventIdValue: EventId =
      impl.initiatedEventId(): EventId
    override def decisionTaskCompletedEventIdValue: EventId =
      impl.decisionTaskCompletedEventId(): EventId
    override def controlValue: Option[Data] =
      scala.Option(impl.control()).map(value => value: Data)
  }
  def wrap(
      impl: software.amazon.awssdk.services.swf.model.StartChildWorkflowExecutionFailedEventAttributes
  ): io.github.vigoo.zioaws.swf.model.StartChildWorkflowExecutionFailedEventAttributes.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy