Class Repos.RepoCreate

java.lang.Object
com.jcabi.github.Repos.RepoCreate
All Implemented Interfaces:
JsonReadable
Enclosing interface:
Repos

@Loggable(1) public static final class Repos.RepoCreate extends Object implements JsonReadable
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 Details

    • RepoCreate

      public RepoCreate(String nme, boolean prvt)
      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

      public String 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

      public String description()
      Description of the new repo. If it has no description, this is an empty string.
      Returns:
      Description
    • homepage

      public String homepage()
      Homepage of the new repo. If it has no homepage, this is an empty string.
      Returns:
      Homepage
    • autoInit

      public com.google.common.base.Optional<Boolean> autoInit()
      Auto-init the new repo? If absent, the GitHub default will be used.
      Returns:
      Optional boolean
    • organization

      public String organization()
      Name of the organization to which this repo belongs.
      Returns:
      String org name
    • withName

      public Repos.RepoCreate withName(String nme)
      Returns a RepoCreate with the given name. The name cannot be empty.
      Parameters:
      nme - Name of the new repo
      Returns:
      RepoCreate
    • withPrivacy

      public Repos.RepoCreate withPrivacy(boolean privacy)
      Returns a RepoCreate with the given privacy.
      Parameters:
      privacy - Privateness of the new repo
      Returns:
      RepoCreate
    • withDescription

      public Repos.RepoCreate withDescription(String desc)
      Returns a RepoCreate with the given description.
      Parameters:
      desc - Description
      Returns:
      RepoCreate
    • withHomepage

      public Repos.RepoCreate withHomepage(String page)
      Returns a RepoCreate with the given homepage.
      Parameters:
      page - Homepage URL
      Returns:
      RepoCreate
    • withAutoInit

      public Repos.RepoCreate withAutoInit(com.google.common.base.Optional<Boolean> auto)
      Returns a RepoCreate with the given auto-init enabledness.
      Parameters:
      auto - Auto-init the new repo?
      Returns:
      RepoCreate
    • withAutoInit

      public Repos.RepoCreate withAutoInit(boolean auto)
      Returns a RepoCreate with the given auto-init enabledness.
      Parameters:
      auto - Auto-init the new repo?
      Returns:
      RepoCreate
    • withOrganization

      public Repos.RepoCreate withOrganization(String org)
      Returns a RepoCreate with the given organization.
      Parameters:
      org - Organization to which this repo belongs.
      Returns:
      RepoCreate
    • with

      public Repos.RepoCreate with(String key, jakarta.json.JsonValue value)
      Returns a RepoCreate with the given json fields.
      Parameters:
      key - Json key
      value - 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: JsonReadable
      Describe it in a JSON object.
      Specified by:
      json in interface JsonReadable
      Returns:
      JSON object