public Task <CodeBucket.Client.Collection <Commit> > GetAll(string username, string repository, string branch = "default") { var uri = $"{BitbucketClient.ApiUrl2}/repositories/{Uri.EscapeDataString(username)}/{Uri.EscapeDataString(repository)}" + $"/commits/{Uri.EscapeDataString(branch)}"; return(_client.Get <CodeBucket.Client.Collection <Commit> >(uri)); }
public static async Task ForAllItems <T>(this BitbucketClient client, Func <BitbucketClient, Task <Collection <T> > > operation, Action <IEnumerable <T> > addAction) { var ret = await operation(client); addAction(ret.Values); var next = ret.Next; while (!string.IsNullOrEmpty(next)) { var t = await client.Get <Collection <T> >(next); addAction(t.Values); next = t.Next; } }
public static async Task <IEnumerable <T> > AllItems <T>(this BitbucketClient client, Func <BitbucketClient, Task <Collection <T> > > operation) { var ret = await operation(client); var items = new List <T>(ret.Values); var next = ret.Next; while (!string.IsNullOrEmpty(next)) { var t = await client.Get <Collection <T> >(next); items.AddRange(t.Values); next = t.Next; } return(items); }
public Task <List <Repository> > GetWatched() { var uri = $"{BitbucketClient.ApiUrl}/user/follows"; return(_client.Get <List <Repository> >(uri)); }