Class ListOrganizationsResponse

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

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

    • ListOrganizationsResponse

      public ListOrganizationsResponse(PagingLinks pagingLinks, List<Organization> organizations, ListOrganizationsRequest originalRequest)
      Constructor.
      Parameters:
      pagingLinks - Paging links for results.
      organizations - All organizations 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<ListOrganizationsResponse>
      Returns:
      Paging Link references for the results.
    • getOriginalRequest

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

      public List<Organization> getOrganizations()
      All of the Organizations returned from the API response.
      Returns:
      All of the Organizations returned from the API response.
    • count

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

      public List<String> getOrganizationIds()
      Get all organization Ids.
      Returns:
      All organization ids.
    • getOrganizationNames

      public List<String> getOrganizationNames()
      Get all organization names.
      Returns:
      All organization names.
    • getOrganizationSlugIds

      public List<String> getOrganizationSlugIds()
      Get all organization slugs.
      Returns:
      All organization slugs.
    • getOrganizationById

      public Optional<Organization> getOrganizationById(String organizationId)
      Given an organization Id, return the organization associated with the Id.
      Parameters:
      organizationId - Id of the organization to retrieve.
      Returns:
      Organization by organizationId.
    • getOrganizationByName

      public Optional<Organization> getOrganizationByName(String organizationName)
      Given an organization name, return the organization associated with the Name.
      Parameters:
      organizationName - Name of the organization to retrieve.
      Returns:
      Organization by organization name.
    • getOrganizationBySlug

      public Optional<Organization> getOrganizationBySlug(String slug)
      Given an organization slug, return the organization associated with the slug.
      Parameters:
      slug - slug of the organization to retrieve.
      Returns:
      Organization by organization slug.
    • toString

      public String toString()
      Overrides:
      toString in class Object