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

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

The newest version!
package zio.aws.codecatalyst.model
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import zio.aws.codecatalyst.model.primitives.{
  ListWorkflowRunsRequestMaxResultsInteger,
  ListWorkflowRunsRequestProjectNameString,
  Uuid,
  ListWorkflowRunsRequestNextTokenString,
  NameString
}
import java.lang.Integer
import scala.jdk.CollectionConverters.*
final case class ListWorkflowRunsRequest(
    spaceName: NameString,
    workflowId: Optional[Uuid] = Optional.Absent,
    projectName: ListWorkflowRunsRequestProjectNameString,
    nextToken: Optional[ListWorkflowRunsRequestNextTokenString] =
      Optional.Absent,
    maxResults: Optional[ListWorkflowRunsRequestMaxResultsInteger] =
      Optional.Absent,
    sortBy: Optional[
      Iterable[zio.aws.codecatalyst.model.WorkflowRunSortCriteria]
    ] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.codecatalyst.model.ListWorkflowRunsRequest = {
    import ListWorkflowRunsRequest.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.codecatalyst.model.ListWorkflowRunsRequest
      .builder()
      .spaceName(NameString.unwrap(spaceName): java.lang.String)
      .optionallyWith(
        workflowId.map(value => Uuid.unwrap(value): java.lang.String)
      )(_.workflowId)
      .projectName(
        ListWorkflowRunsRequestProjectNameString.unwrap(
          projectName
        ): java.lang.String
      )
      .optionallyWith(
        nextToken.map(value =>
          ListWorkflowRunsRequestNextTokenString.unwrap(value): java.lang.String
        )
      )(_.nextToken)
      .optionallyWith(
        maxResults.map(value =>
          ListWorkflowRunsRequestMaxResultsInteger.unwrap(value): Integer
        )
      )(_.maxResults)
      .optionallyWith(
        sortBy.map(value =>
          value.map { item =>
            item.buildAwsValue()
          }.asJavaCollection
        )
      )(_.sortBy)
      .build()
  }
  def asReadOnly: zio.aws.codecatalyst.model.ListWorkflowRunsRequest.ReadOnly =
    zio.aws.codecatalyst.model.ListWorkflowRunsRequest.wrap(buildAwsValue())
}
object ListWorkflowRunsRequest {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.codecatalyst.model.ListWorkflowRunsRequest
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.codecatalyst.model.ListWorkflowRunsRequest =
      zio.aws.codecatalyst.model.ListWorkflowRunsRequest(
        spaceName,
        workflowId.map(value => value),
        projectName,
        nextToken.map(value => value),
        maxResults.map(value => value),
        sortBy.map(value =>
          value.map { item =>
            item.asEditable
          }
        )
      )
    def spaceName: NameString
    def workflowId: Optional[Uuid]
    def projectName: ListWorkflowRunsRequestProjectNameString
    def nextToken: Optional[ListWorkflowRunsRequestNextTokenString]
    def maxResults: Optional[ListWorkflowRunsRequestMaxResultsInteger]
    def sortBy: Optional[
      List[zio.aws.codecatalyst.model.WorkflowRunSortCriteria.ReadOnly]
    ]
    def getSpaceName: ZIO[Any, Nothing, NameString] = ZIO.succeed(spaceName)
    def getWorkflowId: ZIO[Any, AwsError, Uuid] =
      AwsError.unwrapOptionField("workflowId", workflowId)
    def getProjectName
        : ZIO[Any, Nothing, ListWorkflowRunsRequestProjectNameString] =
      ZIO.succeed(projectName)
    def getNextToken
        : ZIO[Any, AwsError, ListWorkflowRunsRequestNextTokenString] =
      AwsError.unwrapOptionField("nextToken", nextToken)
    def getMaxResults
        : ZIO[Any, AwsError, ListWorkflowRunsRequestMaxResultsInteger] =
      AwsError.unwrapOptionField("maxResults", maxResults)
    def getSortBy: ZIO[Any, AwsError, List[
      zio.aws.codecatalyst.model.WorkflowRunSortCriteria.ReadOnly
    ]] = AwsError.unwrapOptionField("sortBy", sortBy)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.codecatalyst.model.ListWorkflowRunsRequest
  ) extends zio.aws.codecatalyst.model.ListWorkflowRunsRequest.ReadOnly {
    override val spaceName: NameString =
      zio.aws.codecatalyst.model.primitives.NameString(impl.spaceName())
    override val workflowId: Optional[Uuid] = zio.aws.core.internal
      .optionalFromNullable(impl.workflowId())
      .map(value => zio.aws.codecatalyst.model.primitives.Uuid(value))
    override val projectName: ListWorkflowRunsRequestProjectNameString =
      zio.aws.codecatalyst.model.primitives
        .ListWorkflowRunsRequestProjectNameString(impl.projectName())
    override val nextToken: Optional[ListWorkflowRunsRequestNextTokenString] =
      zio.aws.core.internal
        .optionalFromNullable(impl.nextToken())
        .map(value =>
          zio.aws.codecatalyst.model.primitives
            .ListWorkflowRunsRequestNextTokenString(value)
        )
    override val maxResults
        : Optional[ListWorkflowRunsRequestMaxResultsInteger] =
      zio.aws.core.internal
        .optionalFromNullable(impl.maxResults())
        .map(value =>
          zio.aws.codecatalyst.model.primitives
            .ListWorkflowRunsRequestMaxResultsInteger(value)
        )
    override val sortBy: Optional[
      List[zio.aws.codecatalyst.model.WorkflowRunSortCriteria.ReadOnly]
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.sortBy())
      .map(value =>
        value.asScala.map { item =>
          zio.aws.codecatalyst.model.WorkflowRunSortCriteria.wrap(item)
        }.toList
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.codecatalyst.model.ListWorkflowRunsRequest
  ): zio.aws.codecatalyst.model.ListWorkflowRunsRequest.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy