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

Examples of com.github.api.v2.services.constant.GitHubApiUrls.GitHubApiUrlBuilder


  /* (non-Javadoc)
   * @see com.github.api.v2.services.UserService#getCurrentUser()
   */
  @Override
  public User getCurrentUser() {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.GET_CURRENT_USER_URL);
        String                apiUrl  = builder.buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<User>(){}, json.get("user"));
  }
View Full Code Here


  /* (non-Javadoc)
   * @see com.github.api.v2.services.UserService#getEmails()
   */
  @Override
  public List<String> getEmails() {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.GET_EMAILS_URL);
        String                apiUrl  = builder.buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<List<String>>(){}, json.get("emails"));
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.UserService#getKeys()
   */
  @Override
  public List<Key> getKeys() {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.GET_KEYS_URL);
        String                apiUrl  = builder.buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<List<Key>>(){}, json.get("public_keys"));
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.UserService#getUserByUsername(java.lang.String)
   */
  @Override
  public User getUserByUsername(String userName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.GET_USER_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<User>(){}, json.get("user"));
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.UserService#getUserFollowers(java.lang.String)
   */
  @Override
  public List<String> getUserFollowers(String userName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.GET_USER_FOLLOWERS_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<List<String>>(){}, json.get("users"));
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.UserService#getUserFollowing(java.lang.String)
   */
  @Override
  public List<String> getUserFollowing(String userName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.GET_USER_FOLLOWING_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<List<String>>(){}, json.get("users"));
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.UserService#getWatchedRepositories(java.lang.String)
   */
  @Override
  public List<Repository> getWatchedRepositories(String userName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.GET_WATCHED_REPOSITORIES_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<List<Repository>>(){}, json.get("repositories"));
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.UserService#removeEmail(java.lang.String)
   */
  @Override
  public void removeEmail(String email) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.REMOVE_EMAIL_URL);
        String                apiUrl  = builder.buildUrl();
        Map<String, String> parameters = new HashMap<String, String>();
        parameters.put(ParameterNames.EMAIL, email);
    callApiPost(apiUrl, parameters);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.UserService#removeKey(java.lang.String)
   */
  @Override
  public void removeKey(String id) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.REMOVE_KEY_URL);
        String                apiUrl  = builder.buildUrl();
        Map<String, String> parameters = new HashMap<String, String>();
        parameters.put(ParameterNames.ID, id);
    callApiPost(apiUrl, parameters);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.UserService#getUserByEmail(java.lang.String)
   */
  @Override
  public User getUserByEmail(String email) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.SEARCH_USERS_BY_EMAIL_URL);
        String                apiUrl  = builder.withField(ParameterNames.EMAIL, email).buildUrl();
        JsonObject json = unmarshall(callApiGet(apiUrl));
       
        return unmarshall(new TypeToken<User>(){}, json.get("user"));
  }
View Full Code Here

TOP

Related Classes of com.github.api.v2.services.constant.GitHubApiUrls.GitHubApiUrlBuilder

Copyright © 2018 www.massapicom. 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.