Beispiel #1
0
 public Task <GitHubResponse <Account> > User(string login, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(TryWithFallback(
                (actor, cache) => actor.User(login, cache, priority),
                cacheOptions
                ));
 }
Beispiel #2
0
 public Task <GitHubResponse <Issue> > Issue(string repoFullName, int number, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(TryWithFallback(
                (actor, cache) => actor.Issue(repoFullName, number, cache, priority),
                cacheOptions
                ));
 }
Beispiel #3
0
        public Task <GitHubResponse <Issue> > Issue(string repoFullName, int number, GitHubCacheDetails cacheOptions, RequestPriority priority)
        {
            var request = new GitHubRequest($"repos/{repoFullName}/issues/{number}", cacheOptions, priority)
            {
                // https://developer.github.com/v3/issues/#reactions-summary
                AcceptHeaderOverride = "application/vnd.github.squirrel-girl-preview+json"
            };

            return(EnqueueRequest <Issue>(request));
        }
Beispiel #4
0
 public Task <GitHubResponse <IDictionary <string, JToken> > > BranchProtection(string repoFullName, string branchName, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(TryWithFallback(
                (actor, cache) => actor.BranchProtection(repoFullName, branchName, cache, priority),
                cacheOptions
                ));
 }
Beispiel #5
0
 public Task <GitHubResponse <IEnumerable <CommitStatus> > > CommitStatuses(string repoFullName, string reference, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(TryWithFallback(
                (actor, cache) => actor.CommitStatuses(repoFullName, reference, cache, priority),
                cacheOptions
                ));
 }
Beispiel #6
0
 public Task <GitHubResponse <Commit> > Commit(string repoFullName, string hash, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(TryWithFallback(
                (actor, cache) => actor.Commit(repoFullName, hash, cache, priority),
                cacheOptions
                ));
 }
Beispiel #7
0
 public Task <GitHubResponse <IEnumerable <IssueComment> > > IssueComments(string repoFullName, int issueNumber, DateTimeOffset?since, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(TryWithFallback(
                (actor, cache) => actor.IssueComments(repoFullName, issueNumber, since, cache, priority),
                cacheOptions
                ));
 }
Beispiel #8
0
 public Task <GitHubResponse <IssueComment> > IssueComment(string repoFullName, long commentId, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(TryWithFallback(
                (actor, cache) => actor.IssueComment(repoFullName, commentId, cache, priority),
                cacheOptions
                ));
 }
Beispiel #9
0
 public Task <GitHubResponse <IEnumerable <Account> > > Assignable(string repoFullName, uint hardPageLimit, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(TryWithFallback(
                (actor, cache) => actor.Assignable(repoFullName, hardPageLimit, cache, priority),
                cacheOptions
                ));
 }
Beispiel #10
0
 public Task <GitHubResponse <IEnumerable <Project> > > OrganizationProjects(string organizationLogin, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(Projects($"orgs/{organizationLogin}/projects", cacheOptions, priority));
 }
Beispiel #11
0
 public Task <GitHubResponse <IEnumerable <Project> > > RepositoryProjects(string repoFullName, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(Projects($"repos/{repoFullName}/projects", cacheOptions, priority));
 }
Beispiel #12
0
        private Task <GitHubResponse <IEnumerable <Project> > > Projects(string endpoint, GitHubCacheDetails cacheOptions, RequestPriority priority)
        {
            var request = new GitHubRequest(endpoint, cacheOptions, priority)
            {
                AcceptHeaderOverride = "application/vnd.github.inertia-preview.iso8601+json",
            };

            return(FetchPaged(request, (Project p) => p.Id));
        }
Beispiel #13
0
        public Task <GitHubResponse <byte[]> > FileContents(string repoFullName, string filePath, GitHubCacheDetails cacheOptions, RequestPriority priority)
        {
            if (!filePath.StartsWith("/", StringComparison.Ordinal))
            {
                filePath = "/" + filePath;
            }
            var request = new GitHubRequest($"repos/{repoFullName}/contents{filePath}", cacheOptions, priority);

            return(EnqueueRequest <byte[]>(request));
        }
Beispiel #14
0
        public Task <GitHubResponse <IEnumerable <ContentsFile> > > ListDirectoryContents(string repoFullName, string directoryPath, GitHubCacheDetails cacheOptions, RequestPriority priority)
        {
            if (!directoryPath.StartsWith("/", StringComparison.Ordinal))
            {
                directoryPath = "/" + directoryPath;
            }
            var request = new GitHubRequest($"repos/{repoFullName}/contents{directoryPath}", cacheOptions, priority);

            return(FetchPaged(request, (ContentsFile f) => f.Path));
        }
Beispiel #15
0
        public Task <GitHubResponse <IEnumerable <Webhook> > > RepositoryWebhooks(string repoFullName, GitHubCacheDetails cacheOptions, RequestPriority priority)
        {
            var request = new GitHubRequest($"repos/{repoFullName}/hooks", cacheOptions, priority);

            return(FetchPaged(request, (Webhook x) => x.Id));
        }