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

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

package io.github.vigoo.zioaws.swf.model
import zio.ZIO
import io.github.vigoo.zioaws.swf.model.primitives.{
  EventId,
  Data,
  FailureReason
}
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters._
final case class ChildWorkflowExecutionFailedEventAttributes(
    workflowExecution: io.github.vigoo.zioaws.swf.model.WorkflowExecution,
    workflowType: io.github.vigoo.zioaws.swf.model.WorkflowType,
    reason: Option[FailureReason] = None,
    details: Option[Data] = None,
    initiatedEventId: EventId,
    startedEventId: EventId
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.swf.model.ChildWorkflowExecutionFailedEventAttributes = {
    import ChildWorkflowExecutionFailedEventAttributes.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.swf.model.ChildWorkflowExecutionFailedEventAttributes
      .builder()
      .workflowExecution(workflowExecution.buildAwsValue())
      .workflowType(workflowType.buildAwsValue())
      .optionallyWith(reason.map(value => value: java.lang.String))(_.reason)
      .optionallyWith(details.map(value => value: java.lang.String))(_.details)
      .initiatedEventId(initiatedEventId: java.lang.Long)
      .startedEventId(startedEventId: java.lang.Long)
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.swf.model.ChildWorkflowExecutionFailedEventAttributes.ReadOnly =
    io.github.vigoo.zioaws.swf.model.ChildWorkflowExecutionFailedEventAttributes
      .wrap(buildAwsValue())
}
object ChildWorkflowExecutionFailedEventAttributes {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.swf.model.ChildWorkflowExecutionFailedEventAttributes
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable
        : io.github.vigoo.zioaws.swf.model.ChildWorkflowExecutionFailedEventAttributes =
      io.github.vigoo.zioaws.swf.model
        .ChildWorkflowExecutionFailedEventAttributes(
          workflowExecutionValue.editable,
          workflowTypeValue.editable,
          reasonValue.map(value => value),
          detailsValue.map(value => value),
          initiatedEventIdValue,
          startedEventIdValue
        )
    def workflowExecutionValue
        : io.github.vigoo.zioaws.swf.model.WorkflowExecution.ReadOnly
    def workflowTypeValue
        : io.github.vigoo.zioaws.swf.model.WorkflowType.ReadOnly
    def reasonValue: Option[FailureReason]
    def detailsValue: Option[Data]
    def initiatedEventIdValue: EventId
    def startedEventIdValue: EventId
    def workflowExecution: ZIO[
      Any,
      Nothing,
      io.github.vigoo.zioaws.swf.model.WorkflowExecution.ReadOnly
    ] = ZIO.succeed(workflowExecutionValue)
    def workflowType: ZIO[
      Any,
      Nothing,
      io.github.vigoo.zioaws.swf.model.WorkflowType.ReadOnly
    ] = ZIO.succeed(workflowTypeValue)
    def reason: ZIO[Any, AwsError, FailureReason] =
      AwsError.unwrapOptionField("reason", reasonValue)
    def details: ZIO[Any, AwsError, Data] =
      AwsError.unwrapOptionField("details", detailsValue)
    def initiatedEventId: ZIO[Any, Nothing, EventId] =
      ZIO.succeed(initiatedEventIdValue)
    def startedEventId: ZIO[Any, Nothing, EventId] =
      ZIO.succeed(startedEventIdValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.swf.model.ChildWorkflowExecutionFailedEventAttributes
  ) extends io.github.vigoo.zioaws.swf.model.ChildWorkflowExecutionFailedEventAttributes.ReadOnly {
    override def workflowExecutionValue
        : io.github.vigoo.zioaws.swf.model.WorkflowExecution.ReadOnly =
      io.github.vigoo.zioaws.swf.model.WorkflowExecution
        .wrap(impl.workflowExecution())
    override def workflowTypeValue
        : io.github.vigoo.zioaws.swf.model.WorkflowType.ReadOnly =
      io.github.vigoo.zioaws.swf.model.WorkflowType.wrap(impl.workflowType())
    override def reasonValue: Option[FailureReason] =
      scala.Option(impl.reason()).map(value => value: FailureReason)
    override def detailsValue: Option[Data] =
      scala.Option(impl.details()).map(value => value: Data)
    override def initiatedEventIdValue: EventId =
      impl.initiatedEventId(): EventId
    override def startedEventIdValue: EventId = impl.startedEventId(): EventId
  }
  def wrap(
      impl: software.amazon.awssdk.services.swf.model.ChildWorkflowExecutionFailedEventAttributes
  ): io.github.vigoo.zioaws.swf.model.ChildWorkflowExecutionFailedEventAttributes.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy