Skip to content

Commit 75aa036

Browse files
authored
Added properties to PipelineQueryOptions. (#124)
1 parent c19e86f commit 75aa036

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

src/GitLabApiClient/Models/Pipelines/Requests/PipelineQueryBuilder.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ protected override void BuildCore(PipelineQueryOptions options)
4545
{
4646
Add("sort", "asc");
4747
}
48+
49+
if (options.UpdatedAfter.HasValue)
50+
{
51+
Add("updated_after", options.UpdatedAfter.Value);
52+
}
53+
54+
if (options.UpdatedBefore.HasValue)
55+
{
56+
Add("updated_before", options.UpdatedBefore.Value);
57+
}
58+
59+
if (!options.TriggeredBy.IsNullOrEmpty())
60+
{
61+
Add("username", options.TriggeredBy);
62+
}
4863
}
4964

5065
#endregion

src/GitLabApiClient/Models/Pipelines/Requests/PipelineQueryOptions.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System;
2+
13
namespace GitLabApiClient.Models.Pipelines.Requests
24
{
35
public class PipelineQueryOptions
@@ -38,5 +40,20 @@ internal PipelineQueryOptions() { }
3840
/// Sort pipelines in asc or desc order (default: desc)
3941
/// </summary>
4042
public SortOrder SortOrder { get; set; } = SortOrder.Descending;
43+
44+
/// <summary>
45+
/// Return pipelines updated after the specified date.
46+
/// </summary>
47+
public DateTime? UpdatedAfter { get; set; }
48+
49+
/// <summary>
50+
/// Return pipelines updated before the specified date
51+
/// </summary>
52+
public DateTime? UpdatedBefore { get; set; }
53+
54+
/// <summary>
55+
/// The username of the user who triggered pipelines
56+
/// </summary>
57+
public string TriggeredBy { get; set; }
4158
}
4259
}

src/GitLabApiClient/Models/Pipelines/Responses/Pipeline.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,11 @@ public class Pipeline
1919

2020
[JsonProperty("web_url")]
2121
public Uri WebUrl { get; set; }
22+
23+
[JsonProperty("created_at")]
24+
public DateTime CreatedAt { get; set; }
25+
26+
[JsonProperty("updated_at")]
27+
public DateTime UpdatedAt { get; set; }
2228
}
2329
}

0 commit comments

Comments
 (0)