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

io.github.vigoo.zioaws.swf.model.WorkflowExecutionFailedEventAttributes.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 WorkflowExecutionFailedEventAttributes(
    reason: Option[FailureReason] = None,
    details: Option[Data] = None,
    decisionTaskCompletedEventId: EventId
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.swf.model.WorkflowExecutionFailedEventAttributes = {
    import WorkflowExecutionFailedEventAttributes.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.swf.model.WorkflowExecutionFailedEventAttributes
      .builder()
      .optionallyWith(reason.map(value => value: java.lang.String))(_.reason)
      .optionallyWith(details.map(value => value: java.lang.String))(_.details)
      .decisionTaskCompletedEventId(
        decisionTaskCompletedEventId: java.lang.Long
      )
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.swf.model.WorkflowExecutionFailedEventAttributes.ReadOnly =
    io.github.vigoo.zioaws.swf.model.WorkflowExecutionFailedEventAttributes
      .wrap(buildAwsValue())
}
object WorkflowExecutionFailedEventAttributes {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.swf.model.WorkflowExecutionFailedEventAttributes
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable
        : io.github.vigoo.zioaws.swf.model.WorkflowExecutionFailedEventAttributes =
      io.github.vigoo.zioaws.swf.model.WorkflowExecutionFailedEventAttributes(
        reasonValue.map(value => value),
        detailsValue.map(value => value),
        decisionTaskCompletedEventIdValue
      )
    def reasonValue: Option[FailureReason]
    def detailsValue: Option[Data]
    def decisionTaskCompletedEventIdValue: EventId
    def reason: ZIO[Any, AwsError, FailureReason] =
      AwsError.unwrapOptionField("reason", reasonValue)
    def details: ZIO[Any, AwsError, Data] =
      AwsError.unwrapOptionField("details", detailsValue)
    def decisionTaskCompletedEventId: ZIO[Any, Nothing, EventId] =
      ZIO.succeed(decisionTaskCompletedEventIdValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.swf.model.WorkflowExecutionFailedEventAttributes
  ) extends io.github.vigoo.zioaws.swf.model.WorkflowExecutionFailedEventAttributes.ReadOnly {
    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 decisionTaskCompletedEventIdValue: EventId =
      impl.decisionTaskCompletedEventId(): EventId
  }
  def wrap(
      impl: software.amazon.awssdk.services.swf.model.WorkflowExecutionFailedEventAttributes
  ): io.github.vigoo.zioaws.swf.model.WorkflowExecutionFailedEventAttributes.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy