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)); }
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)); }
protected override string ConvertToString(Roles value) { return(BitbucketHelpers.RoleToString(value)); }