From 84c406ce36254d639e15cadf901f414e3c13e3d1 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 30 Nov 2018 00:15:24 -0500 Subject: add ModDrop support in API & update checks (#604) --- .../Clients/ModDrop/ResponseModels/FileDataModel.cs | 21 +++++++++++++++++++++ .../Clients/ModDrop/ResponseModels/ModDataModel.cs | 15 +++++++++++++++ .../Clients/ModDrop/ResponseModels/ModListModel.cs | 11 +++++++++++ .../Clients/ModDrop/ResponseModels/ModModel.cs | 12 ++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/FileDataModel.cs create mode 100644 src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/ModDataModel.cs create mode 100644 src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/ModListModel.cs create mode 100644 src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/ModModel.cs (limited to 'src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels') diff --git a/src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/FileDataModel.cs b/src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/FileDataModel.cs new file mode 100644 index 00000000..fa84b287 --- /dev/null +++ b/src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/FileDataModel.cs @@ -0,0 +1,21 @@ +namespace StardewModdingAPI.Web.Framework.Clients.ModDrop.ResponseModels +{ + /// Metadata from the ModDrop API about a mod file. + public class FileDataModel + { + /// Whether the file is deleted. + public bool IsDeleted { get; set; } + + /// Whether the file is hidden from users. + public bool IsHidden { get; set; } + + /// Whether this is the default file for the mod. + public bool IsDefault { get; set; } + + /// Whether this is an archived file. + public bool IsOld { get; set; } + + /// The file version. + public string Version { get; set; } + } +} diff --git a/src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/ModDataModel.cs b/src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/ModDataModel.cs new file mode 100644 index 00000000..cfdd6a4e --- /dev/null +++ b/src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/ModDataModel.cs @@ -0,0 +1,15 @@ +namespace StardewModdingAPI.Web.Framework.Clients.ModDrop.ResponseModels +{ + /// Metadata about a mod from the ModDrop API. + public class ModDataModel + { + /// The mod's unique ID on ModDrop. + public int ID { get; set; } + + /// The error code, if any. + public int? ErrorCode { get; set; } + + /// The mod name. + public string Title { get; set; } + } +} diff --git a/src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/ModListModel.cs b/src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/ModListModel.cs new file mode 100644 index 00000000..7f692ca1 --- /dev/null +++ b/src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/ModListModel.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace StardewModdingAPI.Web.Framework.Clients.ModDrop.ResponseModels +{ + /// A list of mods from the ModDrop API. + public class ModListModel + { + /// The mod data. + public IDictionary Mods { get; set; } + } +} diff --git a/src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/ModModel.cs b/src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/ModModel.cs new file mode 100644 index 00000000..9f4b2c6f --- /dev/null +++ b/src/SMAPI.Web/Framework/Clients/ModDrop/ResponseModels/ModModel.cs @@ -0,0 +1,12 @@ +namespace StardewModdingAPI.Web.Framework.Clients.ModDrop.ResponseModels +{ + /// An entry in a mod list from the ModDrop API. + public class ModModel + { + /// The available file downloads. + public FileDataModel[] Files { get; set; } + + /// The mod metadata. + public ModDataModel Mod { get; set; } + } +} -- cgit