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

zio.aws.codecatalyst.model.GetWorkflowResponse.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.{
  SourceRepositoryBranchString,
  SourceRepositoryNameString,
  SyntheticTimestamp_date_time,
  Uuid,
  NameString
}
import scala.jdk.CollectionConverters.*
final case class GetWorkflowResponse(
    spaceName: NameString,
    projectName: NameString,
    id: Uuid,
    name: String,
    sourceRepositoryName: Optional[SourceRepositoryNameString] =
      Optional.Absent,
    sourceBranchName: Optional[SourceRepositoryBranchString] = Optional.Absent,
    definition: zio.aws.codecatalyst.model.WorkflowDefinition,
    createdTime: SyntheticTimestamp_date_time,
    lastUpdatedTime: SyntheticTimestamp_date_time,
    runMode: zio.aws.codecatalyst.model.WorkflowRunMode,
    status: zio.aws.codecatalyst.model.WorkflowStatus
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.codecatalyst.model.GetWorkflowResponse = {
    import GetWorkflowResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.codecatalyst.model.GetWorkflowResponse
      .builder()
      .spaceName(NameString.unwrap(spaceName): java.lang.String)
      .projectName(NameString.unwrap(projectName): java.lang.String)
      .id(Uuid.unwrap(id): java.lang.String)
      .name(name: java.lang.String)
      .optionallyWith(
        sourceRepositoryName.map(value =>
          SourceRepositoryNameString.unwrap(value): java.lang.String
        )
      )(_.sourceRepositoryName)
      .optionallyWith(
        sourceBranchName.map(value =>
          SourceRepositoryBranchString.unwrap(value): java.lang.String
        )
      )(_.sourceBranchName)
      .definition(definition.buildAwsValue())
      .createdTime(SyntheticTimestamp_date_time.unwrap(createdTime): Instant)
      .lastUpdatedTime(
        SyntheticTimestamp_date_time.unwrap(lastUpdatedTime): Instant
      )
      .runMode(runMode.unwrap)
      .status(status.unwrap)
      .build()
  }
  def asReadOnly: zio.aws.codecatalyst.model.GetWorkflowResponse.ReadOnly =
    zio.aws.codecatalyst.model.GetWorkflowResponse.wrap(buildAwsValue())
}
object GetWorkflowResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.codecatalyst.model.GetWorkflowResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.codecatalyst.model.GetWorkflowResponse =
      zio.aws.codecatalyst.model.GetWorkflowResponse(
        spaceName,
        projectName,
        id,
        name,
        sourceRepositoryName.map(value => value),
        sourceBranchName.map(value => value),
        definition.asEditable,
        createdTime,
        lastUpdatedTime,
        runMode,
        status
      )
    def spaceName: NameString
    def projectName: NameString
    def id: Uuid
    def name: String
    def sourceRepositoryName: Optional[SourceRepositoryNameString]
    def sourceBranchName: Optional[SourceRepositoryBranchString]
    def definition: zio.aws.codecatalyst.model.WorkflowDefinition.ReadOnly
    def createdTime: SyntheticTimestamp_date_time
    def lastUpdatedTime: SyntheticTimestamp_date_time
    def runMode: zio.aws.codecatalyst.model.WorkflowRunMode
    def status: zio.aws.codecatalyst.model.WorkflowStatus
    def getSpaceName: ZIO[Any, Nothing, NameString] = ZIO.succeed(spaceName)
    def getProjectName: ZIO[Any, Nothing, NameString] = ZIO.succeed(projectName)
    def getId: ZIO[Any, Nothing, Uuid] = ZIO.succeed(id)
    def getName: ZIO[Any, Nothing, String] = ZIO.succeed(name)
    def getSourceRepositoryName
        : ZIO[Any, AwsError, SourceRepositoryNameString] =
      AwsError.unwrapOptionField("sourceRepositoryName", sourceRepositoryName)
    def getSourceBranchName: ZIO[Any, AwsError, SourceRepositoryBranchString] =
      AwsError.unwrapOptionField("sourceBranchName", sourceBranchName)
    def getDefinition: ZIO[
      Any,
      Nothing,
      zio.aws.codecatalyst.model.WorkflowDefinition.ReadOnly
    ] = ZIO.succeed(definition)
    def getCreatedTime: ZIO[Any, Nothing, SyntheticTimestamp_date_time] =
      ZIO.succeed(createdTime)
    def getLastUpdatedTime: ZIO[Any, Nothing, SyntheticTimestamp_date_time] =
      ZIO.succeed(lastUpdatedTime)
    def getRunMode
        : ZIO[Any, Nothing, zio.aws.codecatalyst.model.WorkflowRunMode] =
      ZIO.succeed(runMode)
    def getStatus
        : ZIO[Any, Nothing, zio.aws.codecatalyst.model.WorkflowStatus] =
      ZIO.succeed(status)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.codecatalyst.model.GetWorkflowResponse
  ) extends zio.aws.codecatalyst.model.GetWorkflowResponse.ReadOnly {
    override val spaceName: NameString =
      zio.aws.codecatalyst.model.primitives.NameString(impl.spaceName())
    override val projectName: NameString =
      zio.aws.codecatalyst.model.primitives.NameString(impl.projectName())
    override val id: Uuid =
      zio.aws.codecatalyst.model.primitives.Uuid(impl.id())
    override val name: String = impl.name(): String
    override val sourceRepositoryName: Optional[SourceRepositoryNameString] =
      zio.aws.core.internal
        .optionalFromNullable(impl.sourceRepositoryName())
        .map(value =>
          zio.aws.codecatalyst.model.primitives
            .SourceRepositoryNameString(value)
        )
    override val sourceBranchName: Optional[SourceRepositoryBranchString] =
      zio.aws.core.internal
        .optionalFromNullable(impl.sourceBranchName())
        .map(value =>
          zio.aws.codecatalyst.model.primitives
            .SourceRepositoryBranchString(value)
        )
    override val definition
        : zio.aws.codecatalyst.model.WorkflowDefinition.ReadOnly =
      zio.aws.codecatalyst.model.WorkflowDefinition.wrap(impl.definition())
    override val createdTime: SyntheticTimestamp_date_time =
      zio.aws.codecatalyst.model.primitives
        .SyntheticTimestamp_date_time(impl.createdTime())
    override val lastUpdatedTime: SyntheticTimestamp_date_time =
      zio.aws.codecatalyst.model.primitives
        .SyntheticTimestamp_date_time(impl.lastUpdatedTime())
    override val runMode: zio.aws.codecatalyst.model.WorkflowRunMode =
      zio.aws.codecatalyst.model.WorkflowRunMode.wrap(impl.runMode())
    override val status: zio.aws.codecatalyst.model.WorkflowStatus =
      zio.aws.codecatalyst.model.WorkflowStatus.wrap(impl.status())
  }
  def wrap(
      impl: software.amazon.awssdk.services.codecatalyst.model.GetWorkflowResponse
  ): zio.aws.codecatalyst.model.GetWorkflowResponse.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy