コード例 #1
0
 public Task <GitHubResponse <Account> > User(string login, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(TryWithFallback(
                (actor, cache) => actor.User(login, cache, priority),
                cacheOptions
                ));
 }
コード例 #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
                ));
 }
コード例 #3
0
ファイル: GitHubActor.cs プロジェクト: sorrycc/shiphub-server
        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));
        }
コード例 #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
                ));
 }
コード例 #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
                ));
 }
コード例 #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
                ));
 }
コード例 #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
                ));
 }
コード例 #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
                ));
 }
コード例 #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
                ));
 }
コード例 #10
0
ファイル: GitHubActor.cs プロジェクト: sorrycc/shiphub-server
 public Task <GitHubResponse <IEnumerable <Project> > > OrganizationProjects(string organizationLogin, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(Projects($"orgs/{organizationLogin}/projects", cacheOptions, priority));
 }
コード例 #11
0
ファイル: GitHubActor.cs プロジェクト: sorrycc/shiphub-server
 public Task <GitHubResponse <IEnumerable <Project> > > RepositoryProjects(string repoFullName, GitHubCacheDetails cacheOptions, RequestPriority priority)
 {
     return(Projects($"repos/{repoFullName}/projects", cacheOptions, priority));
 }
コード例 #12
0
ファイル: GitHubActor.cs プロジェクト: sorrycc/shiphub-server
        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));
        }
コード例 #13
0
ファイル: GitHubActor.cs プロジェクト: sorrycc/shiphub-server
        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));
        }
コード例 #14
0
ファイル: GitHubActor.cs プロジェクト: sorrycc/shiphub-server
        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));
        }
コード例 #15
0
ファイル: GitHubActor.cs プロジェクト: sorrycc/shiphub-server
        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));
        }