Package com.github.api.v2.services.constant.GitHubApiUrls

Examples of com.github.api.v2.services.constant.GitHubApiUrls.GitHubApiUrlBuilder.withField()


   * @see com.github.api.v2.services.RepositoryService#addDeployKey(java.lang.String, java.lang.String, java.lang.String)
   */
  @Override
  public List<Key> addDeployKey(String repositoryName, String title, String key) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.RepositoryApiUrls.ADD_DEPLOY_KEY_URL);
        String                apiUrl  = builder.withField(ParameterNames.REPOSITORY_NAME, repositoryName).buildUrl();
        Map<String, String> parameters = new HashMap<String, String>();
        parameters.put(ParameterNames.TITLE, title);
        parameters.put(ParameterNames.KEY, key);
        JsonObject json = unmarshall(callApiPost(apiUrl, parameters));
       
View Full Code Here


   * @see com.github.api.v2.services.RepositoryService#changeVisibility(java.lang.String, com.github.api.v2.schema.Repository.Visibility)
   */
  @Override
  public void changeVisibility(String repositoryName, Visibility visibility) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.RepositoryApiUrls.CHANGE_VISIBILITY_URL);
        String                apiUrl  = builder.withField(ParameterNames.REPOSITORY_NAME, repositoryName).withFieldEnum(ParameterNames.VISIBILITY, visibility).buildUrl();
        JsonObject json = unmarshall(callApiPost(apiUrl, new HashMap<String, String>()));
       
        unmarshall(new TypeToken<Repository>(){}, json.get("repository"));
  }

View Full Code Here

   * @see com.github.api.v2.services.RepositoryService#deleteRepository(java.lang.String)
   */
  @Override
  public void deleteRepository(String repositoryName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.RepositoryApiUrls.DELETE_REPOSITORY_URL);
        String                apiUrl  = builder.withField(ParameterNames.REPOSITORY_NAME, repositoryName).buildUrl();
        JsonObject json = unmarshall(callApiPost(apiUrl, new HashMap<String, String>()));
        if (json.has("delete_token")) {
          Map<String, String> parameters = new HashMap<String, String>();
          parameters.put(ParameterNames.DELETE_TOKEN, json.get("delete_token").getAsString());
          callApiPost(apiUrl, parameters);
View Full Code Here

   * @see com.github.api.v2.services.RepositoryService#forkRepository(java.lang.String, java.lang.String)
   */
  @Override
  public Repository forkRepository(String userName, String repositoryName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.RepositoryApiUrls.FORK_REPOSITORY_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).withField(ParameterNames.REPOSITORY_NAME, repositoryName).buildUrl();
        JsonObject json = unmarshall(callApiPost(apiUrl, new HashMap<String, String>()));
        return unmarshall(new TypeToken<Repository>(){}, json.get("repository"));
  }

  /* (non-Javadoc)
 
View Full Code Here

   * @see com.github.api.v2.services.RepositoryService#getBranches(java.lang.String, java.lang.String)
   */
  @Override
  public Map<String, String> getBranches(String userName, String repositoryName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.RepositoryApiUrls.GET_BRANCHES_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).withField(ParameterNames.REPOSITORY_NAME, repositoryName).buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<Map<String, String>>(){}, json.get("branches"));
  }

View Full Code Here

   * @see com.github.api.v2.services.RepositoryService#getCollaborators(java.lang.String, java.lang.String)
   */
  @Override
  public List<String> getCollaborators(String userName, String repositoryName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.RepositoryApiUrls.GET_COLLABORATORS_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).withField(ParameterNames.REPOSITORY_NAME, repositoryName).buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<List<String>>(){}, json.get("collaborators"));
  }

View Full Code Here

   * @see com.github.api.v2.services.RepositoryService#getContributors(java.lang.String, java.lang.String)
   */
  @Override
  public List<User> getContributors(String userName, String repositoryName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.RepositoryApiUrls.GET_CONTRIBUTORS_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).withField(ParameterNames.REPOSITORY_NAME, repositoryName).buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<List<User>>(){}, json.get("contributors"));
  }

View Full Code Here

   * @see com.github.api.v2.services.RepositoryService#getForks(java.lang.String, java.lang.String)
   */
  @Override
  public List<Repository> getForks(String userName, String repositoryName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.RepositoryApiUrls.GET_FORKS_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).withField(ParameterNames.REPOSITORY_NAME, repositoryName).buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<List<Repository>>(){}, json.get("network"));
  }

View Full Code Here

   * @see com.github.api.v2.services.RepositoryService#getDeployKeys(java.lang.String)
   */
  @Override
  public List<Key> getDeployKeys(String repositoryName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.RepositoryApiUrls.GET_DEPLOY_KEYS_URL);
        String                apiUrl  = builder.withField(ParameterNames.REPOSITORY_NAME, repositoryName).buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<List<Key>>(){}, json.get("public_keys"));
  }

View Full Code Here

   */
  @Override
  public Map<Language, Long> getLanguageBreakdown(String userName,
      String repositoryName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.RepositoryApiUrls.GET_LANGUAGE_BREAKDOWN_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).withField(ParameterNames.REPOSITORY_NAME, repositoryName).buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<Map<Language, Long>>(){}, json.get("languages"));
  }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.