public async Task <Branch> SetDefault(string projectKey, string repositorySlug, Branch branch) { string requestUrl = UrlBuilder.FormatRestApiUrl(BRANCHES_DEFAULT, null, projectKey, repositorySlug); Branch response = await _httpWorker.PutAsync(requestUrl, branch).ConfigureAwait(false); return(response); }
// todo: extend with hook settings public async Task <Hook> EnableHook(string projectKey, string repositorySlug, string hookKey) { string requestUrl = UrlBuilder.FormatRestApiUrl(HOOK_ENABLE, null, projectKey, repositorySlug, hookKey); Hook response = await _httpWorker.PutAsync <Hook>(requestUrl, null); return(response); }
/// <summary> /// Update the title, description, reviewers or destination branch of an existing pull request. /// </summary> /// <param name="pullRequest"></param> /// <param name="projectKey"></param> /// <returns>Updated pull request</returns> public async Task <PullRequest> Update(PullRequest pullRequest, string projectKey, string slug) { string requestUrl = UrlBuilder.FormatRestApiUrl(PULL_REQUEST_UPDATE, null, projectKey, slug, pullRequest.Id); PullRequest updatedPullRequest = await _httpWorker.PutAsync(requestUrl, pullRequest, true).ConfigureAwait(false); return(updatedPullRequest); }
public async Task GrantGroup(string projectKey, string repository, string group, RepositoryPermissions permission) { string requestUrl = UrlBuilder.FormatRestApiUrl(PERMISSION_GRANT_GROUP, null, projectKey, repository, permission.ToString(), group); await _httpWorker.PutAsync <Object>(requestUrl, new Object()).ConfigureAwait(false); }
public async Task Update(string projectKey, string repositorySlug, DefaultReviewerCondition condition) { string requestUrl = UrlBuilder.FormatRestApiUrl(ONE_CONDITION, null, projectKey, repositorySlug, condition.Id); await _httpWorker.PutAsync <Object>(requestUrl, condition).ConfigureAwait(false); }
public async Task Set(string projectKey, string repositorySlug, string username, string repoPermission) { var requestUrl = UrlBuilder.FormatRestApiUrl(PutUrl, null, projectKey, repositorySlug, username, repoPermission); await _httpWorker.PutAsync <RepoPermission>(requestUrl, null).ConfigureAwait(false); }