summaryrefslogtreecommitdiff
path: root/src/SMAPI.Toolkit/Framework/Clients/WebApi/ModEntryVersionModel.cs
blob: 9aac7fd3b7b05b78da05acdfed6cd2c96191d24a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#nullable disable

using Newtonsoft.Json;
using StardewModdingAPI.Toolkit.Serialization.Converters;

namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi
{
    /// <summary>Metadata about a version.</summary>
    public class ModEntryVersionModel
    {
        /*********
        ** Accessors
        *********/
        /// <summary>The version number.</summary>
        [JsonConverter(typeof(NonStandardSemanticVersionConverter))]
        public ISemanticVersion Version { get; set; }

        /// <summary>The mod page URL.</summary>
        public string Url { get; set; }


        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        public ModEntryVersionModel() { }

        /// <summary>Construct an instance.</summary>
        /// <param name="version">The version number.</param>
        /// <param name="url">The mod page URL.</param>
        public ModEntryVersionModel(ISemanticVersion version, string url)
        {
            this.Version = version;
            this.Url = url;
        }
    }
}