From 9c072333d161d2510ee884d71dc9a714bbf86033 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 22 Sep 2017 00:58:25 -0400 Subject: rename mods endpoint & model (#336) --- .../Models/ModGenericModel.cs | 55 ---------------------- src/StardewModdingAPI.Web/Models/ModInfoModel.cs | 55 ++++++++++++++++++++++ 2 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 src/StardewModdingAPI.Web/Models/ModGenericModel.cs create mode 100644 src/StardewModdingAPI.Web/Models/ModInfoModel.cs (limited to 'src/StardewModdingAPI.Web/Models') diff --git a/src/StardewModdingAPI.Web/Models/ModGenericModel.cs b/src/StardewModdingAPI.Web/Models/ModGenericModel.cs deleted file mode 100644 index 88a6e4bd..00000000 --- a/src/StardewModdingAPI.Web/Models/ModGenericModel.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Newtonsoft.Json; - -namespace StardewModdingAPI.Web.Models -{ - /// Generic metadata about a mod. - public class ModGenericModel - { - /********* - ** Accessors - *********/ - /// The namespaced mod key. - public string ModKey { get; } - - /// The mod name. - public string Name { get; } - - /// The mod's semantic version number. - public string Version { get; } - - /// The mod's web URL. - public string Url { get; } - - /// The error message indicating why the mod is invalid (if applicable). - public string Error { get; } - - - /********* - ** Public methods - *********/ - /// Construct a valid instance. - /// The namespaced mod key. - /// The mod name. - /// The mod's semantic version number. - /// The mod's web URL. - /// The error message indicating why the mod is invalid (if applicable). - [JsonConstructor] - public ModGenericModel(string modKey, string name, string version, string url, string error = null) - { - this.ModKey = modKey; - this.Name = name; - this.Version = version; - this.Url = url; - this.Error = error; // mainly initialised here for the JSON deserialiser - } - - /// Construct an valid instance. - /// The namespaced mod key. - /// The error message indicating why the mod is invalid. - public ModGenericModel(string modKey, string error) - { - this.ModKey = modKey; - this.Error = error; - } - } -} diff --git a/src/StardewModdingAPI.Web/Models/ModInfoModel.cs b/src/StardewModdingAPI.Web/Models/ModInfoModel.cs new file mode 100644 index 00000000..723d6c73 --- /dev/null +++ b/src/StardewModdingAPI.Web/Models/ModInfoModel.cs @@ -0,0 +1,55 @@ +using Newtonsoft.Json; + +namespace StardewModdingAPI.Web.Models +{ + /// Generic metadata about a mod. + public class ModInfoModel + { + /********* + ** Accessors + *********/ + /// The namespaced mod key. + public string ModKey { get; } + + /// The mod name. + public string Name { get; } + + /// The mod's semantic version number. + public string Version { get; } + + /// The mod's web URL. + public string Url { get; } + + /// The error message indicating why the mod is invalid (if applicable). + public string Error { get; } + + + /********* + ** Public methods + *********/ + /// Construct a valid instance. + /// The namespaced mod key. + /// The mod name. + /// The mod's semantic version number. + /// The mod's web URL. + /// The error message indicating why the mod is invalid (if applicable). + [JsonConstructor] + public ModInfoModel(string modKey, string name, string version, string url, string error = null) + { + this.ModKey = modKey; + this.Name = name; + this.Version = version; + this.Url = url; + this.Error = error; // mainly initialised here for the JSON deserialiser + } + + /// Construct an valid instance. + /// The namespaced mod key. + /// The error message indicating why the mod is invalid. + public ModInfoModel(string modKey, string error) + { + this.ModKey = modKey; + this.Error = error; + } + } +} -- cgit