Class 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
    Version:
    $Id: 7a994514f14522a5c35ba73a5614b31cc3312895 $
    Author:
    Chris Rebert (github@rebertia.com)
    See Also:
    Create Repo API
    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 Detail

      • 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 Detail

      • 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
      • json

        public javax.json.JsonObject json()
        Description copied from interface: JsonReadable
        Describe it in a JSON object.
        Specified by:
        json in interface JsonReadable
        Returns:
        JSON object