Class RepositoryCreateRequest

java.lang.Object
com.atlassian.bitbucket.repository.AbstractRepositoryRequest
com.atlassian.bitbucket.repository.RepositoryCreateRequest

public class RepositoryCreateRequest extends AbstractRepositoryRequest
Defines the properties that can be set when creating a new Repository. To reduce backwards compatibility issues as new properties are added over time, instances of this class may only be created using its RepositoryCreateRequest.Builder.

The following properties are required:

Unless otherwise specified, the new repository will be forkable by default. Unless otherwise specified, the new repository will not be public by default.

The repository's slug, which is used in URLs (both for the browser and when cloning), will be generated from the provided AbstractRepositoryRequest.getName(). Both the name and the generated slug must be unique within the project or the repository cannot be created.

See Also:
  • Method Details

    • getDefaultBranch

      @Nullable public String getDefaultBranch()
      Retrieves the default branch name that should be set when the repository is created. If no default branch name is specified the instance-level default branch name will be used instead. If no instance-level default has been configured, the SCM's default (which may change over time) will be used.
      Returns:
      the default branch name, which may be null to use the instance- or SCM-level default
      Since:
      7.5
    • getProject

      @Nonnull public Project getProject()
      Retrieves the project in which the new repository will be created.
      Returns:
      the destination project
    • getScmId

      @Nonnull public String getScmId()
      Retrieves the SCM ID, defining the SCM to be used for the new repository. Once created, the SCM for a given repository cannot be changed.
      Returns:
      the SCM for the new repository