Class RepositoryUpdateRequest
java.lang.Object
com.atlassian.bitbucket.repository.AbstractRepositoryRequest
com.atlassian.bitbucket.repository.RepositoryUpdateRequest
Defines the properties that can be modified when updating a
Repository
. To reduce backwards compatibility
issues as new properties are added over time, instances of this class may only be created using its RepositoryUpdateRequest.Builder
.
The following properties are required:
getId()
: TheID
of the repository to update. This value will not be changed.AbstractRepositoryRequest.getName()
: The new name for the repository, which may match the old name if only theforkability
of the repository should be updated
AbstractRepositoryRequest.isForkable()
: Defaults totrue
, meaning the repository will be marked as forkable if not explicitly specifiedAbstractRepositoryRequest.isPublic()
: Defaults tofalse
, meaning the repository will not be public if not explicitly specified
slug
, which is used in URLs (both for the browser and when cloning), will be
generated from the provided AbstractRepositoryRequest.getName()
. If the new name, or new slug, have already been used by a different
repository in the same project
, the repository cannot be updated. Additionally, note
that changing a repository's name, as it may change the slug, may change every URL for the repository, both
URLs used by the browser and the clone URL. As a result, changing a repository's name may be very disruptive
and should be carefully considered.-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.bitbucket.repository.AbstractRepositoryRequest
AbstractRepositoryRequest.AbstractBuilder<B extends AbstractRepositoryRequest.AbstractBuilder<B>>
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves thearchive state
to be set when the repository is updated.Retrieves the new default branch that should be set when the repository is updated.int
getId()
Retrieves theID
of the repository to update.Retrieves theproject
the repository should be moved to.Methods inherited from class com.atlassian.bitbucket.repository.AbstractRepositoryRequest
getDescription, getName, isForkable, isPublic
-
Method Details
-
getArchived
Retrieves thearchive state
to be set when the repository is updated. If no value is provided, the archive state will not be updated.- Returns:
- the archive state, which may be
null
to retain the existing archive state - Since:
- 8.0
-
getDefaultBranch
Retrieves the new default branch that should be set when the repository is updated. If no value is provided the default branch will not be updated.- Returns:
- the default branch name, which may be
null
to retain the existing default branch - Since:
- 7.5
-
getId
public int getId()Retrieves theID
of the repository to update.- Returns:
- the repository's ID
-
getProject
Retrieves theproject
the repository should be moved to.- Returns:
- the project to move the repository to. If
null
, leave the repository in the existingproject
-