Class GHRepository.Updater

java.lang.Object
org.kohsuke.github.GHRepository.Updater
All Implemented Interfaces:
GitHubRequestBuilderDone<GHRepository>
Enclosing class:
GHRepository

@BetaApi public static class GHRepository.Updater extends Object
A GHRepositoryBuilder that allows multiple properties to be updated per request. Consumer must call done() to commit changes.
  • Field Details

    • requester

      @Nonnull protected final org.kohsuke.github.Requester requester
      The requester.
    • updateInPlace

      protected boolean updateInPlace
      The update in place.
  • Constructor Details

    • Updater

      protected Updater(@Nonnull GHRepository repository)
      Instantiates a new updater.
      Parameters:
      repository - the repository
  • Method Details

    • allowSquashMerge

      public GHRepository.Updater allowSquashMerge(boolean enabled) throws IOException
      Allow or disallow squash-merging pull requests.
      Parameters:
      enabled - true if enabled
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • allowMergeCommit

      public GHRepository.Updater allowMergeCommit(boolean enabled) throws IOException
      Allow or disallow merging pull requests with a merge commit.
      Parameters:
      enabled - true if enabled
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • allowRebaseMerge

      public GHRepository.Updater allowRebaseMerge(boolean enabled) throws IOException
      Allow or disallow rebase-merging pull requests.
      Parameters:
      enabled - true if enabled
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • allowForking

      public GHRepository.Updater allowForking(boolean enabled) throws IOException
      Allow or disallow private forks
      Parameters:
      enabled - true if enabled
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • deleteBranchOnMerge

      public GHRepository.Updater deleteBranchOnMerge(boolean enabled) throws IOException
      After pull requests are merged, you can have head branches deleted automatically.
      Parameters:
      enabled - true if enabled
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • defaultBranch

      public GHRepository.Updater defaultBranch(String branch) throws IOException
      Default repository branch.
      Parameters:
      branch - branch name
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • description

      public GHRepository.Updater description(String description) throws IOException
      Description for repository.
      Parameters:
      description - description of repository
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • homepage

      public GHRepository.Updater homepage(URL homepage) throws IOException
      Homepage for repository.
      Parameters:
      homepage - homepage of repository
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • homepage

      public GHRepository.Updater homepage(String homepage) throws IOException
      Homepage for repository.
      Parameters:
      homepage - homepage of repository
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • private_

      public GHRepository.Updater private_(boolean enabled) throws IOException
      Sets the repository to private.
      Parameters:
      enabled - private if true
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • visibility

      public GHRepository.Updater visibility(GHRepository.Visibility visibility) throws IOException
      Sets the repository visibility.
      Parameters:
      visibility - visibility of repository
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • issues

      public GHRepository.Updater issues(boolean enabled) throws IOException
      Enables issue tracker.
      Parameters:
      enabled - true if enabled
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • projects

      public GHRepository.Updater projects(boolean enabled) throws IOException
      Enables projects.
      Parameters:
      enabled - true if enabled
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • wiki

      public GHRepository.Updater wiki(boolean enabled) throws IOException
      Enables wiki.
      Parameters:
      enabled - true if enabled
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • downloads

      public GHRepository.Updater downloads(boolean enabled) throws IOException
      Enables downloads.
      Parameters:
      enabled - true if enabled
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • isTemplate

      public GHRepository.Updater isTemplate(boolean enabled) throws IOException
      Specifies whether the repository is a template.
      Parameters:
      enabled - true if enabled
      Returns:
      a builder to continue with building
      Throws:
      IOException - In case of any networking error or error from the server.
    • done

      public GHRepository done() throws IOException
      Done.
      Specified by:
      done in interface GitHubRequestBuilderDone<S>
      Returns:
      the GH repository
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • with

      @Nonnull @BetaApi protected GHRepository.Updater with(@Nonnull String name, Object value) throws IOException
      Applies a value to a name for this builder. If AbstractBuilder is the same as AbstractBuilder, this method will commit changes after the first value change and return a AbstractBuilder from GitHubRequestBuilderDone.done(). If AbstractBuilder is not the same as AbstractBuilder, this method will return an AbstractBuilder and letting the caller batch together multiple changes and call GitHubRequestBuilderDone.done() when they are ready.
      Parameters:
      name - the name of the field
      value - the value of the field
      Returns:
      either a continuing builder or an updated data record
      Throws:
      IOException - if an I/O error occurs
    • continueOrDone

      @Nonnull @BetaApi protected GHRepository.Updater continueOrDone() throws IOException
      Chooses whether to return a continuing builder or an updated data record If AbstractBuilder is the same as AbstractBuilder, this method will commit changes after the first value change and return a AbstractBuilder from GitHubRequestBuilderDone.done(). If AbstractBuilder is not the same as AbstractBuilder, this method will return an AbstractBuilder and letting the caller batch together multiple changes and call GitHubRequestBuilderDone.done() when they are ready.
      Returns:
      either a continuing builder or an updated data record
      Throws:
      IOException - if an I/O error occurs