isn/src/isnd/Data/Catalog/RegistratioinLeave.cs

54 lines
1.6 KiB
C#

3 years ago
using System.ComponentModel.DataAnnotations;
3 years ago
using isnd.Entities;
3 years ago
using Newtonsoft.Json;
3 years ago
using isn.abst;
3 years ago
namespace isnd.Data.Catalog
{
/// <summary>
/// Hosts a catalog entry,
/// the atomic content reference
/// </summary>
2 years ago
public class RegistrationLeave
3 years ago
{
2 years ago
public RegistrationLeave(string apiBase, string pkgId, string fullVersionString, PackageDetails entry)
3 years ago
{
this.registration = apiBase + ApiConfig.Registration + "/" + pkgId + "/" + fullVersionString + ".json";
Id = registration;
3 years ago
this.PackageContent = apiBase + ApiConfig.Nuget + "/" + pkgId + "/" + fullVersionString
2 years ago
+ "/" + pkgId + "-" + fullVersionString + "." + Constants.PacketFileExtension;
3 years ago
Entry = entry;
}
3 years ago
/*
@id string yes
catalogEntry object yes
packageContent string yes
*/
/// <summary>
/// The URL to the registration leaf
/// </summary>
/// <value></value>
[JsonProperty("@id")]
[Key][Required]
[StringLength(1024)]
public string Id { get; set; }
/// <summary>
/// The catalog entry containing the package metadata
/// </summary>
/// <value></value>
[JsonProperty("catalogEntry")]
public PackageDetails Entry { get; set; }
3 years ago
/// <summary>
/// The URL to the package content (.nupkg)
/// </summary>
/// <value></value>
[JsonProperty("packageContent")]
public string PackageContent { get; set; }
3 years ago
public string registration { get; set; }
3 years ago
}
}