public async Task <ResponseList <Activity> > GetProjectActivitiesAsync(IdOrKey projectIdOrKey, ActivityQueryParams query = null, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Get(BuildEndpoint($"projects/{projectIdOrKey}/activities"), query, token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateActivityListAsync(response));
         }
 }
 public async Task <ResponseList <User> > GetProjectAdministratorsAsync(IdOrKey projectIdOrKey, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Get(BuildEndpoint($"projects/{projectIdOrKey}/administrators"), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateUserListAsync(response));
         }
 }
 public async Task <ResponseList <Milestone> > GetMilestonesAsync(IdOrKey projectIdOrKey, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Get(BuildEndpoint($"projects/{projectIdOrKey}/versions"), token: token))
         using (var content = response.Content)
         {
             return(new ResponseListImpl <Milestone>((await Factory.CreateMilestoneListAsync(response)).Where(x => !x.Archived)));
         }
 }
 public async Task <ResponseList <CustomFieldSetting> > GetCustomFieldsAsync(IdOrKey projectIdOrKey, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Get(BuildEndpoint($"projects/{projectIdOrKey}/customFields"), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateCustomFieldListAsync(response));
         }
 }
 public async Task <Repository> GetGitRepositoryAsync(IdOrKey projectIdOrKey, IdOrKey repoIdOrName, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Get(BuildEndpoint($"projects/{projectIdOrKey}/git/repositories/{repoIdOrName}"), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateRepositoryAsync(response));
         }
 }
 public async Task <DiskUsageDetail> GetProjectDiskUsageAsync(IdOrKey projectIdOrKey, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Get(BuildEndpoint($"projects/{projectIdOrKey}/diskUsage"), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateDiskUsageDetailAsync(response));
         }
 }
 public async Task <Version> RemoveVersionAsync(IdOrKey projectIdOrKey, long versionId, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Delete(BuildEndpoint($"projects/{projectIdOrKey}/versions/{versionId}"), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateVersionAsync(response));
         }
 }
Exemplo n.º 8
0
 public async Task <int> GetIssueCommentCountAsync(IdOrKey issueIdOrKey, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Get(BuildEndpoint($"issues/{issueIdOrKey}/comments/count"), token: token))
         using (var content = response.Content)
         {
             return((await Factory.CreateCountAsync(response)).CountValue);
         }
 }
Exemplo n.º 9
0
 public async Task <Attachment> DeleteIssueAttachmentAsync(IdOrKey issueIdOrKey, long attachmentId, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Delete(BuildEndpoint($"issues/{issueIdOrKey}/attachments/{attachmentId}"), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateAttachmentAsync(response));
         }
 }
Exemplo n.º 10
0
 public async Task <ResponseList <WikiTag> > GetWikiTagsAsync(IdOrKey projectIdOrKey, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Get(BuildEndpoint("wikis/tags"), new GetWikisParams(projectIdOrKey), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateWikiTagListAsync(response));
         }
 }
Exemplo n.º 11
0
 public async Task <SharedFile> UnlinkIssueSharedFileAsync(IdOrKey issueIdOrKey, long fileId, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Delete(BuildEndpoint($"issues/{issueIdOrKey}/sharedFiles/{fileId}"), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateSharedFileAsync(response));
         }
 }
Exemplo n.º 12
0
 public async Task <ResponseList <IssueComment> > GetIssueCommentsAsync(IdOrKey issueIdOrKey, QueryParams queryParams = null, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Get(BuildEndpoint($"issues/{issueIdOrKey}/comments"), queryParams, token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateIssueCommentListAsync(response));
         }
 }
 public async Task <Category> RemoveCategoryAsync(IdOrKey projectIdOrKey, long categoryId, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Delete(BuildEndpoint($"projects/{projectIdOrKey}/categories/{categoryId}"), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateCategoryAsync(response));
         }
 }
