Class ListBuildsResponse

java.lang.Object
org.sourcelab.buildkite.api.client.response.ListBuildsResponse
All Implemented Interfaces:
PageableResponse<ListBuildsResponse>

public class ListBuildsResponse extends Object implements PageableResponse<ListBuildsResponse>
Represents the results from the /v2/build API end point.
  • Constructor Details

    • ListBuildsResponse

      public ListBuildsResponse(PagingLinks pagingLinks, List<Build> builds, ListBuildsRequest originalRequest)
      Constructor.
      Parameters:
      pagingLinks - Paging links for results.
      builds - All builds returned in the response.
      originalRequest - The original request used to retrieve these results.
  • Method Details

    • getPagingLinks

      public PagingLinks getPagingLinks()
      Paging Link references for the results.
      Specified by:
      getPagingLinks in interface PageableResponse<ListBuildsResponse>
      Returns:
      Paging Link references for the results.
    • getOriginalRequest

      public PageableRequest<ListBuildsResponse> getOriginalRequest()
      Description copied from interface: PageableResponse
      Get the original underlying Request used to generate this response.
      Specified by:
      getOriginalRequest in interface PageableResponse<ListBuildsResponse>
      Returns:
      Original underlying Request.
    • getBuilds

      public List<Build> getBuilds()
      All of the Builds returned from the API response.
      Returns:
      All of the Builds returned from the API response.
    • count

      public int count()
      The total number of builds found.
      Returns:
      The total number of builds found.
    • getBuildIds

      public List<String> getBuildIds()
      Get all build Ids.
      Returns:
      All build ids.
    • getBuildById

      public Optional<Build> getBuildById(String buildId)
      Given a build Id, return the build associated with the Id.
      Parameters:
      buildId - Id of the build to retrieve.
      Returns:
      Build by buildId.
    • toString

      public String toString()
      Overrides:
      toString in class Object