コード例 #1
0
        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));
        }
コード例 #2
0
    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;
        }
    }
コード例 #3
0
    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);
    }
コード例 #4
0
        public Task <List <Repository> > GetWatched()
        {
            var uri = $"{BitbucketClient.ApiUrl}/user/follows";

            return(_client.Get <List <Repository> >(uri));
        }