Package com.github.api.v2.services

Examples of com.github.api.v2.services.IssueService


  /* (non-Javadoc)
   * @see com.github.api.v2.services.JobService#searchJobs(java.lang.String, java.lang.String)
   */
  @Override
  public List<Job> searchJobs(String query, String location) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.JobApiUrls.SEARCH_JOBS_URL);
        String                apiUrl  = builder.withParameter(ParameterNames.SEARCH, query).withParameter(ParameterNames.LOCATION, location).buildUrl();
        JsonElement json = unmarshallList(callApiGet(apiUrl));
        return unmarshall(new TypeToken<List<Job>>(){}, json)
  }
View Full Code Here


  /* (non-Javadoc)
   * @see com.github.api.v2.services.JobService#searchJobs(java.lang.String, com.github.api.v2.schema.GeoLocation)
   */
  @Override
  public List<Job> searchJobs(String query, GeoLocation location) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.JobApiUrls.SEARCH_JOBS_URL);
        String                apiUrl  = builder.withParameter(ParameterNames.SEARCH, query).withParameter(ParameterNames.LATITUDE, String.valueOf(location.getLatitude())).withParameter(ParameterNames.LONGITUDE, String.valueOf(location.getLongitude())).buildUrl();
        JsonElement json = unmarshallList(callApiGet(apiUrl));
        return unmarshall(new TypeToken<List<Job>>(){}, json)
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.UserService#addEmail(java.lang.String)
   */
  @Override
  public void addEmail(String email) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.ADD_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#addKey(java.lang.String, java.lang.String)
   */
  @Override
  public void addKey(String title, String key) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.ADD_KEY_URL);
        String                apiUrl  = builder.buildUrl();
        Map<String, String> parameters = new HashMap<String, String>();
        parameters.put(ParameterNames.TITLE, title);
        parameters.put(ParameterNames.KEY, key);
    callApiPost(apiUrl, parameters);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.github.api.v2.services.UserService#followUser(java.lang.String)
   */
  @Override
  public void followUser(String userName) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.UserApiUrls.FOLLOW_USER_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).buildUrl();
    callApiPost(apiUrl, new HashMap<String, String>());
  }
View Full Code Here

  /* (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

TOP

Related Classes of com.github.api.v2.services.IssueService

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.