Example #1
0
        public virtual async Task <Paged <MergeRequest> > MergeRequests(MergeRequestSearchArgs args)
        {
            var request = new RestRequest("/merge_requests", Method.GET)
                          .AddQueryParameter("state", args.State)
                          .AddQueryParameter("order_by", args.OrderBy)
                          .AddQueryParameter("sort", args.Sort)
                          .AddQueryParameter("search", args.Search)
                          .AddQueryParameter("scope", args.Scope)
                          .AddQueryParameter("page", args.Page.ToString());

            var response = await _client.ExecuteTaskAsync <List <GitLabMergeRequest> >(request);

            var items = response.Data.Select(mr => new MergeRequest
            {
                Author = new UserInfo
                {
                    Username  = mr.Author.Username,
                    Name      = mr.Author.Name,
                    AvatarUrl = mr.Author.AvatarUrl
                },
                Description  = mr.Description,
                Id           = mr.Iid,
                MergeStatus  = mr.MergeStatus,
                ProjectId    = mr.ProjectId,
                State        = mr.State,
                Title        = mr.Title,
                WebUrl       = mr.WebUrl,
                SourceBranch = mr.SourceBranch,
                TargetBranch = mr.TargetBranch
            }).ToList();

            return(new Paged <MergeRequest>
            {
                Items = items,
                Page = int.Parse(response.Headers.Single(x => x.Name == "X-Page").Value.ToString()),
                PerPage = int.Parse(response.Headers.Single(x => x.Name == "X-Per-Page").Value.ToString()),
                TotalPages = int.Parse(response.Headers.Single(x => x.Name == "X-Total-Pages").Value.ToString()),
                TotalItems = int.Parse(response.Headers.Single(x => x.Name == "X-Total").Value.ToString()),
            });
        }
Example #2
0
 public override async Task <Paged <MergeRequest> > MergeRequests(MergeRequestSearchArgs args)
 {
     return(await base.MergeRequests(args));
 }
Example #3
0
 public GetReviewList(MergeRequestSearchArgs args)
 {
     Args = args;
 }