Exemplo n.º 14
0
 public async Task <int> GetWikiCountAsync(IdOrKey projectIdOrKey, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Get(BuildEndpoint("wikis/count"), new GetWikisParams(projectIdOrKey), token: token))
         using (var content = response.Content)
         {
             return((await Factory.CreateCountAsync(response)).CountValue);
         }
 }
 public async Task <CustomFieldSetting> RemoveListCustomFieldItemAsync(IdOrKey projectIdOrKey, long customFieldId, long itemId, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Delete(BuildEndpoint($"projects/{projectIdOrKey}/customFields/{customFieldId}/items/{itemId}"), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateCustomFieldAsync(response));
         }
 }
Exemplo n.º 16
0
 public async Task <ResponseList <Webhook> > GetWebhooksAsync(IdOrKey projectIdOrKey, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Get(BuildEndpoint($"projects/{projectIdOrKey}/webhooks"), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateWebhookListAsync(response));
         }
 }
Exemplo n.º 17
0
 public async Task <ResponseList <Attachment> > GetIssueAttachmentsAsync(IdOrKey issueIdOrKey, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Get(BuildEndpoint($"issues/{issueIdOrKey}/attachments"), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateAttachmentListAsync(response));
         }
 }
Exemplo n.º 18
0
 public async Task <Webhook> DeleteWebhookAsync(IdOrKey projectIdOrKey, long webhookId, CancellationToken?token = default(CancellationToken?))
 {
     using (var response = await Delete(BuildEndpoint($"projects/{projectIdOrKey}/webhooks/{webhookId}"), token: token))
         using (var content = response.Content)
         {
             return(await Factory.CreateWebhookAsync(response));
         }
 }
