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));
                }
        }
示例#2
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));
                }
        }