diff --git a/NGitLab.Mock/Clients/MilestoneClient.cs b/NGitLab.Mock/Clients/MilestoneClient.cs index 9e944ad1..d8b0cf04 100644 --- a/NGitLab.Mock/Clients/MilestoneClient.cs +++ b/NGitLab.Mock/Clients/MilestoneClient.cs @@ -12,7 +12,7 @@ internal sealed class MilestoneClient : ClientBase, IMilestoneClient { private readonly int _resourceId; - public MilestoneClient(ClientContext context, IidOrPathAddressable id, MilestoneScope scope) + public MilestoneClient(ClientContext context, IIdOrPathAddressable id, MilestoneScope scope) : base(context) { _resourceId = scope switch diff --git a/NGitLab/Impl/MilestoneClient.cs b/NGitLab/Impl/MilestoneClient.cs index 5ae363cf..4a4dcb84 100644 --- a/NGitLab/Impl/MilestoneClient.cs +++ b/NGitLab/Impl/MilestoneClient.cs @@ -12,7 +12,7 @@ public class MilestoneClient : IMilestoneClient private readonly API _api; private readonly string _milestonePath; - internal MilestoneClient(API api, MilestoneScope scope, IidOrPathAddressable id) + internal MilestoneClient(API api, MilestoneScope scope, IIdOrPathAddressable id) { _api = api; _milestonePath = $"/{scope.ToString().ToLowerInvariant()}/{id.ValueAsUriParameter()}/milestones"; diff --git a/NGitLab/Models/GroupId.cs b/NGitLab/Models/GroupId.cs index 3af278dc..800daefd 100644 --- a/NGitLab/Models/GroupId.cs +++ b/NGitLab/Models/GroupId.cs @@ -2,14 +2,14 @@ namespace NGitLab.Models { - public readonly struct GroupId : IidOrPathAddressable + public readonly struct GroupId : IIdOrPathAddressable { private readonly long _id; private readonly string _path; - long IidOrPathAddressable.Id => _id; + long IIdOrPathAddressable.Id => _id; - string IidOrPathAddressable.Path => _path; + string IIdOrPathAddressable.Path => _path; public GroupId(long id) { diff --git a/NGitLab/Models/IdOrPathExtensions.cs b/NGitLab/Models/IdOrPathExtensions.cs index 9a1edef0..55fec516 100644 --- a/NGitLab/Models/IdOrPathExtensions.cs +++ b/NGitLab/Models/IdOrPathExtensions.cs @@ -5,10 +5,10 @@ namespace NGitLab.Models { public static class IdOrPathExtensions { - public static string ValueAsString(this IidOrPathAddressable idOrPath) + public static string ValueAsString(this IIdOrPathAddressable idOrPath) => idOrPath.Path ?? idOrPath.Id.ToStringInvariant(); - public static string ValueAsUriParameter(this IidOrPathAddressable idOrPath) + public static string ValueAsUriParameter(this IIdOrPathAddressable idOrPath) => idOrPath.Path is null ? idOrPath.Id.ToStringInvariant() : Uri.EscapeDataString(idOrPath.Path); } } diff --git a/NGitLab/Models/IidOrPathAddressable.cs b/NGitLab/Models/IidOrPathAddressable.cs index f72cdc39..4d5cec8f 100644 --- a/NGitLab/Models/IidOrPathAddressable.cs +++ b/NGitLab/Models/IidOrPathAddressable.cs @@ -2,7 +2,7 @@ namespace NGitLab.Models { - public interface IidOrPathAddressable + public interface IIdOrPathAddressable { internal long Id { get; } diff --git a/NGitLab/Models/ProjectId.cs b/NGitLab/Models/ProjectId.cs index 5ed4027e..61b44443 100644 --- a/NGitLab/Models/ProjectId.cs +++ b/NGitLab/Models/ProjectId.cs @@ -2,14 +2,14 @@ namespace NGitLab.Models { - public readonly struct ProjectId : IidOrPathAddressable + public readonly struct ProjectId : IIdOrPathAddressable { private readonly long _id; private readonly string _path; - long IidOrPathAddressable.Id => _id; + long IIdOrPathAddressable.Id => _id; - string IidOrPathAddressable.Path => _path; + string IIdOrPathAddressable.Path => _path; public ProjectId(long id) { diff --git a/NGitLab/PublicAPI.Unshipped.txt b/NGitLab/PublicAPI.Unshipped.txt index 08d9a55d..367915e9 100644 --- a/NGitLab/PublicAPI.Unshipped.txt +++ b/NGitLab/PublicAPI.Unshipped.txt @@ -1854,7 +1854,7 @@ NGitLab.Models.Identity.Identity() -> void NGitLab.Models.Identity.Provider -> string NGitLab.Models.Identity.SamlProviderId -> int? NGitLab.Models.IdOrPathExtensions -NGitLab.Models.IidOrPathAddressable +NGitLab.Models.IIdOrPathAddressable NGitLab.Models.Issue NGitLab.Models.Issue.Assignee -> NGitLab.Models.Assignee NGitLab.Models.Issue.Assignees -> NGitLab.Models.Assignee[] @@ -3747,8 +3747,8 @@ static NGitLab.Models.FileUpsert.Base64Encode(string plainText) -> string static NGitLab.Models.GroupId.implicit operator NGitLab.Models.GroupId(long id) -> NGitLab.Models.GroupId static NGitLab.Models.GroupId.implicit operator NGitLab.Models.GroupId(NGitLab.Models.Group group) -> NGitLab.Models.GroupId static NGitLab.Models.GroupId.implicit operator NGitLab.Models.GroupId(string path) -> NGitLab.Models.GroupId -static NGitLab.Models.IdOrPathExtensions.ValueAsString(this NGitLab.Models.IidOrPathAddressable idOrPath) -> string -static NGitLab.Models.IdOrPathExtensions.ValueAsUriParameter(this NGitLab.Models.IidOrPathAddressable idOrPath) -> string +static NGitLab.Models.IdOrPathExtensions.ValueAsString(this NGitLab.Models.IIdOrPathAddressable idOrPath) -> string +static NGitLab.Models.IdOrPathExtensions.ValueAsUriParameter(this NGitLab.Models.IIdOrPathAddressable idOrPath) -> string static NGitLab.Models.ProjectId.implicit operator NGitLab.Models.ProjectId(long id) -> NGitLab.Models.ProjectId static NGitLab.Models.ProjectId.implicit operator NGitLab.Models.ProjectId(NGitLab.Models.Project project) -> NGitLab.Models.ProjectId static NGitLab.Models.ProjectId.implicit operator NGitLab.Models.ProjectId(string path) -> NGitLab.Models.ProjectId