Class GitHubClient

java.lang.Object
org.luwrain.io.api.github.GitHubClient
All Implemented Interfaces:
GitHubService

public class GitHubClient extends Object implements GitHubService
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    closeIssue(String repoFullName, int issueNumber)
    Закрыть обсуждение (Issue).
    boolean
    Проверяет соединение и валидность токена.
    void
    createIssue(String repoFullName, String title, String text)
    Создать новое обсуждение (Issue).
    getComments(String repoFullName, int issueNumber)
    Получить комментарии внутри конкретного обсуждения.
    getIssues(String repoFullName)
    Получить список обсуждений (Issues) в репозитории.
    Возвращает список репозиториев текущего пользователя.
    void
    joinRepo(String repoFullName)
    Подписаться на репозиторий (поставить Star).
    void
    leaveRepo(String repoFullName)
    Отписаться от репозитория (убрать Star).
    void
    postComment(String repoFullName, int issueNumber, String text)
    Написать комментарий (ответ) в обсуждение.
    search(String query)
    Ищет репозитории по запросу.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GitHubClient

      public GitHubClient(String token)
  • Method Details

    • connect

      public boolean connect()
      Description copied from interface: GitHubService
      Проверяет соединение и валидность токена.
      Specified by:
      connect in interface GitHubService
      Returns:
      true, если вход успешен.
    • getMyRepos

      public List<Repo> getMyRepos()
      Description copied from interface: GitHubService
      Возвращает список репозиториев текущего пользователя.
      Specified by:
      getMyRepos in interface GitHubService
    • search

      public List<Repo> search(String query)
      Description copied from interface: GitHubService
      Ищет репозитории по запросу.
      Specified by:
      search in interface GitHubService
      Parameters:
      query - поисковый запрос (например, "java tetris")
    • joinRepo

      public void joinRepo(String repoFullName)
      Description copied from interface: GitHubService
      Подписаться на репозиторий (поставить Star).
      Specified by:
      joinRepo in interface GitHubService
      Parameters:
      repoFullName - имя в формате "owner/repo"
    • leaveRepo

      public void leaveRepo(String repoFullName)
      Description copied from interface: GitHubService
      Отписаться от репозитория (убрать Star).
      Specified by:
      leaveRepo in interface GitHubService
    • getIssues

      public List<Issue> getIssues(String repoFullName)
      Description copied from interface: GitHubService
      Получить список обсуждений (Issues) в репозитории.
      Specified by:
      getIssues in interface GitHubService
    • createIssue

      public void createIssue(String repoFullName, String title, String text)
      Description copied from interface: GitHubService
      Создать новое обсуждение (Issue).
      Specified by:
      createIssue in interface GitHubService
    • closeIssue

      public void closeIssue(String repoFullName, int issueNumber)
      Description copied from interface: GitHubService
      Закрыть обсуждение (Issue).
      Specified by:
      closeIssue in interface GitHubService
    • getComments

      public List<Comment> getComments(String repoFullName, int issueNumber)
      Description copied from interface: GitHubService
      Получить комментарии внутри конкретного обсуждения.
      Specified by:
      getComments in interface GitHubService
    • postComment

      public void postComment(String repoFullName, int issueNumber, String text)
      Description copied from interface: GitHubService
      Написать комментарий (ответ) в обсуждение.
      Specified by:
      postComment in interface GitHubService