Package com.github.api.v2.schema

Examples of com.github.api.v2.schema.Feed


  @Override
  public Issue updateIssue(String userName, String repositoryName,
      int issueNumber, String title, String body, State state) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.IssueApiUrls.UPDATE_ISSUE_URL);
    String apiUrl = builder.withField(ParameterNames.USER_NAME, userName).withField(ParameterNames.REPOSITORY_NAME, repositoryName).withField(ParameterNames.ISSUE_NUMBER, String.valueOf(issueNumber)).buildUrl();
    Issue issue = new Issue();
    issue.setTitle(title);
    issue.setBody(body);
    issue.setState(state);
        JsonObject json = unmarshall(callApiMethod(apiUrl, marshall(issue), ApplicationConstants.CONTENT_TYPE_JSON, HttpMethod.POST, 200));
        return unmarshall(new TypeToken<Issue>(){}, json);
  }
View Full Code Here


    JobService service = factory.createJobService();
    List<Job> jobs = service.searchJobs("python", "new york");
    for (Job job : jobs) {
      printResult(job);
    }
    Job job = service.getJob("82eeae34-65ff-11e0-99be-a34ef36756d3");
    printResult(job);
  }
View Full Code Here

  @Override
  public Label addLabel(String userName, String repositoryName, String label,
      String color) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.IssueApiUrls.ADD_LABEL_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).withField(ParameterNames.REPOSITORY_NAME, repositoryName).buildUrl();
        Label bean = new Label();
        bean.setName(label);
        bean.setColor(color);
        JsonObject json = unmarshall(callApiMethod(apiUrl, marshall(bean), ApplicationConstants.CONTENT_TYPE_JSON, HttpMethod.POST, 201));
       
        return unmarshall(new TypeToken<Label>(){}, json);
  }
View Full Code Here

  @Override
  public Label updateLabel(String userName, String repositoryName,
      String labelId, String label, String color) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.IssueApiUrls.UPDATE_LABEL_URL);
    String apiUrl = builder.withField(ParameterNames.USER_NAME, userName).withField(ParameterNames.REPOSITORY_NAME, repositoryName).withField(ParameterNames.LABEL_ID, labelId).buildUrl();
    Label bean = new Label();
    bean.setName(label);
    bean.setColor(color);
        JsonObject json = unmarshall(callApiMethod(apiUrl, marshall(bean), ApplicationConstants.CONTENT_TYPE_JSON, HttpMethod.POST, 200));
        return unmarshall(new TypeToken<Label>(){}, json);
  }
View Full Code Here

  public Milestone createMilestone(String userName, String repositoryName,
      String title, String description,
      com.github.api.v2.schema.Milestone.State state, Date dueDate) {
    GitHubApiUrlBuilder builder = createGitHubApiUrlBuilder(GitHubApiUrls.IssueApiUrls.CREATE_MILESTONE_URL);
        String                apiUrl  = builder.withField(ParameterNames.USER_NAME, userName).withField(ParameterNames.REPOSITORY_NAME, repositoryName).buildUrl();
        Milestone bean = new Milestone();
        bean.setTitle(title);
        bean.setDescription(description);
        bean.setState(state);
        bean.setDueOn(dueDate);
        JsonObject json = unmarshall(callApiMethod(apiUrl, marshall(bean), ApplicationConstants.CONTENT_TYPE_JSON, HttpMethod.POST, 201));
       
        return unmarshall(new TypeToken<Milestone>(){}, json);
  }
View Full Code Here

   *             the exception
   */
  public static void main(String[] args) throws Exception {
    GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
    OrganizationService service = factory.createOrganizationService();
    Organization organization = service.getOrganization("github");
    printResult(organization);
    List<User> publicMembers = service.getPublicMembers("github");
    for (User user : publicMembers) {
      printResult(user);
    }
View Full Code Here

    PullRequestService service = factory.createPullRequestService();
    List<PullRequest> pullRequests = service.getPullRequests("technoweenie", "faraday");
    for (PullRequest pullRequest : pullRequests) {
      printResult(pullRequest);         
    }
    PullRequest pullRequest = service.getPullRequest("technoweenie", "faraday", 15);
    printResult(pullRequest);
  }
View Full Code Here

    UserService service = factory.createUserService();
    List<User> users = service.searchUsersByName("john");
    for (User user : users) {
      printResult(user);     
    }
    User user = service.getUserByEmail("nabeelmukhtar@yahoo.com");
    printResult(user);
  }
View Full Code Here

   * @param args
   *            the arguments
   */
  public static void main(String[] args) {
    GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
    CommitService service = factory.createCommitService();
   
    List<Commit> commits = service.getCommits("facebook", "tornado", Repository.MASTER, "setup.py");
    System.out.println(commits.size());
    for (Commit commit : commits) {
      printResult(commit);
    }
    Commit commit = service.getCommit("facebook", "tornado", "7b80c2f4db226d6fa3a7");
    printResult(commit);
  }
View Full Code Here

   * @param args
   *            the arguments
   */
  public static void main(String[] args) {
    GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
    FeedService service = factory.createFeedService();
    Feed feed = service.getPublicUserFeed("apache", 10);
    printResult(feed);
  }
View Full Code Here

TOP

Related Classes of com.github.api.v2.schema.Feed

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.