Class BuildFiltersBuilder

java.lang.Object
org.sourcelab.buildkite.api.client.request.BuildFiltersBuilder

public final class BuildFiltersBuilder extends Object
Builder for BuildFilters.
  • Constructor Details

    • BuildFiltersBuilder

      public BuildFiltersBuilder()
      Constructor.
  • Method Details

    • withBranch

      public BuildFiltersBuilder withBranch(String branch)
      Apply filter over one or more branches.
      Parameters:
      branch - Branch names to filter over.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withBranches

      public BuildFiltersBuilder withBranches(String... branches)
      Apply filter over one or more branches.
      Parameters:
      branches - One or more branch names to filter by.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withBranches

      public BuildFiltersBuilder withBranches(Collection<String> branches)
      Apply filter over one or more branches.
      Parameters:
      branches - One or more branch names to filter by.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withCommit

      public BuildFiltersBuilder withCommit(String commit)
      Apply filter over one or more commits.
      Parameters:
      commit - Commit hashes to filter by.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withCommits

      public BuildFiltersBuilder withCommits(String... commits)
      Apply filter over one or more commits.
      Parameters:
      commits - One or more commit hashes to filter by.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withCommits

      public BuildFiltersBuilder withCommits(Collection<String> commits)
      Apply filter over one or more commits.
      Parameters:
      commits - One or more commit hashes to filter by.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withCreatedFrom

      public BuildFiltersBuilder withCreatedFrom(ZonedDateTime createdFrom)
      Apply filter over results by builds created on or after the given time.
      Parameters:
      createdFrom - Filters the results by builds created on or after the given time.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withCreatedTo

      public BuildFiltersBuilder withCreatedTo(ZonedDateTime createdTo)
      Filters the results by builds created before the given time.
      Parameters:
      createdTo - Filters the results by builds created before the given time.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withCreator

      public BuildFiltersBuilder withCreator(String creatorUuid)
      Filters the results by the user who created the build. Supply userId/UUID.
      Parameters:
      creatorUuid - Filters the results by the user who created the build. Supply userId/UUID.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withFinishedFrom

      public BuildFiltersBuilder withFinishedFrom(ZonedDateTime finishedFrom)
      Filters the results by builds finished on or after the given time.
      Parameters:
      finishedFrom - Filters the results by builds finished on or after the given time.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withIncludeRetriedJobs

      public BuildFiltersBuilder withIncludeRetriedJobs(Boolean includeRetriedJobs)
      Setting to TRUE, include all retried job executions in each build's jobs list. Setting to FALSE , you'll see only the most recently run job for each step.
      Parameters:
      includeRetriedJobs - Setting to TRUE, include all retried job executions in each build's jobs list. Setting to FALSE , you'll see only the most recently run job for each step.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withMetaData

      public BuildFiltersBuilder withMetaData(String name, Object value)
      Filters the results by the given meta-data.
      Parameters:
      name - Metadata key name.
      value - Metadata value.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withMetaData

      public BuildFiltersBuilder withMetaData(Map<String,String> metaData)
      Filters the results by the given meta-data.
      Parameters:
      metaData - Metadata values.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withStateChooser

      public StateChooser withStateChooser()
      Utility helper to fluently select states from known valid states.
      Returns:
      Utility helper to fluently select states from known valid states.
    • withState

      public BuildFiltersBuilder withState(String state)
      Filters the results by the given build state. The finished state is a shortcut to automatically search for builds with passed, failed, blocked, canceled states. See also withStateChooser(). Valid states: running, scheduled, passed, failing, failed, blocked, canceled, canceling, skipped, not_run, finished
      Parameters:
      state - Filters the results by the given build state.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withStates

      public BuildFiltersBuilder withStates(String... states)
      Filters the results by the given build state. The finished state is a shortcut to automatically search for builds with passed, failed, blocked, canceled states. Valid states: running, scheduled, passed, failing, failed, blocked, canceled, canceling, skipped, not_run, finished
      Parameters:
      states - Filters the results by the given build state.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withStates

      public BuildFiltersBuilder withStates(Collection<String> states)
      Filters the results by the given build state. The finished state is a shortcut to automatically search for builds with passed, failed, blocked, canceled states. Valid states: running, scheduled, passed, failing, failed, blocked, canceled, canceling, skipped, not_run, finished
      Parameters:
      states - Filters the results by the given build state.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withPerPage

      public BuildFiltersBuilder withPerPage(int perPage)
      Set the number of results per page.
      Parameters:
      perPage - Set the number of results per page.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withPage

      public BuildFiltersBuilder withPage(int page)
      Set the page to retrieve.
      Parameters:
      page - Set the page to retrieve.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withPageOptions

      public BuildFiltersBuilder withPageOptions(int page, int perPage)
      Apply Paging Options.
      Parameters:
      page - Set the page to retrieve.
      perPage - Set the number of results per page.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withPageOptions

      public BuildFiltersBuilder withPageOptions(PageOptions pageOptions)
      Apply Paging Options.
      Parameters:
      pageOptions - Paging options to apply.
      Returns:
      BuildFiltersBuilder for method chaining.
    • withOrganization

      public BuildFiltersBuilder withOrganization(String orgIdSlug)
    • withPipeline

      public BuildFiltersBuilder withPipeline(String orgIdSlug, String pipelineIdSlug)
    • build

      public BuildFilters build()
      New BuildFilters instance using configured properties.
      Returns:
      New BuildFilters instance using configured properties.
      Throws:
      BuilderValidationException - if not valid or complete.