forked from loic-sharma/BaGet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Client SDK] Add package deprecation (loic-sharma#471)
Addresses loic-sharma#395
- Loading branch information
1 parent
15b2060
commit 89da76b
Showing
4 changed files
with
88 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace BaGet.Protocol.Models | ||
{ | ||
/// <summary> | ||
/// The alternate package that should be used instead of a deprecated package. | ||
/// | ||
/// See https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource#package-deprecation | ||
/// </summary> | ||
public class AlternatePackage | ||
{ | ||
[JsonProperty("@id")] | ||
public string Url { get; set; } | ||
|
||
[JsonProperty("@type")] | ||
public string Type { get; set; } | ||
|
||
/// <summary> | ||
/// The ID of the alternate package. | ||
/// </summary> | ||
[JsonProperty("id")] | ||
public string Id { get; set; } | ||
|
||
/// <summary> | ||
/// The allowed version range, or * if any version is allowed. | ||
/// </summary> | ||
[JsonProperty("range")] | ||
public string Range { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace BaGet.Protocol.Models | ||
{ | ||
/// <summary> | ||
/// A package's metadata. | ||
/// | ||
/// See https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource#package-deprecation | ||
/// </summary> | ||
public class PackageDeprecation | ||
{ | ||
/// <summary> | ||
/// The URL to the document used to produce this object. | ||
/// </summary> | ||
[JsonProperty("@id")] | ||
public string CatalogLeafUrl { get; set; } | ||
|
||
/// <summary> | ||
/// The reasons why the package was deprecated. | ||
/// Deprecation reasons include: "Legacy", "CriticalBugs", and "Other". | ||
/// </summary> | ||
[JsonProperty("reasons")] | ||
public IReadOnlyList<string> Reasons { get; set; } | ||
|
||
/// <summary> | ||
/// The additional details about this deprecation. | ||
/// </summary> | ||
[JsonProperty("message")] | ||
public string Message { get; set; } | ||
|
||
/// <summary> | ||
/// The alternate package that should be used instead. | ||
/// </summary> | ||
[JsonProperty("alternatePackage")] | ||
public AlternatePackage AlternatePackage { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters