From ce4b5e2ee652388cb39afacbae75bc126dd0523c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Myka=C3=ABl=20Lemieux-Lafontaine?= Date: Thu, 24 Oct 2024 15:56:33 -0400 Subject: [PATCH] Fix detailed PipelineSchedule model deserialization --- NGitLab.Mock/PipelineScheduleCollection.cs | 2 -- NGitLab/Models/PipelineSchedule.cs | 11 +++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/NGitLab.Mock/PipelineScheduleCollection.cs b/NGitLab.Mock/PipelineScheduleCollection.cs index 91e4ac34..3eaa0fc3 100644 --- a/NGitLab.Mock/PipelineScheduleCollection.cs +++ b/NGitLab.Mock/PipelineScheduleCollection.cs @@ -28,8 +28,6 @@ public override void Add(PipelineSchedule schedule) schedule.Id = Server.GetNewPipelineScheduleId(); } - // MLL-TODO Check branch? - base.Add(schedule); } } diff --git a/NGitLab/Models/PipelineSchedule.cs b/NGitLab/Models/PipelineSchedule.cs index 02b2605b..dc02537c 100644 --- a/NGitLab/Models/PipelineSchedule.cs +++ b/NGitLab/Models/PipelineSchedule.cs @@ -1,27 +1,38 @@ using System; using System.Collections.Generic; +using System.Text.Json.Serialization; namespace NGitLab.Models; public class PipelineSchedule { + [JsonPropertyName("id")] public int Id { get; set; } + [JsonPropertyName("description")] public string Description { get; set; } + [JsonPropertyName("ref")] public string Ref { get; set; } + [JsonPropertyName("cron")] public string Cron { get; set; } + [JsonPropertyName("next_run_at")] public DateTime NextRunAt { get; set; } + [JsonPropertyName("active")] public bool Active { get; set; } + [JsonPropertyName("created_at")] public DateTime CreatedAt { get; set; } + [JsonPropertyName("updated_at")] public DateTime UpdatedAt { get; set; } + [JsonPropertyName("owner")] public User Owner { get; set; } + [JsonPropertyName("variables")] public IEnumerable Variables { get; set; } }