Package com.github.api.v2.schema

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


  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

   * @param args
   *            the arguments
   */
  public static void main(String[] args) {
    GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
    GistService service = factory.createGistService();
    Gist gist = service.getGist("289179");
    printResult(gist);
    System.out.println(convertStreamToString(service.getGistContent("289179", "TimeZoneDSTUtil.java")));
  }
View Full Code Here

   */
  protected JsonElement unmarshallList(InputStream jsonContent) {
        try {
          return parser.parse(new InputStreamReader(jsonContent, UTF_8_CHAR_SET));
        } catch (Exception e) {
            throw new GitHubException(e);
        } finally {
          closeStream(jsonContent);
      }
  }
View Full Code Here

          request.connect();
          maxRateLimit = request.getHeaderFieldInt(ApplicationConstants.MAX_RATE_LIMIT_HEADER, -1);
          currentRateLimit = request.getHeaderFieldInt(ApplicationConstants.CURRENT_RATE_LIMIT_HEADER, -1);
         
          if (request.getResponseCode() != expected) {
              throw new GitHubException(convertStreamToString(getWrappedInputStream(request.getErrorStream(),
                        GZIP_ENCODING.equalsIgnoreCase(request.getContentEncoding()))));
          } else {
              return getWrappedInputStream(request.getInputStream(),
                                           GZIP_ENCODING.equalsIgnoreCase(request.getContentEncoding()));
          }
      } catch (IOException e) {
          throw new GitHubException(e);
      }
  }
View Full Code Here

            request.connect();
          maxRateLimit = request.getHeaderFieldInt(ApplicationConstants.MAX_RATE_LIMIT_HEADER, -1);
          currentRateLimit = request.getHeaderFieldInt(ApplicationConstants.CURRENT_RATE_LIMIT_HEADER, -1);
           
            if (request.getResponseCode() != expected) {
              throw new GitHubException(convertStreamToString(getWrappedInputStream(request.getErrorStream(),
                        GZIP_ENCODING.equalsIgnoreCase(request.getContentEncoding()))));
            } else {
                return getWrappedInputStream(request.getInputStream(),
                        GZIP_ENCODING.equalsIgnoreCase(request.getContentEncoding()));
            }
    } catch (IOException e) {
      throw new GitHubException(e);
    } finally {
    }
  }
View Full Code Here

TOP

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

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.