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

io.github.vigoo.zioaws.swf.model.ChildWorkflowExecutionCompletedEventAttributes.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 ChildWorkflowExecutionCompletedEventAttributes(
    workflowExecution: io.github.vigoo.zioaws.swf.model.WorkflowExecution,
    workflowType: io.github.vigoo.zioaws.swf.model.WorkflowType,
    result: Option[Data] = None,
    initiatedEventId: EventId,
    startedEventId: EventId
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.swf.model.ChildWorkflowExecutionCompletedEventAttributes = {
    import ChildWorkflowExecutionCompletedEventAttributes.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.swf.model.ChildWorkflowExecutionCompletedEventAttributes
      .builder()
      .workflowExecution(workflowExecution.buildAwsValue())
      .workflowType(workflowType.buildAwsValue())
      .optionallyWith(result.map(value => value: java.lang.String))(_.result)
      .initiatedEventId(initiatedEventId: java.lang.Long)
      .startedEventId(startedEventId: java.lang.Long)
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.swf.model.ChildWorkflowExecutionCompletedEventAttributes.ReadOnly =
    io.github.vigoo.zioaws.swf.model.ChildWorkflowExecutionCompletedEventAttributes
      .wrap(buildAwsValue())
}
object ChildWorkflowExecutionCompletedEventAttributes {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.swf.model.ChildWorkflowExecutionCompletedEventAttributes
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable
        : io.github.vigoo.zioaws.swf.model.ChildWorkflowExecutionCompletedEventAttributes =
      io.github.vigoo.zioaws.swf.model
        .ChildWorkflowExecutionCompletedEventAttributes(
          workflowExecutionValue.editable,
          workflowTypeValue.editable,
          resultValue.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 resultValue: 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 result: ZIO[Any, AwsError, Data] =
      AwsError.unwrapOptionField("result", resultValue)
    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.ChildWorkflowExecutionCompletedEventAttributes
  ) extends io.github.vigoo.zioaws.swf.model.ChildWorkflowExecutionCompletedEventAttributes.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 resultValue: Option[Data] =
      scala.Option(impl.result()).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.ChildWorkflowExecutionCompletedEventAttributes
  ): io.github.vigoo.zioaws.swf.model.ChildWorkflowExecutionCompletedEventAttributes.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy