Skip to content

Commit

Permalink
Remove redundant stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-z committed Dec 13, 2024
1 parent 53a3528 commit e601e46
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 79 deletions.
8 changes: 1 addition & 7 deletions NGitLab/Models/ApprovalRuleCreate.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace NGitLab.Models;

public class ApprovalRuleCreate
{
// Unnecessary in the POSTed JSON; the 'Project Id' is actually specified through the endpoint URL.
[EditorBrowsable(EditorBrowsableState.Never)]
[JsonIgnore]
public long Id { get; set; }

/// <summary>
/// Type of the rule.
/// </summary>
Expand Down
8 changes: 1 addition & 7 deletions NGitLab/Models/ApprovalRuleUpdate.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace NGitLab.Models;

public sealed class ApprovalRuleUpdate
{
// Unnecessary in the PUT JSON; the 'Project Id' is actually specified through the endpoint URL.
[EditorBrowsable(EditorBrowsableState.Never)]
[JsonIgnore]
public long Id { get; set; }

/// <summary>
/// The name of the approval rule.
/// </summary>
Expand Down
6 changes: 0 additions & 6 deletions NGitLab/Models/CommitCreate.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace NGitLab.Models;

public class CommitCreate
{
// Unnecessary in the POSTed JSON; the 'Project Id' is actually specified through the endpoint URL.
[EditorBrowsable(EditorBrowsableState.Never)]
[JsonIgnore]
public long ProjectId;

[Required]
[JsonPropertyName("branch")]
public string Branch;
Expand Down
10 changes: 2 additions & 8 deletions NGitLab/Models/CommitStatus.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
using System.ComponentModel;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization;

namespace NGitLab.Models;

public class CommitStatus
{
// This is NOT the 'Project Id', but some kind of (undocumented) 'Commit Status Id'
[EditorBrowsable(EditorBrowsableState.Never)]
[JsonIgnore]
public long ProjectId;

[JsonPropertyName("id")]
public long Id { get => ProjectId; set => ProjectId = value; }
public long Id { get; set; }

[JsonPropertyName("sha")]
public string CommitSha;
Expand Down
8 changes: 1 addition & 7 deletions NGitLab/Models/CommitStatusCreate.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using System.ComponentModel;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization;

namespace NGitLab.Models;

public class CommitStatusCreate
{
// Unnecessary in the POSTed JSON; the 'Project Id' is actually specified through the endpoint URL.
[EditorBrowsable(EditorBrowsableState.Never)]
[JsonIgnore]
public long ProjectId;

[JsonPropertyName("sha")]
public string CommitSha;

Expand Down
2 changes: 0 additions & 2 deletions NGitLab/Models/Deployment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

namespace NGitLab.Models;

#pragma warning disable CA1724 // Type names should not match .NET Framework class library namespaces
public class Deployment
#pragma warning restore CA1724 // Type names should not match .NET Framework class library namespaces
{
[JsonPropertyName("id")]
public long Id { get; set; }
Expand Down
8 changes: 1 addition & 7 deletions NGitLab/Models/EpicEdit.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace NGitLab.Models;

public class EpicEdit
{
// Unnecessary in the PUT JSON
[EditorBrowsable(EditorBrowsableState.Never)]
[JsonIgnore]
public long Id { get; set; }

[Required]
[JsonPropertyName("epic_iid")]
public long EpicId { get; set; }
Expand Down
7 changes: 1 addition & 6 deletions NGitLab/Models/IssueCreate.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using NGitLab.Impl.Json;
Expand All @@ -9,11 +8,7 @@ namespace NGitLab.Models;
public class IssueCreate
{
[JsonIgnore]
public long ProjectId { get => Id; set => Id = value; }

[EditorBrowsable(EditorBrowsableState.Never)]
[JsonIgnore]
public long Id;
public long ProjectId { get; set; }

[Required]
[JsonPropertyName("title")]
Expand Down
7 changes: 1 addition & 6 deletions NGitLab/Models/IssueEdit.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using NGitLab.Impl.Json;
Expand All @@ -9,11 +8,7 @@ namespace NGitLab.Models;
public class IssueEdit
{
[JsonIgnore]
public long ProjectId { get => Id; set => Id = value; }

[EditorBrowsable(EditorBrowsableState.Never)]
[JsonIgnore]
public long Id;
public long ProjectId { get; set; }

[Required]
[JsonPropertyName("issue_id")]
Expand Down
10 changes: 0 additions & 10 deletions NGitLab/Models/LabelEdit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ namespace NGitLab.Models;
[EditorBrowsable(EditorBrowsableState.Never)]
public class LabelEdit
{
public LabelEdit()
{
}

public LabelEdit(long projectId, Label label)
{
Id = projectId;
Name = label.Name;
}

[JsonIgnore]
public long Id;

Expand Down
14 changes: 1 addition & 13 deletions NGitLab/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1242,8 +1242,6 @@ NGitLab.Models.ApprovalRuleCreate.ApprovalsRequired.get -> int
NGitLab.Models.ApprovalRuleCreate.ApprovalsRequired.set -> void
NGitLab.Models.ApprovalRuleCreate.GroupIds.get -> long[]
NGitLab.Models.ApprovalRuleCreate.GroupIds.set -> void
NGitLab.Models.ApprovalRuleCreate.Id.get -> long
NGitLab.Models.ApprovalRuleCreate.Id.set -> void
NGitLab.Models.ApprovalRuleCreate.Name.get -> string
NGitLab.Models.ApprovalRuleCreate.Name.set -> void
NGitLab.Models.ApprovalRuleCreate.ProtectedBranchIds.get -> long[]
Expand All @@ -1260,8 +1258,6 @@ NGitLab.Models.ApprovalRuleUpdate.ApprovalsRequired.get -> int
NGitLab.Models.ApprovalRuleUpdate.ApprovalsRequired.set -> void
NGitLab.Models.ApprovalRuleUpdate.GroupIds.get -> long[]
NGitLab.Models.ApprovalRuleUpdate.GroupIds.set -> void
NGitLab.Models.ApprovalRuleUpdate.Id.get -> long
NGitLab.Models.ApprovalRuleUpdate.Id.set -> void
NGitLab.Models.ApprovalRuleUpdate.Name.get -> string
NGitLab.Models.ApprovalRuleUpdate.Name.set -> void
NGitLab.Models.ApprovalRuleUpdate.ProtectedBranchIds.get -> long[]
Expand Down Expand Up @@ -1436,7 +1432,6 @@ NGitLab.Models.CommitCreate.Branch -> string
NGitLab.Models.CommitCreate.CommitCreate() -> void
NGitLab.Models.CommitCreate.CommitMessage -> string
NGitLab.Models.CommitCreate.Force -> bool?
NGitLab.Models.CommitCreate.ProjectId -> long
NGitLab.Models.CommitCreate.StartBranch -> string
NGitLab.Models.CommitCreate.StartSha -> string
NGitLab.Models.CommitInfo
Expand Down Expand Up @@ -1472,7 +1467,6 @@ NGitLab.Models.CommitStatus.Description -> string
NGitLab.Models.CommitStatus.Id.get -> long
NGitLab.Models.CommitStatus.Id.set -> void
NGitLab.Models.CommitStatus.Name -> string
NGitLab.Models.CommitStatus.ProjectId -> long
NGitLab.Models.CommitStatus.Ref -> string
NGitLab.Models.CommitStatus.Status -> string
NGitLab.Models.CommitStatus.TargetUrl -> string
Expand All @@ -1483,7 +1477,6 @@ NGitLab.Models.CommitStatusCreate.Coverage -> int?
NGitLab.Models.CommitStatusCreate.Description -> string
NGitLab.Models.CommitStatusCreate.Name -> string
NGitLab.Models.CommitStatusCreate.PipelineId -> long?
NGitLab.Models.CommitStatusCreate.ProjectId -> long
NGitLab.Models.CommitStatusCreate.Ref -> string
NGitLab.Models.CommitStatusCreate.State -> string
NGitLab.Models.CommitStatusCreate.Status -> string
Expand Down Expand Up @@ -1668,8 +1661,6 @@ NGitLab.Models.EpicEdit.Description.set -> void
NGitLab.Models.EpicEdit.EpicEdit() -> void
NGitLab.Models.EpicEdit.EpicId.get -> long
NGitLab.Models.EpicEdit.EpicId.set -> void
NGitLab.Models.EpicEdit.Id.get -> long
NGitLab.Models.EpicEdit.Id.set -> void
NGitLab.Models.EpicEdit.Labels.get -> string
NGitLab.Models.EpicEdit.Labels.set -> void
NGitLab.Models.EpicEdit.State.get -> string
Expand Down Expand Up @@ -2080,7 +2071,6 @@ NGitLab.Models.IssueCreate.Confidential -> bool
NGitLab.Models.IssueCreate.Description -> string
NGitLab.Models.IssueCreate.DueDate -> System.DateTime?
NGitLab.Models.IssueCreate.EpicId -> long?
NGitLab.Models.IssueCreate.Id -> long
NGitLab.Models.IssueCreate.IssueCreate() -> void
NGitLab.Models.IssueCreate.Labels -> string
NGitLab.Models.IssueCreate.MileStoneId -> long?
Expand All @@ -2093,7 +2083,6 @@ NGitLab.Models.IssueEdit.AssigneeIds -> long[]
NGitLab.Models.IssueEdit.Description -> string
NGitLab.Models.IssueEdit.DueDate -> System.DateTime?
NGitLab.Models.IssueEdit.EpicId -> long?
NGitLab.Models.IssueEdit.Id -> long
NGitLab.Models.IssueEdit.IssueEdit() -> void
NGitLab.Models.IssueEdit.IssueId -> long
NGitLab.Models.IssueEdit.Labels -> string
Expand Down Expand Up @@ -2300,7 +2289,6 @@ NGitLab.Models.LabelEdit.Color -> string
NGitLab.Models.LabelEdit.Description -> string
NGitLab.Models.LabelEdit.Id -> long
NGitLab.Models.LabelEdit.LabelEdit() -> void
NGitLab.Models.LabelEdit.LabelEdit(long projectId, NGitLab.Models.Label label) -> void
NGitLab.Models.LabelEdit.Name -> string
NGitLab.Models.LabelEdit.NewName -> string
NGitLab.Models.LastActivityDate
Expand Down Expand Up @@ -4177,4 +4165,4 @@ virtual NGitLab.Impl.HttpRequestor.To<T>(string tailAPIUrl) -> T
virtual NGitLab.Impl.HttpRequestor.ToAsync<T>(string tailAPIUrl, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<T>
virtual NGitLab.RequestOptions.GetResponse(System.Net.HttpWebRequest request) -> System.Net.WebResponse
virtual NGitLab.RequestOptions.GetResponseAsync(System.Net.HttpWebRequest request, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<System.Net.WebResponse>
virtual NGitLab.RequestOptions.ShouldRetry(System.Exception ex, int retryNumber) -> bool
virtual NGitLab.RequestOptions.ShouldRetry(System.Exception ex, int retryNumber) -> bool

0 comments on commit e601e46

Please sign in to comment.