diff --git a/NGitLab.Mock/Clients/PipelineScheduleClient.cs b/NGitLab.Mock/Clients/PipelineScheduleClient.cs index 5325b16e..f4df22c5 100644 --- a/NGitLab.Mock/Clients/PipelineScheduleClient.cs +++ b/NGitLab.Mock/Clients/PipelineScheduleClient.cs @@ -6,6 +6,7 @@ using NGitLab.Models; namespace NGitLab.Mock.Clients; + internal class PipelineScheduleClient : ClientBase, IPipelineScheduleClient { private readonly ProjectId _projectId; diff --git a/NGitLab/IPipelineScheduleClient.cs b/NGitLab/IPipelineScheduleClient.cs index b6d3704d..312e0834 100644 --- a/NGitLab/IPipelineScheduleClient.cs +++ b/NGitLab/IPipelineScheduleClient.cs @@ -8,19 +8,19 @@ namespace NGitLab; public interface IPipelineScheduleClient { /// - /// All the scheduled pipelines of the project + /// Gets all the pipeline schedules of the project /// IEnumerable All { get; } /// - /// Return the details of single schedule + /// Details of single schedule /// /// Schedule Id /// PipelineSchedule this[int id] { get; } /// - /// Return the details of single schedule + /// Gets the details of single schedule /// /// Schedule Id /// @@ -28,14 +28,14 @@ public interface IPipelineScheduleClient Task GetByIdAsync(int id, CancellationToken cancellationToken = default); /// - /// All the scheduled pipelines of the project + /// Gets all the pipeline schedules of the project /// /// /// GitLabCollectionResponse GetAllAsync(); /// - /// Get all pipelines triggered by a pipeline schedule in a project. + /// Gets all pipelines triggered by a pipeline schedule in a project. /// /// Schedule Id /// diff --git a/NGitLab/Impl/PipelineScheduleClient.cs b/NGitLab/Impl/PipelineScheduleClient.cs index 5b16f766..be3548ab 100644 --- a/NGitLab/Impl/PipelineScheduleClient.cs +++ b/NGitLab/Impl/PipelineScheduleClient.cs @@ -9,15 +9,13 @@ namespace NGitLab.Impl; internal class PipelineScheduleClient : IPipelineScheduleClient { private readonly API _api; - - private readonly string _projectPath; private readonly string _schedulesPath; public PipelineScheduleClient(API api, ProjectId projectId) { _api = api; - _projectPath = $"{Project.Url}/{projectId.ValueAsUriParameter()}"; - _schedulesPath = $"{_projectPath}/pipeline_schedules"; + var projectPath = $"{Project.Url}/{projectId.ValueAsUriParameter()}"; + _schedulesPath = $"{projectPath}/pipeline_schedules"; } public PipelineSchedule this[int id] => _api.Get().To($"{_schedulesPath}/{id.ToStringInvariant()}"); diff --git a/NGitLab/Models/PipelineSchedule.cs b/NGitLab/Models/PipelineSchedule.cs index 0b167fca..64624343 100644 --- a/NGitLab/Models/PipelineSchedule.cs +++ b/NGitLab/Models/PipelineSchedule.cs @@ -1,41 +1,13 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Text.Json.Serialization; namespace NGitLab.Models; -public class PipelineSchedule +public class PipelineSchedule : PipelineScheduleBasic { - [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("last_pipeline")] public PipelineBasic LastPipeline { get; set; } - [JsonPropertyName("owner")] - public User Owner { get; set; } - [JsonPropertyName("variables")] public IEnumerable Variables { get; set; } } diff --git a/NGitLab/PublicAPI.Unshipped.txt b/NGitLab/PublicAPI.Unshipped.txt index f9361cc8..a9dbce1f 100644 --- a/NGitLab/PublicAPI.Unshipped.txt +++ b/NGitLab/PublicAPI.Unshipped.txt @@ -2909,27 +2909,9 @@ NGitLab.Models.PipelineQuery.Username.set -> void NGitLab.Models.PipelineQuery.YamlErrors.get -> bool? NGitLab.Models.PipelineQuery.YamlErrors.set -> void NGitLab.Models.PipelineSchedule -NGitLab.Models.PipelineSchedule.Active.get -> bool -NGitLab.Models.PipelineSchedule.Active.set -> void -NGitLab.Models.PipelineSchedule.CreatedAt.get -> System.DateTime -NGitLab.Models.PipelineSchedule.CreatedAt.set -> void -NGitLab.Models.PipelineSchedule.Cron.get -> string -NGitLab.Models.PipelineSchedule.Cron.set -> void -NGitLab.Models.PipelineSchedule.Description.get -> string -NGitLab.Models.PipelineSchedule.Description.set -> void -NGitLab.Models.PipelineSchedule.Id.get -> int -NGitLab.Models.PipelineSchedule.Id.set -> void NGitLab.Models.PipelineSchedule.LastPipeline.get -> NGitLab.Models.PipelineBasic NGitLab.Models.PipelineSchedule.LastPipeline.set -> void -NGitLab.Models.PipelineSchedule.NextRunAt.get -> System.DateTime -NGitLab.Models.PipelineSchedule.NextRunAt.set -> void -NGitLab.Models.PipelineSchedule.Owner.get -> NGitLab.Models.User -NGitLab.Models.PipelineSchedule.Owner.set -> void NGitLab.Models.PipelineSchedule.PipelineSchedule() -> void -NGitLab.Models.PipelineSchedule.Ref.get -> string -NGitLab.Models.PipelineSchedule.Ref.set -> void -NGitLab.Models.PipelineSchedule.UpdatedAt.get -> System.DateTime -NGitLab.Models.PipelineSchedule.UpdatedAt.set -> void NGitLab.Models.PipelineSchedule.Variables.get -> System.Collections.Generic.IEnumerable NGitLab.Models.PipelineSchedule.Variables.set -> void NGitLab.Models.PipelineScheduleBasic