Class GitHubTemplate

  • All Implemented Interfaces:
    ApiBinding, GitHub

    public class GitHubTemplate
    extends AbstractOAuth2ApiBinding
    implements GitHub

    The central class for interacting with GitHub.

    Author:
    Craig Walls, Willie Wheeler (willie.wheeler@gmail.com)
    • Constructor Detail

      • GitHubTemplate

        public GitHubTemplate()
        No-arg constructor to support cases in which you want to call the GitHub API without requiring authorization. This is useful for public operations, such as getting the list of watchers for a public repository.
      • GitHubTemplate

        public GitHubTemplate​(String accessToken)
        Constructs a GitHubTemplate with the minimal amount of information required to sign requests with an OAuth Authorization header.
        Parameters:
        accessToken - An access token granted to the application after OAuth authentication.
    • Method Detail

      • gistOperations

        public GistOperations gistOperations()
        Description copied from interface: GitHub
        Returns the portion of the GitHub API containing the gist operations.
        Specified by:
        gistOperations in interface GitHub
        Returns:
        gist operations
      • repoOperations

        public RepoOperations repoOperations()
        Description copied from interface: GitHub
        Returns the portion of the GitHub API containing the repo operations.
        Specified by:
        repoOperations in interface GitHub
        Returns:
        repo operations
      • userOperations

        public UserOperations userOperations()
        Description copied from interface: GitHub
        Returns the portion of the GitHub API containing the user operations.
        Specified by:
        userOperations in interface GitHub
        Returns:
        user operations
      • restOperations

        public org.springframework.web.client.RestOperations restOperations()
        Description copied from interface: GitHub
        Returns the underlying RestOperations object allowing for consumption of GitHub endpoints that may not be otherwise covered by the API binding. The RestOperations object returned is configured to include an OAuth "Authorization" header on all requests.
        Specified by:
        restOperations in interface GitHub
        Returns:
        RestOperations