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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy