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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy