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

zio.aws.codecatalyst.model.WorkflowRunSummary.scala Maven / Gradle / Ivy

The newest version!
package zio.aws.codecatalyst.model
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import zio.aws.codecatalyst.model.primitives.{
  SyntheticTimestamp_date_time,
  Uuid
}
import scala.jdk.CollectionConverters.*
final case class WorkflowRunSummary(
    id: Uuid,
    workflowId: Uuid,
    workflowName: String,
    status: zio.aws.codecatalyst.model.WorkflowRunStatus,
    statusReasons: Optional[
      Iterable[zio.aws.codecatalyst.model.WorkflowRunStatusReason]
    ] = Optional.Absent,
    startTime: SyntheticTimestamp_date_time,
    endTime: Optional[SyntheticTimestamp_date_time] = Optional.Absent,
    lastUpdatedTime: SyntheticTimestamp_date_time
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.codecatalyst.model.WorkflowRunSummary = {
    import WorkflowRunSummary.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.codecatalyst.model.WorkflowRunSummary
      .builder()
      .id(Uuid.unwrap(id): java.lang.String)
      .workflowId(Uuid.unwrap(workflowId): java.lang.String)
      .workflowName(workflowName: java.lang.String)
      .status(status.unwrap)
      .optionallyWith(
        statusReasons.map(value =>
          value.map { item =>
            item.buildAwsValue()
          }.asJavaCollection
        )
      )(_.statusReasons)
      .startTime(SyntheticTimestamp_date_time.unwrap(startTime): Instant)
      .optionallyWith(
        endTime.map(value =>
          SyntheticTimestamp_date_time.unwrap(value): Instant
        )
      )(_.endTime)
      .lastUpdatedTime(
        SyntheticTimestamp_date_time.unwrap(lastUpdatedTime): Instant
      )
      .build()
  }
  def asReadOnly: zio.aws.codecatalyst.model.WorkflowRunSummary.ReadOnly =
    zio.aws.codecatalyst.model.WorkflowRunSummary.wrap(buildAwsValue())
}
object WorkflowRunSummary {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.codecatalyst.model.WorkflowRunSummary
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.codecatalyst.model.WorkflowRunSummary =
      zio.aws.codecatalyst.model.WorkflowRunSummary(
        id,
        workflowId,
        workflowName,
        status,
        statusReasons.map(value =>
          value.map { item =>
            item.asEditable
          }
        ),
        startTime,
        endTime.map(value => value),
        lastUpdatedTime
      )
    def id: Uuid
    def workflowId: Uuid
    def workflowName: String
    def status: zio.aws.codecatalyst.model.WorkflowRunStatus
    def statusReasons: Optional[
      List[zio.aws.codecatalyst.model.WorkflowRunStatusReason.ReadOnly]
    ]
    def startTime: SyntheticTimestamp_date_time
    def endTime: Optional[SyntheticTimestamp_date_time]
    def lastUpdatedTime: SyntheticTimestamp_date_time
    def getId: ZIO[Any, Nothing, Uuid] = ZIO.succeed(id)
    def getWorkflowId: ZIO[Any, Nothing, Uuid] = ZIO.succeed(workflowId)
    def getWorkflowName: ZIO[Any, Nothing, String] = ZIO.succeed(workflowName)
    def getStatus
        : ZIO[Any, Nothing, zio.aws.codecatalyst.model.WorkflowRunStatus] =
      ZIO.succeed(status)
    def getStatusReasons: ZIO[Any, AwsError, List[
      zio.aws.codecatalyst.model.WorkflowRunStatusReason.ReadOnly
    ]] = AwsError.unwrapOptionField("statusReasons", statusReasons)
    def getStartTime: ZIO[Any, Nothing, SyntheticTimestamp_date_time] =
      ZIO.succeed(startTime)
    def getEndTime: ZIO[Any, AwsError, SyntheticTimestamp_date_time] =
      AwsError.unwrapOptionField("endTime", endTime)
    def getLastUpdatedTime: ZIO[Any, Nothing, SyntheticTimestamp_date_time] =
      ZIO.succeed(lastUpdatedTime)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.codecatalyst.model.WorkflowRunSummary
  ) extends zio.aws.codecatalyst.model.WorkflowRunSummary.ReadOnly {
    override val id: Uuid =
      zio.aws.codecatalyst.model.primitives.Uuid(impl.id())
    override val workflowId: Uuid =
      zio.aws.codecatalyst.model.primitives.Uuid(impl.workflowId())
    override val workflowName: String = impl.workflowName(): String
    override val status: zio.aws.codecatalyst.model.WorkflowRunStatus =
      zio.aws.codecatalyst.model.WorkflowRunStatus.wrap(impl.status())
    override val statusReasons: Optional[
      List[zio.aws.codecatalyst.model.WorkflowRunStatusReason.ReadOnly]
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.statusReasons())
      .map(value =>
        value.asScala.map { item =>
          zio.aws.codecatalyst.model.WorkflowRunStatusReason.wrap(item)
        }.toList
      )
    override val startTime: SyntheticTimestamp_date_time =
      zio.aws.codecatalyst.model.primitives
        .SyntheticTimestamp_date_time(impl.startTime())
    override val endTime: Optional[SyntheticTimestamp_date_time] =
      zio.aws.core.internal
        .optionalFromNullable(impl.endTime())
        .map(value =>
          zio.aws.codecatalyst.model.primitives
            .SyntheticTimestamp_date_time(value)
        )
    override val lastUpdatedTime: SyntheticTimestamp_date_time =
      zio.aws.codecatalyst.model.primitives
        .SyntheticTimestamp_date_time(impl.lastUpdatedTime())
  }
  def wrap(
      impl: software.amazon.awssdk.services.codecatalyst.model.WorkflowRunSummary
  ): zio.aws.codecatalyst.model.WorkflowRunSummary.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy