Package com.jcabi.github
Class Repos.RepoCreate
java.lang.Object
com.jcabi.github.Repos.RepoCreate
- All Implemented Interfaces:
JsonReadable
- Enclosing interface:
- Repos
Settings to use when creating a new GitHub repository.
- Since:
- 0.24
- See Also:
- To do:
- #1095:30m Add the ability to set the other parameters of the repo creation API (has_issues, has_wiki, has_downloads, team_id, gitignore_template, license_template).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.base.Optional<Boolean>autoInit()Auto-init the new repo?Description of the new repo.homepage()Homepage of the new repo.booleanWill the new repo be private?jakarta.json.JsonObjectjson()Describe it in a JSON object.name()Name of the new repo.Name of the organization to which this repo belongs.Returns a RepoCreate with the given json fields.withAutoInit(boolean auto) Returns a RepoCreate with the given auto-init enabledness.withAutoInit(com.google.common.base.Optional<Boolean> auto) Returns a RepoCreate with the given auto-init enabledness.withDescription(String desc) Returns a RepoCreate with the given description.withHomepage(String page) Returns a RepoCreate with the given homepage.Returns a RepoCreate with the given name.withOrganization(String org) Returns a RepoCreate with the given organization.withPrivacy(boolean privacy) Returns a RepoCreate with the given privacy.
-
Constructor Details
-
RepoCreate
Public ctor.- Parameters:
nme- Name of the new repository. Cannot be empty.prvt- Will the new repo be private? If not, then it will be public.
-
-
Method Details
-
name
Name of the new repo.- Returns:
- Name
-
isPrivate
public boolean isPrivate()Will the new repo be private? If not, then it will be public.- Returns:
- Is this repo private?
-
description
Description of the new repo. If it has no description, this is an empty string.- Returns:
- Description
-
homepage
Homepage of the new repo. If it has no homepage, this is an empty string.- Returns:
- Homepage
-
autoInit
Auto-init the new repo? If absent, the GitHub default will be used.- Returns:
- Optional boolean
-
organization
Name of the organization to which this repo belongs.- Returns:
- String org name
-
withName
Returns a RepoCreate with the given name. The name cannot be empty.- Parameters:
nme- Name of the new repo- Returns:
- RepoCreate
-
withPrivacy
Returns a RepoCreate with the given privacy.- Parameters:
privacy- Privateness of the new repo- Returns:
- RepoCreate
-
withDescription
Returns a RepoCreate with the given description.- Parameters:
desc- Description- Returns:
- RepoCreate
-
withHomepage
Returns a RepoCreate with the given homepage.- Parameters:
page- Homepage URL- Returns:
- RepoCreate
-
withAutoInit
Returns a RepoCreate with the given auto-init enabledness.- Parameters:
auto- Auto-init the new repo?- Returns:
- RepoCreate
-
withAutoInit
Returns a RepoCreate with the given auto-init enabledness.- Parameters:
auto- Auto-init the new repo?- Returns:
- RepoCreate
-
withOrganization
Returns a RepoCreate with the given organization.- Parameters:
org- Organization to which this repo belongs.- Returns:
- RepoCreate
-
with
Returns a RepoCreate with the given json fields.- Parameters:
key- Json keyvalue- Json value- Returns:
- The same RepoCreate.
- To do:
- #1660:30min Make 'with' method immutable. Currently, the 'with' method mutates the 'other' field. This is not ideal, as it makes the class mutable. Make the 'with' method immutable and return a new RepoCreate object with the new field.
-
json
public jakarta.json.JsonObject json()Description copied from interface:JsonReadableDescribe it in a JSON object.- Specified by:
jsonin interfaceJsonReadable- Returns:
- JSON object
-