summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs')
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs
new file mode 100644
index 00000000..c0ee34ea
--- /dev/null
+++ b/src/StardewModdingAPI.Toolkit/Framework/Clients/WebApi/ModSeachModel.cs
@@ -0,0 +1,37 @@
+using System.Collections.Generic;
+using System.Linq;
+
+namespace StardewModdingAPI.Toolkit.Framework.Clients.WebApi
+{
+ /// <summary>Specifies mods whose update-check info to fetch.</summary>
+ public class ModSearchModel
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The namespaced mod keys to search.</summary>
+ public string[] ModKeys { get; set; }
+
+ /// <summary>Whether to allow non-semantic versions, instead of returning an error for those.</summary>
+ public bool AllowInvalidVersions { get; set; }
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an empty instance.</summary>
+ public ModSearchModel()
+ {
+ // needed for JSON deserialising
+ }
+
+ /// <summary>Construct an instance.</summary>
+ /// <param name="modKeys">The namespaced mod keys to search.</param>
+ /// <param name="allowInvalidVersions">Whether to allow non-semantic versions, instead of returning an error for those.</param>
+ public ModSearchModel(IEnumerable<string> modKeys, bool allowInvalidVersions)
+ {
+ this.ModKeys = modKeys.ToArray();
+ this.AllowInvalidVersions = allowInvalidVersions;
+ }
+ }
+}