public async Task <IEnumerable <Snippet> > GetWorkspaceSnippetsAsync(string workspaceId, Roles?role = null, int?maxPages = null)
        {
            var queryParamValues = new Dictionary <string, object>
            {
                [nameof(role)] = RolesConverter.ConvertToString(role)
            };

            return(await GetPagedResultsAsync(maxPages, queryParamValues, async qpv =>
                                              await GetSnippetsUrl(workspaceId)
                                              .SetQueryParams(qpv)
                                              .GetJsonAsync <PagedResults <Snippet> >()
                                              .ConfigureAwait(false))
                   .ConfigureAwait(false));
        }
예제 #2
0
        public async Task <IEnumerable <Repository> > GetWorkspaceRepositoriesAsync(string workspaceId, int?maxPages = null, Roles?role = null, string q = null, string sort = null)
        {
            var queryParamValues = new Dictionary <string, object>
            {
                [nameof(role)] = RolesConverter.ConvertToString(role),
                [nameof(q)]    = q,
                [nameof(sort)] = sort
            };

            return(await GetPagedResultsAsync(maxPages, queryParamValues, async qpv =>
                                              await GetRepositoriesUrl($"/{workspaceId}")
                                              .SetQueryParams(qpv)
                                              .GetJsonAsync <PagedResults <Repository> >()
                                              .ConfigureAwait(false))
                   .ConfigureAwait(false));
        }