Exemplo n.º 19
0
        public async Task <ResponseList <SharedFile> > LinkIssueSharedFileAsync(IdOrKey issueIdOrKey, long[] fileIds, CancellationToken?token = default(CancellationToken?))
        {
            var @params = fileIds.Select(x => new NameValuePair("fileId[]", x.ToString())).ToArray();

            using (var response = await Post(BuildEndpoint($"issues/{issueIdOrKey}/sharedFiles"), @params, token: token))
                using (var content = response.Content)
                {
                    return(await Factory.CreateSharedFileListAsync(response));
                }
        }
        public async Task <ResponseList <Repository> > GetGitRepositoriesAsync(IdOrKey projectIdOrKey, CancellationToken?token = default(CancellationToken?))
        {
            var @params = new GetRepositoriesParams(projectIdOrKey.ToString());

            using (var response = await Get(BuildEndpoint("git/repositories"), @params, token: token))
                using (var content = response.Content)
                {
                    return(await Factory.CreateRepositoryListAsync(response));
                }
        }
        public async Task <int> GetPullRequestCommentCountAsync(IdOrKey projectIdOrKey, IdOrKey repoIdOrName, long number, CancellationToken?token = default(CancellationToken?))
        {
            var url = BuildEndpoint($"projects/{projectIdOrKey}/git/repositories/{repoIdOrName}/pullRequests/{number}/comments/count");

            using (var response = await Get(url, token: token))
                using (var content = response.Content)
                {
                    return((await Factory.CreateCountAsync(response)).CountValue);
                }
        }
        public async Task <Attachment> DeletePullRequestAttachmentAsync(IdOrKey projectIdOrKey, IdOrKey repoIdOrName, long number, long attachmentId, CancellationToken?token = default(CancellationToken?))
        {
            var url = BuildEndpoint($"projects/{projectIdOrKey}/git/repositories/{repoIdOrName}/pullRequests/{number}/attachments/{attachmentId}");

            using (var response = await Delete(url, token: token))
                using (var content = response.Content)
                {
                    return(await Factory.CreateAttachmentAsync(response));
                }
        }
        public async Task <User> RemoveProjectAdministratorAsync(IdOrKey projectIdOrKey, long userId, CancellationToken?token = default(CancellationToken?))
        {
            var param = new NameValuePair("userId", userId.ToString());

            using (var response = await Delete(BuildEndpoint($"projects/{projectIdOrKey}/administrators"), param, token: token))
                using (var content = response.Content)
                {
                    return(await Factory.CreateUserAsync(response));
                }
        }
        public async Task <IssueType> RemoveIssueTypeAsync(IdOrKey projectIdOrKey, long issueTypeId, long substituteIssueTypeId, CancellationToken?token = default(CancellationToken?))
        {
            var param = new NameValuePair("substituteIssueTypeId", substituteIssueTypeId.ToString());

            using (var response = await Delete(BuildEndpoint($"projects/{projectIdOrKey}/issueTypes/{issueTypeId}"), param, token: token))
                using (var content = response.Content)
                {
                    return(await Factory.CreateIssueTypeAsync(response));
                }
        }
        public async Task <CustomFieldSetting> AddListCustomFieldItemAsync(IdOrKey projectIdOrKey, long customFieldId, string name, CancellationToken?token = default(CancellationToken?))
        {
            var @params = new[] { new NameValuePair("name", name) };

            using (var response = await Post(BuildEndpoint($"projects/{projectIdOrKey}/customFields/{customFieldId}/items"), @params, token))
                using (var content = response.Content)
                {
                    return(await Factory.CreateCustomFieldAsync(response));
                }
        }
        public async Task <ResponseList <SharedFile> > GetSharedFilesAsync(IdOrKey projectIdOrKey, string path, QueryParams queryParams = null, CancellationToken?token = default(CancellationToken?))
        {
            var encodedPath = WebUtility.UrlEncode(path);

            using (var response = await Get(BuildEndpoint($"projects/{projectIdOrKey}/files/metadata/{encodedPath}"), queryParams, token: token))
                using (var content = response.Content)
                {
                    return(await Factory.CreateSharedFileListAsync(response));
                }
        }
        public async Task <ResponseList <PullRequest> > GetPullRequestsAsync(IdOrKey projectIdOrKey, IdOrKey repoIdOrName, PullRequestQueryParams @params = null, CancellationToken?token = default(CancellationToken?))
        {
            var url = BuildEndpoint($"projects/{projectIdOrKey}/git/repositories/{repoIdOrName}/pullRequests");

            using (var response = await Get(url, @params, token: token))
                using (var content = response.Content)
                {
                    return(await Factory.CreatePullRequestListAsync(response));
                }
        }
        public async Task <User> AddProjectUserAsync(IdOrKey projectIdOrKey, long userId, CancellationToken?token = default(CancellationToken?))
        {
            var @params = new[] { new NameValuePair("userId", userId.ToString()) };

            using (var response = await Post(BuildEndpoint($"projects/{projectIdOrKey}/users"), @params, token))
                using (var content = response.Content)
                {
                    return(await Factory.CreateUserAsync(response));
                }
        }
Exemplo n.º 29
0
        public async Task <Watch> AddWatchToIssueAsync(IdOrKey issueIdOrKey, string note, CancellationToken?token = default(CancellationToken?))
        {
            var @params = new List <NameValuePair>();

            @params.Add(new NameValuePair("issueIdOrKey", issueIdOrKey.ToString()));
            if (note != null)
            {
                @params.Add(new NameValuePair("note", note));
            }
            using (var response = await Post(BuildEndpoint($"watchings"), @params, token: token))
                using (var content = response.Content)
                {
                    return(await Factory.CreateWatchAsync(response));
                }
        }
Exemplo n.º 30
0
 /// <summary>
 /// the endpoint of attachment file.
 /// </summary>
 public string PullRequestAttachmentEndpoint(IdOrKey projectIdOrKey, IdOrKey repoIdOrName, long number, long attachmentId)
 => BuildEndpoint($"projects/{projectIdOrKey}/git/repositories/{repoIdOrName}/pullRequests/{number}/attachments/{attachmentId}");