summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-08-01 11:07:29 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-08-01 11:07:29 -0400
commit60b41195778af33fd609eab66d9ae3f1d1165e8f (patch)
tree7128b906d40e94c56c34ed6058f27bc31c31a08b /src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs
parentb9bc1a6d17cafa0a97b46ffecda432cfc2f23b51 (diff)
parent52cf953f685c65b2b6814e375ec9a5ffa03c440a (diff)
downloadSMAPI-60b41195778af33fd609eab66d9ae3f1d1165e8f.tar.gz
SMAPI-60b41195778af33fd609eab66d9ae3f1d1165e8f.tar.bz2
SMAPI-60b41195778af33fd609eab66d9ae3f1d1165e8f.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs')
-rw-r--r--src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs b/src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs
new file mode 100644
index 00000000..18252298
--- /dev/null
+++ b/src/SMAPI.Web/Framework/ModRepositories/ModInfoModel.cs
@@ -0,0 +1,56 @@
+namespace StardewModdingAPI.Web.Framework.ModRepositories
+{
+ /// <summary>Generic metadata about a mod.</summary>
+ internal class ModInfoModel
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The mod name.</summary>
+ public string Name { get; set; }
+
+ /// <summary>The mod's latest release number.</summary>
+ public string Version { get; set; }
+
+ /// <summary>The mod's latest optional release, if newer than <see cref="Version"/>.</summary>
+ public string PreviewVersion { get; set; }
+
+ /// <summary>The mod's web URL.</summary>
+ public string Url { get; set; }
+
+ /// <summary>The error message indicating why the mod is invalid (if applicable).</summary>
+ public string Error { get; set; }
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an empty instance.</summary>
+ public ModInfoModel()
+ {
+ // needed for JSON deserialising
+ }
+
+ /// <summary>Construct an instance.</summary>
+ /// <param name="name">The mod name.</param>
+ /// <param name="version">The semantic version for the mod's latest release.</param>
+ /// <param name="previewVersion">The semantic version for the mod's latest preview release, if available and different from <see cref="Version"/>.</param>
+ /// <param name="url">The mod's web URL.</param>
+ /// <param name="error">The error message indicating why the mod is invalid (if applicable).</param>
+ public ModInfoModel(string name, string version, string url, string previewVersion = null, string error = null)
+ {
+ this.Name = name;
+ this.Version = version;
+ this.PreviewVersion = previewVersion;
+ this.Url = url;
+ this.Error = error;
+ }
+
+ /// <summary>Construct an instance.</summary>
+ /// <param name="error">The error message indicating why the mod is invalid.</param>
+ public ModInfoModel(string error)
+ {
+ this.Error = error;
+ }
+ }
+}