java.lang.Object
org.kohsuke.github.GHCreateRepositoryBuilder
- All Implemented Interfaces:
GitHubRequestBuilderDone<GHRepository>
Creates a repository.
- Author:
- Kohsuke Kawaguchi
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.kohsuke.github.Requester
The requester.protected boolean
The update in place. -
Constructor Summary
ConstructorDescriptionGHCreateRepositoryBuilder
(String name, GitHub root, String apiTail) Instantiates a new GH create repository builder. -
Method Summary
Modifier and TypeMethodDescriptionallowForking
(boolean enabled) Allow or disallow private forksallowMergeCommit
(boolean enabled) Allow or disallow merging pull requests with a merge commit.allowRebaseMerge
(boolean enabled) Allow or disallow rebase-merging pull requests.allowSquashMerge
(boolean enabled) Allow or disallow squash-merging pull requests.autoInit
(boolean enabled) If true, create an initial commit with empty README.protected GHCreateRepositoryBuilder
Chooses whether to return a continuing builder or an updated data record IfAbstractBuilder
is the same asAbstractBuilder
, this method will commit changes after the first value change and return aAbstractBuilder
fromGitHubRequestBuilderDone.done()
.create()
Creates a repository with all the parameters.defaultBranch
(String branch) Default repository branch.deleteBranchOnMerge
(boolean enabled) After pull requests are merged, you can have head branches deleted automatically.description
(String description) Description for repository.done()
Done.downloads
(boolean enabled) Enables downloads.fromTemplateRepository
(String templateOwner, String templateRepo) Create repository from template repository.fromTemplateRepository
(GHRepository templateRepository) Create repository from template repository.gitignoreTemplate
(String language) Creates a default .gitignoreHomepage for repository.Homepage for repository.issues
(boolean enabled) Enables issue tracker.isTemplate
(boolean enabled) Specifies whether the repository is a template.licenseTemplate
(String license) Desired license template to apply.Specifies the ownership of the repository.private_
(boolean enabled) Sets the repository to private.projects
(boolean enabled) Enables projects.The team that gets granted access to this repository.visibility
(GHRepository.Visibility visibility) Sets the repository visibility.wiki
(boolean enabled) Enables wiki.protected GHCreateRepositoryBuilder
Applies a value to a name for this builder.
-
Field Details
-
requester
@Nonnull protected final org.kohsuke.github.Requester requesterThe requester. -
updateInPlace
protected boolean updateInPlaceThe update in place.
-
-
Constructor Details
-
GHCreateRepositoryBuilder
Instantiates a new GH create repository builder.- Parameters:
name
- the nameroot
- the rootapiTail
- the api tail
-
-
Method Details
-
gitignoreTemplate
Creates a default .gitignore- Parameters:
language
- template to base the ignore file on- Returns:
- a builder to continue with building See https://developer.github.com/v3/repos/#create
- Throws:
IOException
- In case of any networking error or error from the server.
-
licenseTemplate
Desired license template to apply.- Parameters:
license
- template to base the license file on- Returns:
- a builder to continue with building See https://developer.github.com/v3/repos/#create
- Throws:
IOException
- In case of any networking error or error from the server.
-
autoInit
If true, create an initial commit with empty README.- 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.
-
team
The team that gets granted access to this repository. Only valid for creating a repository in an organization.- Parameters:
team
- team to grant access to- Returns:
- a builder to continue with building
- Throws:
IOException
- In case of any networking error or error from the server.
-
owner
Specifies the ownership of the repository.- Parameters:
owner
- organization or personage- Returns:
- a builder to continue with building
- Throws:
IOException
- In case of any networking error or error from the server.
-
fromTemplateRepository
Create repository from template repository.- Parameters:
templateOwner
- template repository ownertemplateRepo
- template repository- Returns:
- a builder to continue with building
-
fromTemplateRepository
Create repository from template repository.- Parameters:
templateRepository
- the template repository as a GHRepository- Returns:
- a builder to continue with building
-
create
Creates a repository with all the parameters.- Returns:
- the gh repository
- Throws:
IOException
- if repository cannot be created
-
allowSquashMerge
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
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
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
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
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
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
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
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
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_
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
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
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
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
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
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
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
Done.- Specified by:
done
in interfaceGitHubRequestBuilderDone<S>
- Returns:
- the GH repository
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
with
@Nonnull @BetaApi protected GHCreateRepositoryBuilder with(@Nonnull String name, Object value) throws IOException Applies a value to a name for this builder. IfAbstractBuilder
is the same asAbstractBuilder
, this method will commit changes after the first value change and return aAbstractBuilder
fromGitHubRequestBuilderDone.done()
. IfAbstractBuilder
is not the same asAbstractBuilder
, this method will return anAbstractBuilder
and letting the caller batch together multiple changes and callGitHubRequestBuilderDone.done()
when they are ready.- Parameters:
name
- the name of the fieldvalue
- the value of the field- Returns:
- either a continuing builder or an updated data record
- Throws:
IOException
- if an I/O error occurs
-
continueOrDone
Chooses whether to return a continuing builder or an updated data record IfAbstractBuilder
is the same asAbstractBuilder
, this method will commit changes after the first value change and return aAbstractBuilder
fromGitHubRequestBuilderDone.done()
. IfAbstractBuilder
is not the same asAbstractBuilder
, this method will return anAbstractBuilder
and letting the caller batch together multiple changes and callGitHubRequestBuilderDone.done()
when they are ready.- Returns:
- either a continuing builder or an updated data record
- Throws:
IOException
- if an I/O error occurs
-