Skip to content

Commit 457a07a

Browse files
authored
Add per_page support for EventQuery (#36)
1 parent 5d317be commit 457a07a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

NGitLab/Impl/EventClient.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ public EventClient(API api, string baseUrl)
1616

1717
public IEnumerable<Event> Get(EventQuery query)
1818
{
19-
string url = _baseUrl;
19+
var url = _baseUrl;
2020

2121
url = Utils.AddParameter(url, "action", query.Action);
2222
url = Utils.AddParameter(url, "target_type", query.Type);
2323
url = Utils.AddParameter(url, "before", query.Before?.Date);
2424
url = Utils.AddParameter(url, "after", query.After?.Date);
2525
url = Utils.AddParameter(url, "scope", query.Scope);
2626
url = Utils.AddParameter(url, "sort", query.Sort);
27+
url = Utils.AddParameter(url, "per_page", query.PerPage);
2728

2829
return _api.Get().GetAll<Event>(url);
2930
}

NGitLab/Models/EventQuery.cs

+5
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,10 @@ public class EventQuery
3838
/// Sort events in asc or desc order by created_at. Default is desc
3939
/// </summary>
4040
public string Sort { get; set; }
41+
42+
/// <summary>
43+
/// Specifies how many records per page (GitLab supports a maximum of 100 items per page and defaults to 20).
44+
/// </summary>
45+
public int? PerPage { get; set; }
4146
}
4247
}

0 commit comments

Comments
 (0)