예제 #1
0
        public async Task <IEnumerable <PullRequest> > GetDashboardPullRequestsAsync(PullRequestStates?state = null,
                                                                                     Roles?role = null,
                                                                                     List <ParticipantStatus> status = null,
                                                                                     PullRequestOrders?order         = PullRequestOrders.Newest,
                                                                                     int?closedSinceSeconds          = null,
                                                                                     int?maxPages = null,
                                                                                     int?limit    = null,
                                                                                     int?start    = null)
        {
            var queryParamValues = new Dictionary <string, object>
            {
                ["state"]  = BitbucketHelpers.PullRequestStateToString(state),
                ["role"]   = BitbucketHelpers.RoleToString(role),
                ["status"] = status != null?string.Join(",", status.Select(BitbucketHelpers.ParticipantStatusToString)) : null,
                                 ["order"]       = BitbucketHelpers.PullRequestOrderToString(order),
                                 ["closedSince"] = closedSinceSeconds,
                                 ["limit"]       = limit,
                                 ["start"]       = start,
            };

            return(await GetPagedResultsAsync(maxPages, queryParamValues, async qpv =>
                                              await GetDashboardUrl("/pull-requests")
                                              .SetQueryParams(qpv)
                                              .GetJsonAsync <PagedResults <PullRequest> >()
                                              .ConfigureAwait(false))
                   .ConfigureAwait(false));
        }
예제 #2
0
        public async Task <IEnumerable <PullRequest> > GetInboxPullRequestsAsync(
            int?maxPages = null,
            int?limit    = 25,
            int?start    = 0,
            Roles role   = Roles.Reviewer)
        {
            var queryParamValues = new Dictionary <string, object>
            {
                ["limit"] = limit,
                ["start"] = start,
                ["role"]  = BitbucketHelpers.RoleToString(role)
            };

            return(await GetPagedResultsAsync(maxPages, queryParamValues, async qpv =>
                                              await GetInboxUrl("/pull-requests")
                                              .SetQueryParams(qpv)
                                              .GetJsonAsync <PagedResults <PullRequest> >()
                                              .ConfigureAwait(false))
                   .ConfigureAwait(false));
        }
예제 #3
0
 protected override string ConvertToString(Roles value)
 {
     return(BitbucketHelpers.RoleToString(value));
 }