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

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

package io.github.vigoo.zioaws.swf.model
import zio.ZIO
import io.github.vigoo.zioaws.swf.model.primitives.EventId
import io.github.vigoo.zioaws.core.{AwsError, BuilderHelper}
import scala.jdk.CollectionConverters._
final case class WorkflowExecutionCancelRequestedEventAttributes(
    externalWorkflowExecution: Option[
      io.github.vigoo.zioaws.swf.model.WorkflowExecution
    ] = None,
    externalInitiatedEventId: Option[EventId] = None,
    cause: Option[
      io.github.vigoo.zioaws.swf.model.WorkflowExecutionCancelRequestedCause
    ] = None
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.swf.model.WorkflowExecutionCancelRequestedEventAttributes = {
    import WorkflowExecutionCancelRequestedEventAttributes.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.swf.model.WorkflowExecutionCancelRequestedEventAttributes
      .builder()
      .optionallyWith(
        externalWorkflowExecution.map(value => value.buildAwsValue())
      )(_.externalWorkflowExecution)
      .optionallyWith(
        externalInitiatedEventId.map(value => value: java.lang.Long)
      )(_.externalInitiatedEventId)
      .optionallyWith(cause.map(value => value.unwrap))(_.cause)
      .build()
  }
  def asReadOnly
      : io.github.vigoo.zioaws.swf.model.WorkflowExecutionCancelRequestedEventAttributes.ReadOnly =
    io.github.vigoo.zioaws.swf.model.WorkflowExecutionCancelRequestedEventAttributes
      .wrap(buildAwsValue())
}
object WorkflowExecutionCancelRequestedEventAttributes {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.swf.model.WorkflowExecutionCancelRequestedEventAttributes
  ] = BuilderHelper.apply
  trait ReadOnly {
    def editable
        : io.github.vigoo.zioaws.swf.model.WorkflowExecutionCancelRequestedEventAttributes =
      io.github.vigoo.zioaws.swf.model
        .WorkflowExecutionCancelRequestedEventAttributes(
          externalWorkflowExecutionValue.map(value => value.editable),
          externalInitiatedEventIdValue.map(value => value),
          causeValue.map(value => value)
        )
    def externalWorkflowExecutionValue
        : Option[io.github.vigoo.zioaws.swf.model.WorkflowExecution.ReadOnly]
    def externalInitiatedEventIdValue: Option[EventId]
    def causeValue: Option[
      io.github.vigoo.zioaws.swf.model.WorkflowExecutionCancelRequestedCause
    ]
    def externalWorkflowExecution: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.swf.model.WorkflowExecution.ReadOnly
    ] = AwsError.unwrapOptionField(
      "externalWorkflowExecution",
      externalWorkflowExecutionValue
    )
    def externalInitiatedEventId: ZIO[Any, AwsError, EventId] =
      AwsError.unwrapOptionField(
        "externalInitiatedEventId",
        externalInitiatedEventIdValue
      )
    def cause: ZIO[
      Any,
      AwsError,
      io.github.vigoo.zioaws.swf.model.WorkflowExecutionCancelRequestedCause
    ] = AwsError.unwrapOptionField("cause", causeValue)
  }
  private class Wrapper(
      impl: software.amazon.awssdk.services.swf.model.WorkflowExecutionCancelRequestedEventAttributes
  ) extends io.github.vigoo.zioaws.swf.model.WorkflowExecutionCancelRequestedEventAttributes.ReadOnly {
    override def externalWorkflowExecutionValue
        : Option[io.github.vigoo.zioaws.swf.model.WorkflowExecution.ReadOnly] =
      scala
        .Option(impl.externalWorkflowExecution())
        .map(value =>
          io.github.vigoo.zioaws.swf.model.WorkflowExecution.wrap(value)
        )
    override def externalInitiatedEventIdValue: Option[EventId] =
      scala.Option(impl.externalInitiatedEventId()).map(value => value: EventId)
    override def causeValue: Option[
      io.github.vigoo.zioaws.swf.model.WorkflowExecutionCancelRequestedCause
    ] = scala
      .Option(impl.cause())
      .map(value =>
        io.github.vigoo.zioaws.swf.model.WorkflowExecutionCancelRequestedCause
          .wrap(value)
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.swf.model.WorkflowExecutionCancelRequestedEventAttributes
  ): io.github.vigoo.zioaws.swf.model.WorkflowExecutionCancelRequestedEventAttributes.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy